2018-03-05 01:36:40 +00:00
|
|
|
;;; keybindings.el --- Spacemacs Defaults Layer key-bindings File
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-01-14 04:12:56 +00:00
|
|
|
|
2016-04-03 04:12:28 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
;; Prefixes
|
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
;; We define prefix commands only for the sake of which-key
|
2020-07-18 07:56:54 +00:00
|
|
|
(setq spacemacs/key-binding-prefixes `((,dotspacemacs-emacs-command-key "M-x")
|
|
|
|
("!" "shell cmd")
|
|
|
|
("*" "search project w/input")
|
|
|
|
("/" "search project")
|
|
|
|
("?" "show keybindings")
|
|
|
|
("a" "applications")
|
|
|
|
("ac" "chat")
|
|
|
|
("ae" "email")
|
|
|
|
("af" "fun")
|
|
|
|
("ar" "readers")
|
|
|
|
("am" "music")
|
|
|
|
("at" "tools")
|
|
|
|
("ats" "shells")
|
|
|
|
("aw" "web-services")
|
|
|
|
("c" "compile/comments")
|
|
|
|
("C" "capture/colors")
|
|
|
|
("e" "errors")
|
|
|
|
("g" "git/versions-control")
|
|
|
|
("h" "help")
|
|
|
|
("hd" "help-describe")
|
|
|
|
("hP" "profiler")
|
|
|
|
("hT" "tutorials")
|
|
|
|
("i" "insertion")
|
|
|
|
("j" "jump/join/split")
|
|
|
|
("jj" "avy timer")
|
|
|
|
("jl" "avy line")
|
|
|
|
("js" "split sexp")
|
|
|
|
("jw" "avy word")
|
|
|
|
("k" "lisp")
|
|
|
|
("kd" "delete")
|
|
|
|
("kD" "delete-backward")
|
|
|
|
("k`" "hybrid")
|
|
|
|
("m" "major mode commands")
|
|
|
|
("n" "narrow/numbers")
|
|
|
|
("N" "navigation")
|
|
|
|
("o" "user bindings")
|
|
|
|
("p" "projects")
|
|
|
|
("q" "quit")
|
|
|
|
("r" "registers/rings/resume")
|
|
|
|
("s" "search/symbol")
|
|
|
|
("sa" "ag")
|
|
|
|
("sg" "grep")
|
|
|
|
("sk" "ack")
|
|
|
|
("sp" "search project")
|
|
|
|
("sP" "search project w/input")
|
|
|
|
("sr" "ripgrep")
|
|
|
|
("st" "pt")
|
|
|
|
("sw" "web")
|
|
|
|
("t" "toggles")
|
|
|
|
("tC" "colors")
|
|
|
|
("tE" "editing-styles")
|
|
|
|
("tEe" "emacs (holy-mode)")
|
|
|
|
("tEh" "hybrid (hybrid-mode)")
|
|
|
|
("th" "highlight")
|
|
|
|
("tm" "modeline")
|
|
|
|
("tt" "timeclock")
|
|
|
|
("T" "UI toggles/themes")
|
|
|
|
("C-t" "other toggles")
|
|
|
|
("u" "universal arg")
|
|
|
|
("v" "expand region")
|
|
|
|
("w" "windows")
|
|
|
|
("wc" "centered")
|
|
|
|
("wp" "popup")
|
|
|
|
("x" "text")
|
|
|
|
("xa" "align")
|
|
|
|
("xd" "delete")
|
|
|
|
("xg" "google-translate")
|
|
|
|
("xj" "justification")
|
|
|
|
("xl" "lines")
|
|
|
|
("xR" "Randomize")
|
|
|
|
("xt" "transpose")
|
|
|
|
("xw" "words")
|
|
|
|
("z" "zoom")))
|
2016-04-03 04:12:28 +00:00
|
|
|
(mapc (lambda (x) (apply #'spacemacs/declare-prefix x))
|
|
|
|
spacemacs/key-binding-prefixes)
|
|
|
|
|
2014-09-01 16:18:34 +00:00
|
|
|
;; instantly display current keystrokes in mini buffer
|
2014-08-05 13:49:09 +00:00
|
|
|
(setq echo-keystrokes 0.02)
|
2014-09-21 03:08:58 +00:00
|
|
|
;; auto-indent on RET
|
|
|
|
(define-key global-map (kbd "RET") 'newline-and-indent)
|
2015-05-28 04:05:29 +00:00
|
|
|
|
|
|
|
;; improve delete-other-windows
|
2015-08-23 01:47:30 +00:00
|
|
|
(define-key global-map (kbd "C-x 1") 'spacemacs/toggle-maximize-buffer)
|
2019-05-07 23:08:47 +00:00
|
|
|
;; adds two spacing modes while preserving just-one-space behaviour
|
|
|
|
(define-key global-map (kbd "M-SPC") 'cycle-spacing)
|
2015-05-28 04:05:29 +00:00
|
|
|
|
2014-10-22 18:23:10 +00:00
|
|
|
;; alternate binding to search next occurrence with isearch without
|
|
|
|
;; exiting isearch
|
|
|
|
(define-key isearch-mode-map (kbd "S-<return>") 'isearch-repeat-forward)
|
|
|
|
(define-key isearch-mode-map (kbd "M-S-<return>") 'isearch-repeat-backward)
|
2015-03-31 11:51:08 +00:00
|
|
|
;; Escape from isearch-mode("/" and "?" in evil-mode) like vim
|
|
|
|
(define-key isearch-mode-map (kbd "<escape>") 'isearch-cancel)
|
2014-10-04 04:28:42 +00:00
|
|
|
|
2014-12-10 15:57:45 +00:00
|
|
|
;; Make <escape> quit as much as possible
|
|
|
|
(define-key minibuffer-local-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-ns-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-completion-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-must-match-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
(define-key minibuffer-local-isearch-map (kbd "<escape>") 'keyboard-escape-quit)
|
|
|
|
|
2021-03-20 12:12:38 +00:00
|
|
|
;; Also bind C-n C-p in minibuffer
|
|
|
|
(define-key minibuffer-local-map (kbd "C-n") 'next-line-or-history-element)
|
|
|
|
(define-key minibuffer-local-map (kbd "C-p") 'previous-line-or-history-element)
|
|
|
|
|
2015-03-26 05:48:16 +00:00
|
|
|
;; linum margin bindings-------------------------------------------------------
|
|
|
|
(global-set-key (kbd "<left-margin> <down-mouse-1>") 'spacemacs/md-select-linum)
|
|
|
|
(global-set-key (kbd "<left-margin> <mouse-1>") 'spacemacs/mu-select-linum)
|
|
|
|
(global-set-key (kbd "<left-margin> <double-mouse-1>") 'spacemacs/select-current-block)
|
|
|
|
(global-set-key (kbd "<left-margin> <drag-mouse-1>") 'spacemacs/mu-select-linum)
|
|
|
|
|
2014-09-01 16:18:34 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
2015-12-21 04:00:09 +00:00
|
|
|
;; spacemacs leader key bindings
|
2014-09-01 16:18:34 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
2013-01-17 19:17:38 +00:00
|
|
|
|
2014-10-29 02:16:30 +00:00
|
|
|
;; Universal argument ---------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "u" 'universal-argument)
|
2015-09-08 10:30:18 +00:00
|
|
|
(when (memq dotspacemacs-editing-style '(vim hybrid))
|
|
|
|
(define-key universal-argument-map
|
|
|
|
(kbd (concat dotspacemacs-leader-key " u"))
|
|
|
|
'universal-argument-more))
|
2014-09-04 03:46:07 +00:00
|
|
|
;; shell command -------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "!" 'shell-command)
|
2019-11-14 07:26:18 +00:00
|
|
|
;; kmacros --------------------------------------------------------------------
|
2020-03-06 01:59:21 +00:00
|
|
|
(spacemacs|spacebind
|
2020-03-01 13:50:24 +00:00
|
|
|
"Operations on rectangular selections of text."
|
|
|
|
:global
|
|
|
|
(("K" "Keyboard Macros"
|
|
|
|
("c" "Counter"
|
|
|
|
("a" kmacro-add-counter "Increment counter")
|
|
|
|
("c" kmacro-insert-counter "Insert counter")
|
2020-03-06 03:39:13 +00:00
|
|
|
("C" kmacro-set-counter "Set counter...")
|
|
|
|
("f" kmacro-set-format "Set display format..."))
|
2020-03-01 13:50:24 +00:00
|
|
|
("e" "Edit"
|
2020-03-06 03:39:13 +00:00
|
|
|
("b" kmacro-bind-to-key "Assign key binding...")
|
2020-03-01 13:50:24 +00:00
|
|
|
("e" kmacro-edit-macro-repeat "Edit last macro")
|
2020-03-06 03:39:13 +00:00
|
|
|
("l" kmacro-edit-lossage "Create macro from lossage...")
|
|
|
|
("n" kmacro-name-last-macro "Name last macro...")
|
|
|
|
("r" kmacro-to-register "Write macro to register...")
|
|
|
|
("s" kmacro-step-edit-macro "Step by step edit..."))
|
|
|
|
("k" kmacro-start-macro-or-insert-counter "Start macro/Insert counter")
|
2020-03-01 13:50:24 +00:00
|
|
|
("K" kmacro-end-or-call-macro "Stop or Run")
|
|
|
|
("r" "Ring"
|
|
|
|
("L" kmacro-view-ring-2nd "Display ring head")
|
|
|
|
("d" kmacro-delete-ring-head "Delete ring head")
|
|
|
|
("l" kmacro-call-ring-2nd-repeat "Run 2nd macro in ring")
|
|
|
|
("n" kmacro-cycle-ring-next "Next in ring")
|
|
|
|
("p" kmacro-cycle-ring-previous "Previous in ring")
|
|
|
|
("s" kmacro-swap-ring "Swap first two"))
|
|
|
|
("v" kmacro-view-macro-repeat "View last macro"))))
|
2019-11-14 07:26:18 +00:00
|
|
|
;; rectangles ------------------------------------------------------------------
|
2020-03-06 03:39:13 +00:00
|
|
|
(spacemacs|spacebind
|
|
|
|
"Operations on rectangular selections of text."
|
|
|
|
:global
|
|
|
|
(("C-v" "Rectangles"
|
|
|
|
("c" close-rectangle "Delete whitespace after")
|
|
|
|
("d" delete-rectangle "Delete text")
|
|
|
|
("e" rectangle-exchange-point-and-mark "Go to corner")
|
|
|
|
("i" copy-rectangle-to-register "Copy into register...")
|
|
|
|
("k" kill-rectangle "Delete and save")
|
|
|
|
("l" rectangle-left-char "Move left past EOL")
|
|
|
|
("m" rectangle-mark-mode "Toggle region as rectangular")
|
|
|
|
("n" rectangle-next-line "Go to next line past EOL")
|
|
|
|
("N" rectangle-number-lines "Insert line number")
|
|
|
|
("o" open-rectangle "Shift text right")
|
|
|
|
("p" rectangle-previous-line "Go to prev. line past EOL")
|
|
|
|
("r" rectangle-right-char "Move right past EOL")
|
|
|
|
("s" string-rectangle "Replace lines with string...")
|
|
|
|
("x" clear-rectangle "Blank out rectangle")
|
|
|
|
("y" yank-rectangle "Paste last rectangle"))))
|
2013-01-17 19:17:38 +00:00
|
|
|
;; applications ---------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2020-06-28 21:25:04 +00:00
|
|
|
"a*" 'calc-dispatch
|
2015-11-21 05:48:48 +00:00
|
|
|
"ap" 'list-processes
|
|
|
|
"aP" 'proced
|
2014-09-04 03:46:07 +00:00
|
|
|
"au" 'undo-tree-visualize)
|
2020-04-01 15:46:49 +00:00
|
|
|
;; easy pg ----------------------------------------------------------------------
|
|
|
|
(spacemacs|spacebind
|
|
|
|
"Encrypt / decrypt files with Easy PG"
|
|
|
|
:global
|
|
|
|
(("a" "applications"
|
2020-04-17 22:51:41 +00:00
|
|
|
("Y" "easy pg"
|
2020-04-01 15:46:49 +00:00
|
|
|
("d" epa-decrypt-file "Decrypt file to...")
|
|
|
|
("D" epa-delete-keys "Delete keys...")
|
|
|
|
("e" epa-encrypt-file "Encrypt file...")
|
|
|
|
("i" epa-insert-keys "Insert keys...")
|
|
|
|
("k" epa-list-keys "List keys...")
|
|
|
|
("K" epa-list-secret-keys "List secret keys...")
|
|
|
|
("x" epa-export-keys "Export keys...")
|
|
|
|
("s" "sign"
|
|
|
|
("f" epa-sign-file "Sign file...")
|
|
|
|
("m" epa-sign-mail "Sign mail...")
|
|
|
|
("r" epa-sign-region "Sign region..."))
|
|
|
|
("v" "verify"
|
|
|
|
("f" epa-verify-file "Verify file...")
|
|
|
|
("r" epa-verify-region "Verify region...")
|
|
|
|
("c" epa-verify-cleartext-in-region "Verify cleartext region..."))))))
|
2013-01-17 19:17:38 +00:00
|
|
|
;; buffers --------------------------------------------------------------------
|
2020-03-06 01:58:25 +00:00
|
|
|
(spacemacs|spacebind
|
|
|
|
"Compare buffers, files and directories."
|
|
|
|
:global
|
|
|
|
(("TAB" spacemacs/alternate-buffer "Last buffer")
|
|
|
|
("b" "Buffers"
|
|
|
|
("N" "New buffer"
|
|
|
|
("C-i" make-indirect-buffer "New indirect buffer...")
|
|
|
|
("f" spacemacs/new-empty-buffer-new-frame "New buffer (new frame)")
|
|
|
|
("h" spacemacs/new-empty-buffer-left "New buffer (left split)")
|
|
|
|
("i" clone-indirect-buffer "Clone buffer")
|
|
|
|
("I" clone-indirect-buffer-other-window-without-purpose "Clone buffer (other window)")
|
|
|
|
("j" spacemacs/new-empty-buffer-below "New buffer (open below)")
|
|
|
|
("k" spacemacs/new-empty-buffer-above "New buffer (open above)")
|
|
|
|
("l" spacemacs/new-empty-buffer-right "New buffer (right split)")
|
|
|
|
("n" spacemacs/new-empty-buffer "New buffer"))
|
|
|
|
("1" buffer-to-window-1 "Move buffer to window 1")
|
|
|
|
("2" buffer-to-window-2 "Move buffer to window 2")
|
|
|
|
("3" buffer-to-window-3 "Move buffer to window 3")
|
|
|
|
("4" buffer-to-window-4 "Move buffer to window 4")
|
|
|
|
("5" buffer-to-window-5 "Move buffer to window 5")
|
|
|
|
("6" buffer-to-window-6 "Move buffer to window 6")
|
|
|
|
("7" buffer-to-window-7 "Move buffer to window 7")
|
|
|
|
("8" buffer-to-window-8 "Move buffer to window 8")
|
|
|
|
("9" buffer-to-window-9 "Move buffer to window 9")
|
|
|
|
("C-d" spacemacs/kill-other-buffers "Kill other buffers...")
|
|
|
|
("C-S-d" spacemacs/kill-matching-buffers-rudely "Kill buffers...")
|
|
|
|
("d" spacemacs/kill-this-buffer "Kill buffer")
|
|
|
|
("e" spacemacs/safe-erase-buffer "Erase...")
|
|
|
|
("h" spacemacs/home "Spacemacs home buffer")
|
|
|
|
("H" spacemacs/switch-to-help-buffer "Help buffer")
|
|
|
|
("n" next-buffer "Next buffer")
|
|
|
|
("m" spacemacs/switch-to-messages-buffer "Messages buffer")
|
|
|
|
("P" spacemacs/copy-clipboard-to-whole-buffer "Paste and replace buffer")
|
|
|
|
("p" previous-buffer "Previous buffer")
|
|
|
|
("R" spacemacs/safe-revert-buffer "Revert buffer...")
|
|
|
|
("s" spacemacs/switch-to-scratch-buffer "Scratch buffer")
|
|
|
|
("u" spacemacs/reopen-killed-buffer "Reopen last killed buffer")
|
|
|
|
("x" kill-buffer-and-window "Kill buffer and close window")
|
|
|
|
("Y" spacemacs/copy-whole-buffer-to-clipboard "Copy buffer")
|
|
|
|
("w" read-only-mode "Toggle read-only"))))
|
2013-11-26 05:24:50 +00:00
|
|
|
;; Cycling settings -----------------------------------------------------------
|
2017-09-29 18:21:50 +00:00
|
|
|
(spacemacs|define-transient-state theme
|
|
|
|
:title "Themes Transient State"
|
2020-03-14 20:08:31 +00:00
|
|
|
:doc "\n[_n_/_<right>_] next [_N_/_p_/_<left>_] previous [_t_/_<up>_] list themes"
|
2017-09-29 18:21:50 +00:00
|
|
|
:bindings
|
|
|
|
("n" spacemacs/cycle-spacemacs-theme)
|
2019-02-10 15:10:51 +00:00
|
|
|
("N" spacemacs/cycle-spacemacs-theme-backward)
|
|
|
|
("p" spacemacs/cycle-spacemacs-theme-backward)
|
2020-03-14 20:08:31 +00:00
|
|
|
("t" spacemacs/theme-loader)
|
|
|
|
("<up>" spacemacs/theme-loader)
|
2017-10-20 12:20:26 +00:00
|
|
|
("<right>" spacemacs/cycle-spacemacs-theme)
|
2019-02-10 15:10:51 +00:00
|
|
|
("<left>" spacemacs/cycle-spacemacs-theme-backward))
|
2017-10-15 15:37:01 +00:00
|
|
|
(spacemacs/set-leader-keys "Tn"
|
|
|
|
'spacemacs/theme-transient-state/spacemacs/cycle-spacemacs-theme)
|
2019-02-10 15:10:51 +00:00
|
|
|
(spacemacs/set-leader-keys "TN"
|
|
|
|
'spacemacs/theme-transient-state/spacemacs/cycle-spacemacs-theme-backward)
|
2013-02-07 16:36:01 +00:00
|
|
|
;; errors ---------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2019-11-03 19:12:00 +00:00
|
|
|
"ez" 'spacemacs/last-error
|
2015-02-10 23:03:06 +00:00
|
|
|
"en" 'spacemacs/next-error
|
2016-01-24 23:17:31 +00:00
|
|
|
"eN" 'spacemacs/previous-error
|
2016-01-26 05:51:53 +00:00
|
|
|
"ep" 'spacemacs/previous-error)
|
2016-06-08 09:30:25 +00:00
|
|
|
(spacemacs|define-transient-state error
|
2019-11-06 19:14:34 +00:00
|
|
|
:title "Error Transient State"
|
2016-06-08 09:30:25 +00:00
|
|
|
:hint-is-doc t
|
|
|
|
:dynamic-hint
|
2016-10-09 16:57:46 +00:00
|
|
|
(let ((sys (spacemacs/error-delegate)))
|
2016-06-08 09:30:25 +00:00
|
|
|
(cond
|
|
|
|
((eq 'flycheck sys)
|
|
|
|
"\nBrowsing flycheck errors from this buffer.")
|
|
|
|
((eq 'emacs sys)
|
|
|
|
(let ((buf (next-error-find-buffer)))
|
|
|
|
(if buf
|
|
|
|
(concat "\nBrowsing entries from \""
|
|
|
|
(buffer-name buf)
|
|
|
|
"\""
|
|
|
|
(with-current-buffer buf
|
|
|
|
(when spacemacs--gne-line-func
|
|
|
|
(format " (%d of %d)"
|
|
|
|
(max 1 (1+ (- spacemacs--gne-cur-line
|
|
|
|
spacemacs--gne-min-line)))
|
|
|
|
(1+ (- spacemacs--gne-max-line
|
|
|
|
spacemacs--gne-min-line))))))
|
|
|
|
"\nNo next-error capable buffer found.")))))
|
|
|
|
:bindings
|
|
|
|
("n" spacemacs/next-error "next")
|
|
|
|
("p" spacemacs/previous-error "prev")
|
2017-02-01 05:39:59 +00:00
|
|
|
("N" spacemacs/previous-error "prev")
|
2018-10-22 08:09:55 +00:00
|
|
|
("z" recenter-top-bottom "recenter")
|
2016-06-08 09:30:25 +00:00
|
|
|
("q" nil "quit" :exit t)
|
|
|
|
:evil-leader "e.")
|
2019-11-14 07:26:18 +00:00
|
|
|
;; ediff ----------------------------------------------------------------------
|
2020-03-06 01:59:21 +00:00
|
|
|
(spacemacs|spacebind
|
2020-03-01 14:48:22 +00:00
|
|
|
"Compare buffers, files and directories."
|
|
|
|
:global
|
|
|
|
(("D" "Diff/Compare"
|
|
|
|
("b" "Buffers"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-buffers3 "Between 3 buffers...")
|
|
|
|
("b" ediff-buffers "Between 2 buffers...")
|
|
|
|
("B" ediff-backup "With backup file...")
|
|
|
|
("p" ediff-patch-buffer "With a patch..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("d" "Directories"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-directories3 "Between 3 directories...")
|
|
|
|
("d" ediff-directories "Between 2 directories...")
|
|
|
|
("r" ediff-directory-revisions "Using SCM revisions..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("f" "Files"
|
|
|
|
("." spacemacs/ediff-dotfile-and-template "With Spacemacs dotfile")
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-files3 "Between 3 files...")
|
|
|
|
("f" ediff-files "Between 2 files...")
|
|
|
|
("p" ediff-patch-file "With a patch...")
|
|
|
|
("v" ediff-revision "Between file revisions..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("m" "Merge"
|
|
|
|
("b" "Buffers"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-merge-buffers-with-ancestor "3-way merge...")
|
|
|
|
("b" ediff-merge-buffers "2-way merge..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("d" "Directories"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-merge-directories-with-ancestor "3-way merge...")
|
|
|
|
("d" ediff-merge-directories "2-way merge..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("f" "Files"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-merge-files-with-ancestor "3-way merge...")
|
|
|
|
("f" ediff-merge-files "2-way merge..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("r" "Revisions"
|
2020-03-06 03:39:13 +00:00
|
|
|
("3" ediff-merge-revisions-with-ancestor "3-way merge...")
|
|
|
|
("r" ediff-merge-revisions "2-way merge...")))
|
2020-03-01 14:48:22 +00:00
|
|
|
("r" "Regions"
|
2020-03-06 03:39:13 +00:00
|
|
|
("l" ediff-regions-linewise "Between 2 regions (linewise)...")
|
|
|
|
("w" ediff-regions-wordwise "Between 2 regions (wordwise)..."))
|
2020-03-01 14:48:22 +00:00
|
|
|
("w" "Windows"
|
2020-03-06 03:39:13 +00:00
|
|
|
("l" ediff-windows-linewise "Linewise between visible text...")
|
|
|
|
("w" ediff-windows-wordwise "Wordwise between visible text..."))
|
2020-03-01 23:00:43 +00:00
|
|
|
("s" ediff-show-registry "Show registry")
|
2020-03-01 14:48:22 +00:00
|
|
|
("h" ediff-documentation "Documentation"))))
|
2013-06-05 11:34:55 +00:00
|
|
|
;; file -----------------------------------------------------------------------
|
2020-03-06 01:59:21 +00:00
|
|
|
(spacemacs|spacebind
|
2020-03-01 23:00:43 +00:00
|
|
|
"Files manipulation."
|
|
|
|
:global
|
|
|
|
(("f" "Files"
|
2020-03-06 03:39:13 +00:00
|
|
|
("A" spacemacs/find-file-and-replace-buffer "Set another file for buffer...")
|
|
|
|
("c" spacemacs/copy-file "Copy file to new file...")
|
|
|
|
("D" spacemacs/delete-current-buffer-file "Delete...")
|
|
|
|
("i" spacemacs/insert-file "Insert file content...")
|
|
|
|
("l" find-file-literally "Open file literally...")
|
|
|
|
("E" spacemacs/sudo-edit "Open using sudo...")
|
|
|
|
("o" spacemacs/open-file-or-directory-in-external-app "Open with external app")
|
|
|
|
("R" spacemacs/rename-current-buffer-file "Rename...")
|
2020-03-01 23:00:43 +00:00
|
|
|
("S" evil-write-all "Save all")
|
|
|
|
("s" save-buffer "Save")
|
|
|
|
("C" "Convert"
|
|
|
|
("d" spacemacs/unix2dos "Convert to DOS")
|
|
|
|
("u" spacemacs/dos2unix "Convert to UNIX"))
|
|
|
|
("e" "Emacs/Spacemacs"
|
2020-03-06 03:39:13 +00:00
|
|
|
("C-e" spacemacs/force-init-spacemacs-env "Recreate env. variables file")
|
2020-03-01 23:00:43 +00:00
|
|
|
("c" spacemacs/recompile-elpa "Recompile packages")
|
|
|
|
("i" spacemacs/find-user-init-file "Open Emacs \"init.el\"")
|
2021-03-26 02:53:30 +00:00
|
|
|
("I" spacemacs/find-user-early-init-file "Open Emacs \"early-init.el\"")
|
2020-03-01 23:00:43 +00:00
|
|
|
("d" spacemacs/find-dotfile "Open Spacemacs dotfile")
|
|
|
|
("D" spacemacs/ediff-dotfile-and-template "Diff. with dotfile template")
|
|
|
|
("e" spacemacs/edit-env "Open \".spacemacs.env\"")
|
|
|
|
("E" dotspacemacs/call-user-env "Refresh env. variables")
|
|
|
|
("R" dotspacemacs/sync-configuration-layers "Reload configuration")
|
|
|
|
("v" spacemacs/display-and-copy-version "Copy Spacemacs version")
|
2020-03-06 03:39:13 +00:00
|
|
|
("U" configuration-layer/update-packages "Update packages..."))
|
2020-03-01 23:00:43 +00:00
|
|
|
("v" "Variables"
|
2020-03-06 03:39:13 +00:00
|
|
|
("d" add-dir-local-variable "Add directory-local variable...")
|
|
|
|
("f" add-file-local-variable "Add bottom file variable...")
|
2021-05-07 05:29:03 +00:00
|
|
|
("p" add-file-local-variable-prop-line "Add top file property...")
|
|
|
|
)
|
2020-03-01 23:00:43 +00:00
|
|
|
("y" "Yank/Copy"
|
|
|
|
("c" spacemacs/copy-file-path-with-line-column "File path with line and column")
|
|
|
|
("d" spacemacs/copy-directory-path "Directory path")
|
|
|
|
("l" spacemacs/copy-file-path-with-line "File path with line number")
|
|
|
|
("n" spacemacs/copy-file-name "File name")
|
|
|
|
("N" spacemacs/copy-file-name-base "File name without extension")
|
2020-04-16 11:45:46 +00:00
|
|
|
("y" spacemacs/copy-file-path "File path")
|
|
|
|
("b" spacemacs/copy-buffer-name "Buffer name")))))
|
2017-02-03 21:19:04 +00:00
|
|
|
;; frame ----------------------------------------------------------------------
|
2021-03-13 13:59:20 +00:00
|
|
|
(spacemacs|spacebind
|
|
|
|
"Frames"
|
|
|
|
:global
|
|
|
|
(("F" "Frames"
|
|
|
|
("f" spacemacs/find-file-other-frame "Find file other frame...")
|
|
|
|
("d" delete-frame "Delete frame")
|
|
|
|
("D" delete-other-frames "Delete other frames")
|
|
|
|
("b" spacemacs/switch-to-buffer-other-frame "Switch to buffer other frame...")
|
|
|
|
("B" spacemacs/display-buffer-other-frame "Display buffer other frame...")
|
|
|
|
("o" other-frame "Switch to other frame")
|
|
|
|
("O" spacemacs/dired-other-frame "Dired other frame...")
|
|
|
|
("n" make-frame "Make frame"))))
|
2016-01-07 17:50:21 +00:00
|
|
|
;; help -----------------------------------------------------------------------
|
2019-05-18 11:47:29 +00:00
|
|
|
(defalias 'emacs-tutorial 'help-with-tutorial)
|
2016-01-07 17:50:21 +00:00
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"hdb" 'describe-bindings
|
|
|
|
"hdc" 'describe-char
|
|
|
|
"hdf" 'describe-function
|
|
|
|
"hdk" 'describe-key
|
2016-01-11 20:47:04 +00:00
|
|
|
"hdl" 'spacemacs/describe-last-keys
|
2016-01-07 17:50:21 +00:00
|
|
|
"hdp" 'describe-package
|
2016-05-31 11:46:45 +00:00
|
|
|
"hdP" 'configuration-layer/describe-package
|
2016-01-07 17:50:21 +00:00
|
|
|
"hds" 'spacemacs/describe-system-info
|
2020-09-21 02:32:41 +00:00
|
|
|
"hdt" 'describe-text-properties
|
|
|
|
"hdT" 'describe-theme
|
2016-01-12 13:19:47 +00:00
|
|
|
"hdv" 'describe-variable
|
2016-01-26 05:51:53 +00:00
|
|
|
"hI" 'spacemacs/report-issue
|
2017-07-26 17:25:51 +00:00
|
|
|
"hn" 'view-emacs-news
|
|
|
|
"hPs" 'profiler-start
|
|
|
|
"hPk" 'profiler-stop
|
|
|
|
"hPr" 'profiler-report
|
2019-05-18 11:47:29 +00:00
|
|
|
"hPw" 'profiler-report-write-profile
|
|
|
|
"hTe" 'emacs-tutorial)
|
2013-05-07 00:59:13 +00:00
|
|
|
;; insert stuff ---------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-07-05 04:18:42 +00:00
|
|
|
"iJ" 'spacemacs/insert-line-below-no-indent
|
|
|
|
"iK" 'spacemacs/insert-line-above-no-indent
|
2015-08-23 01:47:30 +00:00
|
|
|
"ik" 'spacemacs/evil-insert-line-above
|
2019-11-14 07:26:18 +00:00
|
|
|
"ij" 'spacemacs/evil-insert-line-below
|
|
|
|
"ib" 'insert-buffer)
|
2013-07-09 19:30:59 +00:00
|
|
|
;; format ---------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2019-06-26 03:49:21 +00:00
|
|
|
"j(" 'check-parens
|
2015-03-25 07:32:57 +00:00
|
|
|
"j=" 'spacemacs/indent-region-or-buffer
|
2019-08-10 18:05:47 +00:00
|
|
|
"j+" 'spacemacs/iwb-region-or-buffer
|
2019-06-26 03:49:21 +00:00
|
|
|
"jo" 'open-line
|
2016-01-12 06:17:41 +00:00
|
|
|
"jS" 'spacemacs/split-and-new-line
|
2015-08-23 01:47:30 +00:00
|
|
|
"jk" 'spacemacs/evil-goto-next-line-and-indent)
|
2015-03-25 07:32:57 +00:00
|
|
|
|
2015-12-28 02:13:57 +00:00
|
|
|
;; navigation/jumping ---------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-12-28 02:13:57 +00:00
|
|
|
"j0" 'spacemacs/push-mark-and-goto-beginning-of-line
|
|
|
|
"j$" 'spacemacs/push-mark-and-goto-end-of-line
|
2019-06-26 03:52:21 +00:00
|
|
|
"jc" 'goto-last-change
|
2016-05-13 06:40:28 +00:00
|
|
|
"jf" 'find-function
|
2016-08-26 01:19:21 +00:00
|
|
|
"jv" 'find-variable)
|
2015-11-12 10:45:53 +00:00
|
|
|
|
2013-11-26 02:04:18 +00:00
|
|
|
;; Compilation ----------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-11-12 10:45:53 +00:00
|
|
|
"cC" 'compile
|
2015-12-07 21:30:38 +00:00
|
|
|
"ck" 'kill-compilation
|
2015-11-12 10:45:53 +00:00
|
|
|
"cr" 'recompile
|
2020-08-04 14:05:24 +00:00
|
|
|
"cn" 'next-error
|
|
|
|
"cN" 'previous-error
|
2020-04-11 10:52:46 +00:00
|
|
|
"cd" 'spacemacs/show-hide-compilation-window
|
2020-04-16 12:06:50 +00:00
|
|
|
"cb" 'spacemacs/switch-to-compilation-buffer)
|
2016-03-12 16:48:32 +00:00
|
|
|
(with-eval-after-load 'compile
|
2016-11-13 12:34:23 +00:00
|
|
|
(evil-define-key 'motion compilation-mode-map (kbd "gf") 'find-file-at-point)
|
2016-03-12 16:48:32 +00:00
|
|
|
(define-key compilation-mode-map "r" 'recompile)
|
|
|
|
(define-key compilation-mode-map "g" nil))
|
2013-01-29 15:28:06 +00:00
|
|
|
;; narrow & widen -------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-04-03 02:43:21 +00:00
|
|
|
"nr" 'narrow-to-region
|
|
|
|
"np" 'narrow-to-page
|
|
|
|
"nf" 'narrow-to-defun
|
2020-10-22 15:01:48 +00:00
|
|
|
"nR" 'spacemacs/narrow-to-region-indirect-buffer
|
|
|
|
"nP" 'spacemacs/narrow-to-page-indirect-buffer
|
|
|
|
"nF" 'spacemacs/narrow-to-defun-indirect-buffer
|
2015-04-03 02:43:21 +00:00
|
|
|
"nw" 'widen)
|
2013-01-31 15:05:57 +00:00
|
|
|
;; toggle ---------------------------------------------------------------------
|
2015-01-30 05:18:48 +00:00
|
|
|
(spacemacs|add-toggle highlight-current-line-globally
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode global-hl-line-mode
|
2015-08-27 06:58:05 +00:00
|
|
|
:documentation "Globally highlight the current line."
|
2015-07-25 13:14:53 +00:00
|
|
|
:evil-leader "thh")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle truncate-lines
|
2015-10-13 11:41:48 +00:00
|
|
|
:status truncate-lines
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (toggle-truncate-lines)
|
2015-10-13 11:41:48 +00:00
|
|
|
:off (toggle-truncate-lines -1)
|
2019-07-29 16:20:18 +00:00
|
|
|
:documentation "Toggle between line wrapping or truncation (no wrap)."
|
2015-07-25 13:14:53 +00:00
|
|
|
:evil-leader "tl")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle visual-line-navigation
|
2015-07-25 13:14:53 +00:00
|
|
|
:status visual-line-mode
|
2016-04-19 12:21:45 +00:00
|
|
|
:on
|
|
|
|
(progn
|
|
|
|
(visual-line-mode)
|
2018-10-10 23:49:32 +00:00
|
|
|
(spacemacs//init-visual-line-keys)
|
2016-04-19 12:21:45 +00:00
|
|
|
(evil-normalize-keymaps))
|
|
|
|
:off
|
|
|
|
(progn
|
|
|
|
(visual-line-mode -1)
|
|
|
|
(evil-normalize-keymaps))
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Move point according to visual lines."
|
|
|
|
:evil-leader "tL")
|
2018-10-10 23:49:32 +00:00
|
|
|
(spacemacs|add-toggle visual-line-navigation-globally
|
|
|
|
:status global-visual-line-mode
|
|
|
|
:on
|
|
|
|
(progn
|
|
|
|
(global-visual-line-mode)
|
|
|
|
(spacemacs//init-visual-line-keys)
|
|
|
|
(evil-normalize-keymaps))
|
|
|
|
:off
|
|
|
|
(progn
|
|
|
|
(global-visual-line-mode -1)
|
|
|
|
(evil-normalize-keymaps))
|
|
|
|
:documentation "Move point according to visual lines globally."
|
|
|
|
:evil-leader "t C-S-l")
|
2015-03-08 04:09:37 +00:00
|
|
|
(spacemacs|add-toggle auto-fill-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:status auto-fill-function
|
|
|
|
:on (auto-fill-mode)
|
|
|
|
:off (auto-fill-mode -1)
|
|
|
|
:documentation "Break line beyond `current-fill-column` while editing."
|
|
|
|
:evil-leader "tF")
|
2015-03-08 04:52:03 +00:00
|
|
|
(spacemacs|add-toggle debug-on-error
|
2015-10-19 10:12:15 +00:00
|
|
|
:status debug-on-error
|
|
|
|
:on (setq debug-on-error t)
|
|
|
|
:off (setq debug-on-error nil)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Toggle display of backtrace when an error happens."
|
|
|
|
:evil-leader "tD")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle fringe
|
2016-10-27 10:58:09 +00:00
|
|
|
:if (fboundp 'fringe-mode)
|
2015-07-25 13:14:53 +00:00
|
|
|
:status (not (equal fringe-mode 0))
|
|
|
|
:on (call-interactively 'fringe-mode)
|
|
|
|
:off (fringe-mode 0)
|
|
|
|
:documentation "Display the fringe in GUI mode."
|
|
|
|
:evil-leader "Tf")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle fullscreen-frame
|
2015-10-11 12:13:16 +00:00
|
|
|
:status (memq (frame-parameter nil 'fullscreen) '(fullscreen fullboth))
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (spacemacs/toggle-frame-fullscreen)
|
2015-10-11 12:13:16 +00:00
|
|
|
:off (spacemacs/toggle-frame-fullscreen)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the current frame in full screen."
|
|
|
|
:evil-leader "TF")
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle maximize-frame
|
2016-02-02 15:27:34 +00:00
|
|
|
:status (eq (frame-parameter nil 'fullscreen) 'maximized)
|
2015-07-25 13:14:53 +00:00
|
|
|
:on (toggle-frame-maximized)
|
2015-10-11 12:13:16 +00:00
|
|
|
:off (toggle-frame-maximized)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Maximize the current frame."
|
|
|
|
:evil-leader "TM")
|
2015-05-16 18:40:31 +00:00
|
|
|
(spacemacs|add-toggle mode-line
|
2015-11-16 21:48:01 +00:00
|
|
|
:status (not hidden-mode-line-mode)
|
|
|
|
:on (hidden-mode-line-mode -1)
|
|
|
|
:off (hidden-mode-line-mode)
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Toggle the visibility of modeline."
|
2016-10-21 22:40:38 +00:00
|
|
|
:evil-leader "tmT")
|
2016-10-19 19:22:58 +00:00
|
|
|
(spacemacs|add-toggle display-time
|
|
|
|
:mode display-time-mode
|
|
|
|
:documentation "Display time in modeline."
|
2016-10-21 22:40:38 +00:00
|
|
|
:evil-leader "tmt")
|
2016-10-19 19:39:09 +00:00
|
|
|
(spacemacs|add-toggle syntax-highlighting
|
|
|
|
:mode font-lock-mode
|
|
|
|
:documentation "Toggle syntax highlighting."
|
2016-10-21 22:46:05 +00:00
|
|
|
:evil-leader "ths")
|
2018-07-10 21:42:58 +00:00
|
|
|
(spacemacs|add-toggle zero-based-column-indexing
|
2018-07-12 06:13:02 +00:00
|
|
|
:documentation "Toggle column indexing starting at 0 versus 1.
|
|
|
|
|
|
|
|
This is achieved by the built in functionality available in emacs 26 by changing
|
|
|
|
the value of the `column-number-indicator-zero-based' variable. Functionality
|
2019-06-01 17:13:30 +00:00
|
|
|
that does not take into account `column-number-indicator-zero-based' will not
|
2018-07-12 06:13:02 +00:00
|
|
|
respond to this toggle."
|
2018-07-10 21:42:58 +00:00
|
|
|
:status (bound-and-true-p column-number-indicator-zero-based)
|
|
|
|
:on (setq column-number-indicator-zero-based t)
|
|
|
|
:off (setq column-number-indicator-zero-based nil)
|
2018-07-12 06:13:02 +00:00
|
|
|
:on-message (concat
|
2019-11-03 19:12:00 +00:00
|
|
|
"Column indexing starts at 0 (current column is "
|
|
|
|
(number-to-string (current-column))
|
|
|
|
")")
|
2018-07-12 06:13:02 +00:00
|
|
|
:off-message (concat
|
2019-11-03 19:12:00 +00:00
|
|
|
"Column indexing starts at 1 (current column is "
|
|
|
|
(number-to-string (1+ (current-column)))
|
|
|
|
")")
|
2018-06-02 15:14:42 +00:00
|
|
|
:evil-leader "tz")
|
|
|
|
|
2015-04-10 14:30:46 +00:00
|
|
|
(spacemacs|add-toggle transparent-frame
|
2015-07-25 13:14:53 +00:00
|
|
|
:status nil
|
|
|
|
:on (spacemacs/toggle-transparency)
|
|
|
|
:documentation "Make the current frame non-opaque."
|
|
|
|
:evil-leader "TT")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle tool-bar
|
2015-07-25 13:14:53 +00:00
|
|
|
:if window-system
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode tool-bar-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the tool bar in GUI mode."
|
|
|
|
:evil-leader "Tt")
|
2015-01-29 05:08:48 +00:00
|
|
|
(spacemacs|add-toggle menu-bar
|
2016-06-21 01:50:30 +00:00
|
|
|
:if window-system
|
2016-05-31 13:11:00 +00:00
|
|
|
:mode menu-bar-mode
|
2015-07-25 13:14:53 +00:00
|
|
|
:documentation "Display the menu bar."
|
|
|
|
:evil-leader "Tm")
|
2014-12-12 22:59:49 +00:00
|
|
|
;; quit -----------------------------------------------------------------------
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-01-29 16:19:55 +00:00
|
|
|
"qs" 'spacemacs/save-buffers-kill-emacs
|
|
|
|
"qq" 'spacemacs/prompt-kill-emacs
|
|
|
|
"qQ" 'spacemacs/kill-emacs
|
2017-01-22 03:55:34 +00:00
|
|
|
"qf" 'spacemacs/frame-killer)
|
2019-11-14 07:26:18 +00:00
|
|
|
;; timeclock ------------------------------------------------------------------
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"ttc" 'timeclock-change
|
|
|
|
"tte" 'timeclock-workday-elapsed-string
|
|
|
|
"ttg" 'timeclock-workday-remaining-string
|
|
|
|
"tti" 'timeclock-in
|
|
|
|
"ttl" 'timeclock-when-to-leave-string
|
2021-04-25 22:51:39 +00:00
|
|
|
"ttm" 'timeclock-mode-line-display
|
2019-11-14 07:26:18 +00:00
|
|
|
"tto" 'timeclock-out
|
|
|
|
"ttr" 'timeclock-reread-log
|
|
|
|
"tts" 'timeclock-status-string
|
|
|
|
"ttu" 'timeclock-update-mode-line
|
|
|
|
"ttv" 'timeclock-visit-timelog
|
|
|
|
"ttw" 'timeclock-when-to-leave-string)
|
2013-02-06 15:43:36 +00:00
|
|
|
;; window ---------------------------------------------------------------------
|
2014-12-24 05:08:56 +00:00
|
|
|
(defun split-window-below-and-focus ()
|
|
|
|
"Split the window vertically and focus the new window."
|
|
|
|
(interactive)
|
|
|
|
(split-window-below)
|
|
|
|
(windmove-down)
|
|
|
|
(when (and (boundp 'golden-ratio-mode)
|
|
|
|
(symbol-value golden-ratio-mode))
|
|
|
|
(golden-ratio)))
|
|
|
|
|
|
|
|
(defun split-window-right-and-focus ()
|
|
|
|
"Split the window horizontally and focus the new window."
|
|
|
|
(interactive)
|
|
|
|
(split-window-right)
|
|
|
|
(windmove-right)
|
|
|
|
(when (and (boundp 'golden-ratio-mode)
|
|
|
|
(symbol-value golden-ratio-mode))
|
|
|
|
(golden-ratio)))
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2016-12-25 06:15:35 +00:00
|
|
|
"w TAB" 'spacemacs/alternate-window
|
2018-05-14 21:05:07 +00:00
|
|
|
"w1" 'spacemacs/window-split-single-column
|
|
|
|
"w2" 'spacemacs/window-split-double-columns
|
|
|
|
"w3" 'spacemacs/window-split-triple-columns
|
|
|
|
"w4" 'spacemacs/window-split-grid
|
2015-08-23 01:47:30 +00:00
|
|
|
"wb" 'spacemacs/switch-to-minibuffer-window
|
2016-06-26 03:40:41 +00:00
|
|
|
"wd" 'spacemacs/delete-window
|
2016-02-12 08:08:48 +00:00
|
|
|
"wt" 'spacemacs/toggle-current-window-dedication
|
2016-01-22 23:51:43 +00:00
|
|
|
"wf" 'follow-mode
|
2016-05-18 06:59:38 +00:00
|
|
|
"wF" 'make-frame
|
2014-04-14 01:23:54 +00:00
|
|
|
"wH" 'evil-window-move-far-left
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-left>" 'evil-window-move-far-left
|
2014-04-14 01:23:54 +00:00
|
|
|
"wh" 'evil-window-left
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <left>" 'evil-window-left
|
2014-04-14 01:23:54 +00:00
|
|
|
"wJ" 'evil-window-move-very-bottom
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-down>" 'evil-window-move-very-bottom
|
2014-04-14 01:23:54 +00:00
|
|
|
"wj" 'evil-window-down
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <down>" 'evil-window-down
|
2014-04-14 01:23:54 +00:00
|
|
|
"wK" 'evil-window-move-very-top
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-up>" 'evil-window-move-very-top
|
2014-04-14 01:23:54 +00:00
|
|
|
"wk" 'evil-window-up
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <up>" 'evil-window-up
|
2014-04-14 01:23:54 +00:00
|
|
|
"wL" 'evil-window-move-far-right
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <S-right>" 'evil-window-move-far-right
|
2014-04-14 01:23:54 +00:00
|
|
|
"wl" 'evil-window-right
|
2015-08-30 08:33:02 +00:00
|
|
|
"w <right>" 'evil-window-right
|
2015-08-23 01:47:30 +00:00
|
|
|
"wm" 'spacemacs/toggle-maximize-buffer
|
2019-01-27 18:22:46 +00:00
|
|
|
"wcc" 'spacemacs/toggle-centered-buffer
|
|
|
|
"wcC" 'spacemacs/toggle-distraction-free
|
|
|
|
"wc." 'spacemacs/centered-buffer-transient-state
|
2014-12-05 01:54:05 +00:00
|
|
|
"wo" 'other-frame
|
2016-08-23 15:58:23 +00:00
|
|
|
"wr" 'spacemacs/rotate-windows-forward
|
2016-04-11 14:16:35 +00:00
|
|
|
"wR" 'spacemacs/rotate-windows-backward
|
2014-12-03 05:20:18 +00:00
|
|
|
"ws" 'split-window-below
|
2014-12-24 05:08:56 +00:00
|
|
|
"wS" 'split-window-below-and-focus
|
2014-12-14 14:53:37 +00:00
|
|
|
"w-" 'split-window-below
|
2014-04-14 01:23:54 +00:00
|
|
|
"wU" 'winner-redo
|
|
|
|
"wu" 'winner-undo
|
2014-12-03 05:20:18 +00:00
|
|
|
"wv" 'split-window-right
|
2014-12-24 05:08:56 +00:00
|
|
|
"wV" 'split-window-right-and-focus
|
2015-03-04 15:00:10 +00:00
|
|
|
"ww" 'other-window
|
2018-01-11 23:45:06 +00:00
|
|
|
"wx" 'kill-buffer-and-window
|
2015-03-17 06:06:49 +00:00
|
|
|
"w/" 'split-window-right
|
2017-09-05 15:00:42 +00:00
|
|
|
"w=" 'balance-windows-area
|
2016-11-12 20:22:46 +00:00
|
|
|
"w+" 'spacemacs/window-layout-toggle
|
2018-01-06 00:43:51 +00:00
|
|
|
"w_" 'spacemacs/maximize-horizontally
|
|
|
|
"w|" 'spacemacs/maximize-vertically)
|
2013-02-20 19:08:23 +00:00
|
|
|
;; text -----------------------------------------------------------------------
|
2015-09-28 18:50:58 +00:00
|
|
|
(defalias 'count-region 'count-words-region)
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2017-12-23 14:32:45 +00:00
|
|
|
"xa%" 'spacemacs/align-repeat-percent
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa&" 'spacemacs/align-repeat-ampersand
|
|
|
|
"xa(" 'spacemacs/align-repeat-left-paren
|
|
|
|
"xa)" 'spacemacs/align-repeat-right-paren
|
2017-01-06 17:52:17 +00:00
|
|
|
"xa{" 'spacemacs/align-repeat-left-curly-brace
|
|
|
|
"xa}" 'spacemacs/align-repeat-right-curly-brace
|
|
|
|
"xa[" 'spacemacs/align-repeat-left-square-brace
|
|
|
|
"xa]" 'spacemacs/align-repeat-right-square-brace
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa," 'spacemacs/align-repeat-comma
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa." 'spacemacs/align-repeat-decimal
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa:" 'spacemacs/align-repeat-colon
|
2016-02-09 20:02:30 +00:00
|
|
|
"xa;" 'spacemacs/align-repeat-semicolon
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa=" 'spacemacs/align-repeat-equal
|
2016-02-25 19:16:34 +00:00
|
|
|
"xa\\" 'spacemacs/align-repeat-backslash
|
2016-02-09 20:02:30 +00:00
|
|
|
"xaa" 'align
|
|
|
|
"xac" 'align-current
|
|
|
|
"xam" 'spacemacs/align-repeat-math-oper
|
|
|
|
"xar" 'spacemacs/align-repeat
|
2015-08-23 01:47:30 +00:00
|
|
|
"xa|" 'spacemacs/align-repeat-bar
|
2015-09-28 18:50:58 +00:00
|
|
|
"xc" 'count-region
|
2019-05-07 23:08:47 +00:00
|
|
|
"xd SPC" 'cycle-spacing
|
2020-01-11 10:01:18 +00:00
|
|
|
"xdl" 'delete-blank-lines
|
2014-04-14 01:23:54 +00:00
|
|
|
"xdw" 'delete-trailing-whitespace
|
2016-01-15 10:30:48 +00:00
|
|
|
"xjc" 'set-justification-center
|
|
|
|
"xjf" 'set-justification-full
|
|
|
|
"xjl" 'set-justification-left
|
|
|
|
"xjn" 'set-justification-none
|
|
|
|
"xjr" 'set-justification-right
|
2016-12-24 15:01:41 +00:00
|
|
|
"xlc" 'spacemacs/sort-lines-by-column
|
|
|
|
"xlC" 'spacemacs/sort-lines-by-column-reverse
|
2016-07-07 22:35:43 +00:00
|
|
|
"xld" 'spacemacs/duplicate-line-or-region
|
2020-03-05 20:36:30 +00:00
|
|
|
"xlk" 'spacemacs/kill-back-to-indentation
|
2019-11-20 16:31:23 +00:00
|
|
|
"xlr" 'spacemacs/randomize-lines
|
2015-08-27 22:17:16 +00:00
|
|
|
"xls" 'spacemacs/sort-lines
|
2016-12-24 11:06:21 +00:00
|
|
|
"xlS" 'spacemacs/sort-lines-reverse
|
2015-08-27 22:17:16 +00:00
|
|
|
"xlu" 'spacemacs/uniquify-lines
|
2014-04-14 01:23:54 +00:00
|
|
|
"xtc" 'transpose-chars
|
2018-06-02 15:01:08 +00:00
|
|
|
"xte" 'transpose-sexps
|
2014-04-14 01:23:54 +00:00
|
|
|
"xtl" 'transpose-lines
|
2017-05-30 12:16:05 +00:00
|
|
|
"xtp" 'transpose-paragraphs
|
2017-07-26 10:36:02 +00:00
|
|
|
"xts" 'transpose-sentences
|
|
|
|
"xtw" 'transpose-words
|
2014-04-14 01:23:54 +00:00
|
|
|
"xU" 'upcase-region
|
|
|
|
"xu" 'downcase-region
|
2016-06-15 11:40:06 +00:00
|
|
|
"xwc" 'spacemacs/count-words-analysis
|
2019-11-20 16:31:23 +00:00
|
|
|
"xwr" 'spacemacs/randomize-words
|
2016-06-15 11:40:06 +00:00
|
|
|
"x TAB" 'indent-rigidly)
|
|
|
|
|
|
|
|
(define-key indent-rigidly-map "h" 'indent-rigidly-left)
|
|
|
|
(define-key indent-rigidly-map "l" 'indent-rigidly-right)
|
|
|
|
(define-key indent-rigidly-map "H" 'indent-rigidly-left-to-tab-stop)
|
|
|
|
(define-key indent-rigidly-map "L" 'indent-rigidly-right-to-tab-stop)
|
|
|
|
|
2015-03-26 06:04:35 +00:00
|
|
|
;; shell ----------------------------------------------------------------------
|
2015-09-29 05:07:57 +00:00
|
|
|
(with-eval-after-load 'shell
|
|
|
|
(evil-define-key 'insert comint-mode-map [up] 'comint-previous-input)
|
|
|
|
(evil-define-key 'insert comint-mode-map [down] 'comint-next-input))
|
2015-02-12 05:00:23 +00:00
|
|
|
|
|
|
|
;; ---------------------------------------------------------------------------
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Transient-states
|
2015-02-12 05:00:23 +00:00
|
|
|
;; ---------------------------------------------------------------------------
|
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Buffer transient state
|
2015-03-26 05:15:16 +00:00
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state buffer
|
2019-11-06 19:14:34 +00:00
|
|
|
:title "Buffer Transient State"
|
2018-10-22 08:09:55 +00:00
|
|
|
:doc "
|
2017-10-15 15:26:47 +00:00
|
|
|
[_C-1_.._C-9_] goto nth window [_n_/_<right>_]^^ next buffer [_b_] buffer list
|
|
|
|
[_1_.._9_] move buffer to nth window [_N_/_p_/_<left>_] previous buffer [_C-d_] bury buffer
|
|
|
|
[_M-1_.._M-9_] swap buffer w/ nth window [_d_]^^^^ kill buffer [_o_] other window
|
2018-10-22 08:09:55 +00:00
|
|
|
^^^^ [_z_]^^^^ recenter [_q_] quit"
|
2015-03-26 05:15:16 +00:00
|
|
|
:bindings
|
2016-10-23 14:43:11 +00:00
|
|
|
("n" next-buffer)
|
2017-09-29 21:02:30 +00:00
|
|
|
("<right>" next-buffer)
|
2016-10-23 14:43:11 +00:00
|
|
|
("p" previous-buffer)
|
2017-09-29 21:02:30 +00:00
|
|
|
("N" previous-buffer)
|
|
|
|
("o" other-window)
|
|
|
|
("<left>" previous-buffer)
|
2018-10-27 12:22:32 +00:00
|
|
|
("b" (cond ((configuration-layer/layer-used-p 'helm)
|
|
|
|
(helm-buffers-list))
|
|
|
|
((configuration-layer/layer-used-p 'ivy)
|
|
|
|
(ivy-switch-buffer))))
|
2016-10-23 14:43:11 +00:00
|
|
|
("d" spacemacs/kill-this-buffer)
|
2017-10-15 15:26:47 +00:00
|
|
|
("C-d" bury-buffer)
|
2018-10-22 08:09:55 +00:00
|
|
|
("z" recenter-top-bottom)
|
2016-10-23 14:43:11 +00:00
|
|
|
("q" nil :exit t)
|
|
|
|
("1" move-buffer-window-no-follow-1)
|
|
|
|
("2" move-buffer-window-no-follow-2)
|
|
|
|
("3" move-buffer-window-no-follow-3)
|
|
|
|
("4" move-buffer-window-no-follow-4)
|
|
|
|
("5" move-buffer-window-no-follow-5)
|
|
|
|
("6" move-buffer-window-no-follow-6)
|
|
|
|
("7" move-buffer-window-no-follow-7)
|
|
|
|
("8" move-buffer-window-no-follow-8)
|
|
|
|
("9" move-buffer-window-no-follow-9)
|
|
|
|
("M-1" swap-buffer-window-no-follow-1)
|
|
|
|
("M-2" swap-buffer-window-no-follow-2)
|
|
|
|
("M-3" swap-buffer-window-no-follow-3)
|
|
|
|
("M-4" swap-buffer-window-no-follow-4)
|
|
|
|
("M-5" swap-buffer-window-no-follow-5)
|
|
|
|
("M-6" swap-buffer-window-no-follow-6)
|
|
|
|
("M-7" swap-buffer-window-no-follow-7)
|
|
|
|
("M-8" swap-buffer-window-no-follow-8)
|
|
|
|
("M-9" swap-buffer-window-no-follow-9)
|
2021-01-03 18:38:15 +00:00
|
|
|
("C-1" spacemacs/winum-select-window-1)
|
|
|
|
("C-2" spacemacs/winum-select-window-2)
|
|
|
|
("C-3" spacemacs/winum-select-window-3)
|
|
|
|
("C-4" spacemacs/winum-select-window-4)
|
|
|
|
("C-5" spacemacs/winum-select-window-5)
|
|
|
|
("C-6" spacemacs/winum-select-window-6)
|
|
|
|
("C-7" spacemacs/winum-select-window-7)
|
|
|
|
("C-8" spacemacs/winum-select-window-8)
|
|
|
|
("C-9" spacemacs/winum-select-window-9))
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body)
|
2015-03-30 03:31:39 +00:00
|
|
|
|
2019-11-06 19:14:34 +00:00
|
|
|
;; end of Buffer Transient State
|
2015-03-26 05:15:16 +00:00
|
|
|
|
2019-11-06 19:14:34 +00:00
|
|
|
;; Window Transient State
|
2015-02-12 05:00:23 +00:00
|
|
|
|
|
|
|
(defun spacemacs/shrink-window-horizontally (delta)
|
|
|
|
"Wrap `spacemacs/shrink-window-horizontally'."
|
|
|
|
(interactive "p")
|
|
|
|
(shrink-window delta t))
|
|
|
|
|
|
|
|
(defun spacemacs/shrink-window (delta)
|
|
|
|
"Wrap `spacemacs/shrink-window'."
|
|
|
|
(interactive "p")
|
|
|
|
(shrink-window delta))
|
|
|
|
|
|
|
|
(defun spacemacs/enlarge-window (delta)
|
|
|
|
"Wrap `spacemacs/enlarge-window'."
|
|
|
|
(interactive "p")
|
|
|
|
(enlarge-window delta))
|
|
|
|
|
|
|
|
(defun spacemacs/enlarge-window-horizontally (delta)
|
|
|
|
"Wrap `spacemacs/enlarge-window-horizontally'."
|
|
|
|
(interactive "p")
|
|
|
|
(enlarge-window delta t))
|
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(defvar spacemacs--window-ts-full-hint-toggle nil
|
|
|
|
"Display window transient state documentation.")
|
2019-10-13 02:51:27 +00:00
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(defun spacemacs//window-ts-toggle-hint ()
|
|
|
|
"Toggle the full hint docstring for the window transient state."
|
2018-10-31 03:15:14 +00:00
|
|
|
(interactive)
|
2019-11-06 20:03:15 +00:00
|
|
|
(setq spacemacs--window-ts-full-hint-toggle
|
|
|
|
(not spacemacs--window-ts-full-hint-toggle)))
|
2018-10-31 03:15:14 +00:00
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(defun spacemacs//window-ts-hint ()
|
|
|
|
"Return a condensed/full hint for the window transient state"
|
2018-10-31 03:15:14 +00:00
|
|
|
(concat
|
|
|
|
" "
|
2019-11-06 20:03:15 +00:00
|
|
|
(if spacemacs--window-ts-full-hint-toggle
|
|
|
|
spacemacs--window-ts-full-hint
|
2019-11-06 19:14:34 +00:00
|
|
|
(concat "[" (propertize "?" 'face 'hydra-face-red) "] help"
|
2019-11-06 20:03:15 +00:00
|
|
|
spacemacs--window-ts-minified-hint))))
|
2018-10-31 03:15:14 +00:00
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(spacemacs|transient-state-format-hint window
|
|
|
|
spacemacs--window-ts-minified-hint "\n
|
2019-11-22 04:45:56 +00:00
|
|
|
Select: _a_ _h_ _j_ _k_ _l_ _w_ _0_.._9_ Move: _H_ _J_ _K_ _L_ _r_ _R_ Split: _s_ _v_ Resize: _[_ _]_ _{_ _}_ _m_ _|_ ___")
|
2018-10-31 03:15:14 +00:00
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(spacemacs|transient-state-format-hint window
|
|
|
|
spacemacs--window-ts-full-hint
|
|
|
|
(format "\n[_?_] toggle help
|
2018-10-31 03:16:28 +00:00
|
|
|
Select^^^^ Move^^^^ Split^^^^^^ Resize^^ Other^^
|
|
|
|
──────^^^^───────────── ────^^^^──────────── ─────^^^^^^───────────── ──────^^─────────── ─────^^──────────────────
|
2019-11-22 04:45:56 +00:00
|
|
|
[_j_/_k_] down/up [_J_/_K_] down/up [_s_]^^^^ horizontal [_[_] shrink horiz [_d_] close current
|
|
|
|
[_h_/_l_] left/right [_H_/_L_] left/right [_S_]^^^^ horiz & follow [_]_] enlarge horiz [_D_] close other
|
|
|
|
[_0_.._9_] window 0..9 [_r_]^^ rotate fwd [_v_]^^^^ vertical [_{_] shrink verti [_u_] restore prev layout
|
|
|
|
[_a_]^^ ace-window [_R_]^^ rotate bwd [_V_]^^^^ verti & follow [_}_] enlarge verti [_U_] restore next layout
|
|
|
|
[_o_]^^ other frame ^^^^ [_m_/_|_/___] maximize %s^^^^^^^^^^^^^^^^^ [_q_] quit
|
|
|
|
[_w_]^^ other window"
|
2018-10-31 03:15:14 +00:00
|
|
|
(if (configuration-layer/package-used-p 'golden-ratio)
|
2019-11-22 04:45:56 +00:00
|
|
|
;; the following strings need to be the same length as:
|
|
|
|
;; %s^^^^^^^^^^^^^^^^^ (above) to keep the following key aligned
|
|
|
|
"[_g_] golden-ratio "
|
|
|
|
"^^ ")))
|
2018-10-31 03:15:14 +00:00
|
|
|
|
2019-11-06 20:03:15 +00:00
|
|
|
(spacemacs|define-transient-state window
|
2019-11-06 19:14:34 +00:00
|
|
|
:title "Window Transient State"
|
2018-10-31 03:15:14 +00:00
|
|
|
:hint-is-doc t
|
2019-11-06 20:03:15 +00:00
|
|
|
:dynamic-hint (spacemacs//window-ts-hint)
|
2015-02-12 05:00:23 +00:00
|
|
|
:bindings
|
2019-11-06 20:03:15 +00:00
|
|
|
("?" spacemacs//window-ts-toggle-hint)
|
2019-11-22 04:45:56 +00:00
|
|
|
;; Select
|
|
|
|
("j" evil-window-down)
|
|
|
|
("<down>" evil-window-down)
|
|
|
|
("k" evil-window-up)
|
|
|
|
("<up>" evil-window-up)
|
|
|
|
("h" evil-window-left)
|
|
|
|
("<left>" evil-window-left)
|
|
|
|
("l" evil-window-right)
|
|
|
|
("<right>" evil-window-right)
|
2021-01-03 18:38:15 +00:00
|
|
|
("0" spacemacs/winum-select-window-0)
|
|
|
|
("1" spacemacs/winum-select-window-1)
|
|
|
|
("2" spacemacs/winum-select-window-2)
|
|
|
|
("3" spacemacs/winum-select-window-3)
|
|
|
|
("4" spacemacs/winum-select-window-4)
|
|
|
|
("5" spacemacs/winum-select-window-5)
|
|
|
|
("6" spacemacs/winum-select-window-6)
|
|
|
|
("7" spacemacs/winum-select-window-7)
|
|
|
|
("8" spacemacs/winum-select-window-8)
|
|
|
|
("9" spacemacs/winum-select-window-9)
|
2019-11-22 04:45:56 +00:00
|
|
|
("a" ace-window)
|
|
|
|
("o" other-frame)
|
|
|
|
("w" other-window)
|
|
|
|
;; Move
|
2016-01-14 02:43:45 +00:00
|
|
|
("J" evil-window-move-very-bottom)
|
|
|
|
("<S-down>" evil-window-move-very-bottom)
|
|
|
|
("K" evil-window-move-very-top)
|
|
|
|
("<S-up>" evil-window-move-very-top)
|
2019-11-22 04:45:56 +00:00
|
|
|
("H" evil-window-move-far-left)
|
|
|
|
("<S-left>" evil-window-move-far-left)
|
2016-01-14 02:43:45 +00:00
|
|
|
("L" evil-window-move-far-right)
|
|
|
|
("<S-right>" evil-window-move-far-right)
|
2016-08-23 15:58:23 +00:00
|
|
|
("r" spacemacs/rotate-windows-forward)
|
2016-08-21 15:11:36 +00:00
|
|
|
("R" spacemacs/rotate-windows-backward)
|
2019-11-22 04:45:56 +00:00
|
|
|
;; Split
|
2016-01-14 02:43:45 +00:00
|
|
|
("s" split-window-below)
|
|
|
|
("S" split-window-below-and-focus)
|
2019-11-22 04:45:56 +00:00
|
|
|
("-" split-window-below-and-focus)
|
2016-01-14 02:43:45 +00:00
|
|
|
("v" split-window-right)
|
|
|
|
("V" split-window-right-and-focus)
|
2019-11-22 04:45:56 +00:00
|
|
|
("/" split-window-right-and-focus)
|
2018-10-31 03:16:28 +00:00
|
|
|
("m" spacemacs/toggle-maximize-buffer)
|
|
|
|
("|" spacemacs/maximize-vertically)
|
2019-11-22 04:45:56 +00:00
|
|
|
("_" spacemacs/maximize-horizontally)
|
|
|
|
;; Resize
|
|
|
|
("[" spacemacs/shrink-window-horizontally)
|
|
|
|
("]" spacemacs/enlarge-window-horizontally)
|
|
|
|
("{" spacemacs/shrink-window)
|
|
|
|
("}" spacemacs/enlarge-window)
|
|
|
|
;; Other
|
|
|
|
("d" delete-window)
|
|
|
|
("D" delete-other-windows)
|
|
|
|
("u" winner-undo)
|
|
|
|
("U" winner-redo)
|
|
|
|
("q" nil :exit t))
|
2018-10-27 12:26:21 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2019-11-06 20:03:15 +00:00
|
|
|
"w." 'spacemacs/window-transient-state/body
|
|
|
|
"w[" 'spacemacs/window-transient-state/spacemacs/shrink-window-horizontally
|
|
|
|
"w]" 'spacemacs/window-transient-state/spacemacs/enlarge-window-horizontally
|
|
|
|
"w{" 'spacemacs/window-transient-state/spacemacs/shrink-window
|
|
|
|
"w}" 'spacemacs/window-transient-state/spacemacs/enlarge-window)
|
2015-02-12 05:00:23 +00:00
|
|
|
|
2019-11-06 19:14:34 +00:00
|
|
|
;; end of Window Transient State
|
2015-03-30 02:15:17 +00:00
|
|
|
|
2019-11-06 19:14:34 +00:00
|
|
|
;; Text Transient State
|
2015-03-30 02:15:17 +00:00
|
|
|
|
|
|
|
(defun spacemacs/scale-up-or-down-font-size (direction)
|
|
|
|
"Scale the font. If DIRECTION is positive or zero the font is scaled up,
|
|
|
|
otherwise it is scaled down."
|
|
|
|
(interactive)
|
|
|
|
(let ((scale 0.5))
|
|
|
|
(if (eq direction 0)
|
|
|
|
(text-scale-set 0)
|
|
|
|
(if (< direction 0)
|
|
|
|
(text-scale-decrease scale)
|
|
|
|
(text-scale-increase scale)))))
|
|
|
|
|
|
|
|
(defun spacemacs/scale-up-font ()
|
|
|
|
"Scale up the font."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size 1))
|
|
|
|
|
|
|
|
(defun spacemacs/scale-down-font ()
|
|
|
|
"Scale up the font."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size -1))
|
|
|
|
|
|
|
|
(defun spacemacs/reset-font-size ()
|
|
|
|
"Reset the font size."
|
|
|
|
(interactive)
|
|
|
|
(spacemacs/scale-up-or-down-font-size 0))
|
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state scale-font
|
|
|
|
:title "Font Scaling Transient State"
|
2019-05-20 17:10:51 +00:00
|
|
|
:doc "\n[_+_/_=_/_k_] scale up [_-_/___/_j_] scale down [_0_] reset font [_q_] quit"
|
2015-03-30 02:15:17 +00:00
|
|
|
:bindings
|
|
|
|
("+" spacemacs/scale-up-font)
|
2015-11-16 14:08:24 +00:00
|
|
|
("=" spacemacs/scale-up-font)
|
2019-05-20 17:10:51 +00:00
|
|
|
("k" spacemacs/scale-up-font)
|
2015-03-30 02:15:17 +00:00
|
|
|
("-" spacemacs/scale-down-font)
|
2019-05-20 17:10:51 +00:00
|
|
|
("_" spacemacs/scale-down-font)
|
2018-08-25 02:23:13 +00:00
|
|
|
("j" spacemacs/scale-down-font)
|
2015-11-16 14:08:24 +00:00
|
|
|
("0" spacemacs/reset-font-size)
|
2015-05-18 05:38:14 +00:00
|
|
|
("q" nil :exit t))
|
2018-08-25 02:23:13 +00:00
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs/set-leader-keys "zx" 'spacemacs/scale-font-transient-state/body)
|
2015-03-30 02:15:17 +00:00
|
|
|
|
2019-11-06 19:14:34 +00:00
|
|
|
;; end of Text Transient State
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; Transparency transient-state
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/toggle-transparency (&optional frame)
|
|
|
|
"Toggle between transparent and opaque state for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2017-03-03 16:08:39 +00:00
|
|
|
(let ((alpha (frame-parameter frame 'alpha))
|
|
|
|
(dotfile-setting (cons dotspacemacs-active-transparency
|
|
|
|
dotspacemacs-inactive-transparency)))
|
|
|
|
(if (equal alpha dotfile-setting)
|
|
|
|
(spacemacs/disable-transparency frame)
|
|
|
|
(spacemacs/enable-transparency frame dotfile-setting))))
|
|
|
|
|
|
|
|
(defun spacemacs/enable-transparency (&optional frame alpha)
|
|
|
|
"Enable transparency for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame.
|
|
|
|
ALPHA is a pair of active and inactive transparency values. The
|
|
|
|
default value for ALPHA is based on
|
|
|
|
`dotspacemacs-active-transparency' and
|
|
|
|
`dotspacemacs-inactive-transparency'."
|
2017-03-02 15:41:04 +00:00
|
|
|
(interactive)
|
2017-03-03 16:08:39 +00:00
|
|
|
(let ((alpha-setting (or alpha
|
|
|
|
(cons dotspacemacs-active-transparency
|
|
|
|
dotspacemacs-inactive-transparency))))
|
|
|
|
(set-frame-parameter frame 'alpha alpha-setting)))
|
2017-03-02 15:41:04 +00:00
|
|
|
|
|
|
|
(defun spacemacs/disable-transparency (&optional frame)
|
2017-03-03 16:08:39 +00:00
|
|
|
"Disable transparency for FRAME.
|
2017-03-02 15:41:04 +00:00
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
|
|
|
(interactive)
|
|
|
|
(set-frame-parameter frame 'alpha '(100 . 100)))
|
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/increase-transparency (&optional frame)
|
|
|
|
"Increase transparency for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2017-03-03 16:08:39 +00:00
|
|
|
(let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
|
2015-06-24 06:57:20 +00:00
|
|
|
(increased-alpha (- current-alpha 5)))
|
|
|
|
(when (>= increased-alpha frame-alpha-lower-limit)
|
2016-10-04 23:54:36 +00:00
|
|
|
(set-frame-parameter frame 'alpha
|
2015-12-23 17:43:06 +00:00
|
|
|
(cons increased-alpha increased-alpha)))))
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-10-04 23:54:36 +00:00
|
|
|
(defun spacemacs/decrease-transparency (&optional frame)
|
|
|
|
"Decrease transparency for FRAME.
|
|
|
|
If FRAME is nil, it defaults to the selected frame."
|
2015-06-24 06:57:20 +00:00
|
|
|
(interactive)
|
2017-03-03 16:08:39 +00:00
|
|
|
(let* ((current-alpha (or (car (frame-parameter frame 'alpha)) 100))
|
2015-06-24 06:57:20 +00:00
|
|
|
(decreased-alpha (+ current-alpha 5)))
|
|
|
|
(when (<= decreased-alpha 100)
|
2016-10-04 23:54:36 +00:00
|
|
|
(set-frame-parameter frame 'alpha
|
2015-12-23 17:43:06 +00:00
|
|
|
(cons decreased-alpha decreased-alpha)))))
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-20 02:55:38 +00:00
|
|
|
(spacemacs|define-transient-state scale-transparency
|
|
|
|
:title "Frame Transparency Transient State"
|
2019-05-20 17:10:51 +00:00
|
|
|
:doc "\n[_+_/_=_/_k_] increase transparency [_-_/___/_j_] decrease [_T_] toggle [_q_] quit"
|
2015-06-24 06:57:20 +00:00
|
|
|
:bindings
|
2016-04-21 11:21:28 +00:00
|
|
|
("+" spacemacs/increase-transparency)
|
|
|
|
("=" spacemacs/increase-transparency)
|
2019-05-20 17:10:51 +00:00
|
|
|
("k" spacemacs/increase-transparency)
|
2016-04-21 11:21:28 +00:00
|
|
|
("-" spacemacs/decrease-transparency)
|
2019-05-20 17:10:51 +00:00
|
|
|
("_" spacemacs/decrease-transparency)
|
2018-08-25 02:23:13 +00:00
|
|
|
("j" spacemacs/decrease-transparency)
|
2016-04-21 11:21:28 +00:00
|
|
|
("T" spacemacs/toggle-transparency)
|
|
|
|
("q" nil :exit t))
|
2016-01-14 02:43:45 +00:00
|
|
|
(spacemacs/set-leader-keys "TT"
|
2016-01-20 02:55:38 +00:00
|
|
|
'spacemacs/scale-transparency-transient-state/spacemacs/toggle-transparency)
|
2015-06-24 06:57:20 +00:00
|
|
|
|
2016-01-30 11:32:53 +00:00
|
|
|
;; end of Transparency Transient State
|