Skip to content

Commit

Permalink
Cleanup which-key names
Browse files Browse the repository at this point in the history
Moved:
- ("ai" "irc") to both the `erc` and `rcirc` layers. They don't have to be
  renamed until the layers are loaded.

- ("ay" "ipython notebook") to the `ipython-notebook` layer.

- ("p$" "projects/shell")
  ("'"  "open shell")
  ("as" "shells")
  to the `shell` layer.

- The commands with keybindings from spacemacs-bootstrap/packages.el to
  spacemacs-defaults/keybindings.el.

Removed:
- ("gd" "diff") it seems to be an old group name, there's no `SPC g d` group at
  the moment.

- ("Re" "elisp") and ("Rp" "pcre") because they have moved to:
  ("xr" "regular expressions")
  ("xre" "elisp")
  ("xrp" "pcre")

- ("xm" "move") seems to be an old move text group, the current keybindings are
  `SPC x J` and `SPC x K` which opens the Move Text Transient State.

- ("b" "persp-buffers") because `SPC b` is also renamed as ("b" "buffers") which
  is more general and not persp-mode specific.
  • Loading branch information
duianto authored and syl20bnr committed Feb 18, 2019
1 parent b364cd3 commit 3de7081
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 38 deletions.
1 change: 1 addition & 0 deletions layers/+chat/erc/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"aiE" 'erc-tls
"aii" 'erc-track-switch-buffer
"aiD" 'erc/default-servers)
(spacemacs/declare-prefix "ai" "irc")
;; utf-8 always and forever
(setq erc-server-coding-system '(utf-8 . utf-8)))
:config
Expand Down
1 change: 1 addition & 0 deletions layers/+chat/rcirc/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
rcirc-track-minor-mode))

