Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,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