Implement C(-S)-tab buffer switch in Helm layer

Equivalent to PR #14287 for ivy-layer
This commit is contained in:
Daniel Nicolai 2021-01-29 11:11:44 +01:00 committed by Maximilian Wolff
parent ba8f5414c9
commit dc7b04dc66
3 changed files with 9 additions and 1 deletions

View File

@ -2247,6 +2247,7 @@ Other:
- Add ~C-d~ to create a project perspective and open a project root dired
buffer, from the ~SPC p l~ persp switch project prompt
(thanks to Magnus Therning)
- Add =C(-S)-tab= keybindings for buffer switching (thanks to Daniel Nicolai)
- Fixes:
- Fixed signature of =spacemacs//display-helm-window= (thanks to Jack Kamm)
- Fixed initialization by calling =helm-mode= when Helm is initialized=

View File

@ -2440,11 +2440,12 @@ The mode can be toggled on and off with ~SPC t g~.
*** Buffers and Files
**** Buffers manipulation key bindings
Buffer manipulation commands (start with ~b~):
With few exceptions, buffer manipulation commands (start with ~b~):
| Key binding | Description |
|-----------------+----------------------------------------------------------------------------------------|
| ~SPC TAB~ | switch to alternate buffer in the current window (switch back and forth) |
| ~C-TAB/C-S tab~ | cycle backward/forward through previous visited buffers (i.e. scroll helm buffer list) |
| ~SPC b b~ | switch to a buffer |
| ~SPC b d~ | kill the current buffer (does not delete the visited file) |
| ~SPC u SPC b d~ | kill the current buffer and window (does not delete the visited file) |

View File

@ -85,6 +85,9 @@
(global-set-key (kbd "M-x") 'spacemacs/helm-M-x-fuzzy-matching))
(global-set-key (kbd "C-x C-f") 'spacemacs/helm-find-files)
(global-set-key (kbd "C-x b") 'helm-buffers-list)
;; use helm to switch last(/previous) visited buffers with C(-S)-tab
(evil-global-set-key 'motion (kbd "<C-tab>") 'helm-buffers-list)
(evil-global-set-key 'motion (kbd "<C-iso-lefttab>") 'helm-buffers-list)
;; use helm everywhere
(spacemacs||set-helm-key "<f1>" helm-apropos)
(spacemacs||set-helm-key "a'" helm-available-repls)
@ -169,6 +172,9 @@
(setq helm-white-buffer-regexp-list
(append helm-white-buffer-regexp-list
spacemacs-useful-buffers-regexp))
;; use helm to switch last(/previous) visited buffers with C(-S)-tab
(define-key helm-map (kbd "<C-tab>") 'helm-follow-action-forward)
(define-key helm-map (kbd "<C-iso-lefttab>") 'helm-follow-action-backward)
;; alter helm-bookmark key bindings to be simpler
(defun simpler-helm-bookmark-keybindings ()
(define-key helm-bookmark-map (kbd "C-d") 'helm-bookmark-run-delete)