Skip to content

Commit

Permalink
Implement C(-S)-tab buffer switch in Helm layer
Browse files Browse the repository at this point in the history
Equivalent to PR syl20bnr#14287 for ivy-layer
  • Loading branch information
dalanicolai authored and wang-d committed Jul 22, 2021
1 parent 367ef40 commit 7f3fcbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
3 changes: 2 additions & 1 deletion doc/DOCUMENTATION.org
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
6 changes: 6 additions & 0 deletions layers/+completion/helm/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7f3fcbf

Please sign in to comment.