(spacemacs/set-leader-keys "air" 'spacemacs/rcirc)
(spacemacs/declare-prefix "ai" "irc")
(evil-set-initial-state 'rcirc-mode 'insert))
(setq rcirc-fill-column 80
rcirc-buffer-maximum-lines 2048
Expand Down
27 changes: 1 addition & 26 deletions layers/+distributions/spacemacs-bootstrap/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -338,27 +338,11 @@
("\\(.+\\)-transient-state/\\(.+\\)" . "\\2")
("\\(.+\\)-transient-state/body" . "\\1-transient-state")
("spacemacs-layouts/non-restricted-buffer-list-\\(helm\\|ivy\\)" . "global-list-buffers")
("spacemacs/alternate-buffer" . "last buffer")
("spacemacs/default-pop-shell" . "open shell")
("spacemacs/helm-project-smart-do-search" . "smart search")
("spacemacs/helm-project-smart-do-search-region-or-symbol" . "smart search w/input")
("spacemacs/search-project-auto" . "search project")
("spacemacs/search-project-auto-region-or-symbol" . "search project w/input")
("spacemacs/toggle-holy-mode" . "emacs (holy-mode)")
("spacemacs/toggle-hybrid-mode" . "hybrid (hybrid-mode)")
("spacemacs/toggle-mode-line-\\(.+\\)" . "\\1")
("avy-goto-line" . "avy line")
("avy-goto-word-or-subword-1" . "avy word")
("er/expand-region" . "expand region")
("evil-lisp-state-\\(.+\\)" . "\\1")
("helm-apropos" . "apropos")
("helm-descbinds" . "show keybindings")
("helm-mini\\|ivy-switch-buffer" . "list-buffers")
("lazy-helm/\\(.+\\)" . "\\1")
("lazy-helm/spacemacs/\\(.+\\)" . "\\1")
("shell-command" . "shell cmd")
("sp-split-sexp" . "split sexp")
("universal-argument" . "universal arg")
)))
(dolist (nd new-descriptions)
;; ensure the target matches the whole string
Expand Down Expand Up @@ -478,18 +462,9 @@
(push '(("\\(.*\\)C-c C-d C-d" . "elisp-slime-nav-describe-elisp-thing-at-point") . t)
which-key-replacement-alist)

(dolist (leader-key `(,dotspacemacs-leader-key ,dotspacemacs-emacs-leader-key))
(which-key-add-key-based-replacements
(concat leader-key " m") "major mode commands"
(concat leader-key " " dotspacemacs-emacs-command-key) "M-x"))

(which-key-add-key-based-replacements
dotspacemacs-leader-key '("root" . "Spacemacs root")
dotspacemacs-emacs-leader-key '("root" . "Spacemacs root")
(concat dotspacemacs-leader-key " m")
'("major-mode-cmd" . "Major mode commands")
(concat dotspacemacs-emacs-leader-key " m")
'("major-mode-cmd" . "Major mode commands"))
dotspacemacs-emacs-leader-key '("root" . "Spacemacs root"))

;; disable special key handling for spacemacs, since it can be
;; disorienting if you don't understand it
Expand Down
1 change: 1 addition & 0 deletions layers/+lang/ipython-notebook/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
(spacemacs/set-leader-keys
"ayl" 'ein:notebooklist-login
"ayo" 'ein:notebooklist-open)
(spacemacs/declare-prefix "ay" "ipython notebook")
(with-eval-after-load 'ein-notebooklist
(evilified-state-evilify-map ein:notebooklist-mode-map
:mode ein:notebooklist-mode
Expand Down
1 change: 0 additions & 1 deletion layers/+source-control/git/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
(when (eq window-system 'w32)
(setenv "GIT_ASKPASS" "git-gui--askpass"))
;; key bindings
(spacemacs/declare-prefix "gd" "diff")
(spacemacs/declare-prefix "gf" "file")
(spacemacs/set-leader-keys
"gb" 'spacemacs/git-blame-micro-state
Expand Down
26 changes: 18 additions & 8 deletions layers/+spacemacs/spacemacs-defaults/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
;; ---------------------------------------------------------------------------

;; We define prefix commands only for the sake of which-key
(setq spacemacs/key-binding-prefixes '(("a" "applications")
(setq spacemacs/key-binding-prefixes '(("SPC" "M-x")
("TAB" "last buffer")
("!" "shell cmd")
("*" "search project w/input")
("/" "search project")
("?" "show keybindings")
("a" "applications")
("A" "other applications")
("ai" "irc")
("as" "shells")
("ay" "ipython notebook")
("b" "buffers")
("bN" "new empty buffer")
("c" "compile/comments")
Expand All @@ -36,32 +39,40 @@
("hP" "profiler")
("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")
("p" "projects")
("p$" "projects/shell")
("q" "quit")
("r" "registers/rings/resume")
("Re" "elisp")
("Rp" "pcre")
("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")
("T" "UI toggles/themes")
("C-t" "other toggles")
("u" "universal arg")
("v" "expand region")
("w" "windows")
("wc" "centered")
("wp" "popup")
Expand All @@ -71,7 +82,6 @@
("xg" "google-translate")
("xj" "justification")
("xl" "lines")
("xm" "move")
("xt" "transpose")
("xw" "words")
("z" "zoom")))
Expand Down
1 change: 0 additions & 1 deletion layers/+spacemacs/spacemacs-layouts/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
(setq spacemacs--last-selected-layout persp-last-persp-name))
(add-hook 'persp-mode-hook 'spacemacs//layout-autosave)
(advice-add 'persp-load-state-from-file :before 'spacemacs//layout-wait-for-modeline)
(spacemacs/declare-prefix "b" "persp-buffers")
;; Override SPC TAB to only change buffers in perspective
(spacemacs/set-leader-keys
"ba" 'persp-add-buffer
Expand Down
7 changes: 5 additions & 2 deletions layers/+tools/shell/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
(defun shell/post-init-projectile ()
(spacemacs/set-leader-keys
"p'" 'spacemacs/projectile-shell-pop
"p$t" 'projectile-multi-term-in-root))
"p$t" 'projectile-multi-term-in-root)
(spacemacs/declare-prefix "p$" "projects/shell"))

(defun shell/init-shell ()
(spacemacs/register-repl 'shell 'shell)
Expand Down Expand Up @@ -227,7 +228,9 @@
"asi" 'spacemacs/shell-pop-inferior-shell
"asm" 'spacemacs/shell-pop-multiterm
"ast" 'spacemacs/shell-pop-ansi-term
"asT" 'spacemacs/shell-pop-term))))
"asT" 'spacemacs/shell-pop-term)
(spacemacs/declare-prefix "'" "open shell")
(spacemacs/declare-prefix "as" "shells"))))

(defun shell/init-term ()
(spacemacs/register-repl 'term 'term)
Expand Down

0 comments on commit 3de7081

Please sign in to comment.