diff --git a/CHANGELOG.develop b/CHANGELOG.develop index 3156577301fe..52a311ed858c 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -2354,6 +2354,7 @@ Other: - Bound =SPC s l= to =ivy-resume= (thanks to Wieland Hoffmann) - Rebind =C-k= to =C-M-k= in =ivy-reverse-i-search= (=C-r= at a prompt) (thanks to duianto) + - Add =C-(S)-tab= keybindings for buffer switching (thanks to Daniel Nicolai) - Removed definitions for =spacemacs/swiper-region-or-symbol= and =spacemacs/swiper-all-region-or-symbol= and updated keybindings, because Ivy has more advanced implementation via =swiper-thing-at-point= and diff --git a/doc/DOCUMENTATION.org b/doc/DOCUMENTATION.org index e68820891e93..8507ca433e57 100644 --- a/doc/DOCUMENTATION.org +++ b/doc/DOCUMENTATION.org @@ -2442,32 +2442,33 @@ The mode can be toggled on and off with ~SPC t g~. **** Buffers manipulation key bindings Buffer manipulation commands (start with ~b~): -| Key binding | Description | -|-----------------+----------------------------------------------------------------------------------------| -| ~SPC TAB~ | switch to alternate buffer in the current window (switch back and forth) | -| ~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) | -| ~SPC b D~ | kill a visible buffer using [[https://github.com/abo-abo/ace-window][ace-window]] | -| ~SPC u SPC b D~ | kill a visible buffer and its window using [[https://github.com/abo-abo/ace-window][ace-window]] | -| ~SPC b C-d~ | kill other buffers | -| ~SPC b C-D~ | kill buffers using a regular expression | -| ~SPC b e~ | erase the content of the buffer (ask for confirmation) | -| ~SPC b h~ | open =*spacemacs*= home buffer | -| ~SPC b H~ | open or select the =*Help*= buffer | -| ~SPC b n~ | switch to next buffer avoiding buffers matching =spacemacs-useless-buffers-regexp= | -| ~SPC b m~ | open =*Messages*= buffer | -| ~SPC u SPC b m~ | kill all buffers and windows except the current one | -| ~SPC b M~ | kill all buffers matching the regexp | -| ~SPC b p~ | switch to previous buffer avoiding buffers matching =spacemacs-useless-buffers-regexp= | -| ~SPC b P~ | copy clipboard and replace buffer (useful when pasting from a browser) | -| ~SPC b R~ | revert the current buffer (reload from disk) | -| ~SPC b s~ | switch to the =*scratch*= buffer (create it if needed) | -| ~SPC b u~ | reopen the most recently killed file buffer | -| ~SPC b w~ | toggle read-only (writable state) | -| ~SPC b x~ | kill the current buffer and window (does not delete the visited file) | -| ~SPC b Y~ | copy whole buffer to clipboard (useful when copying to a browser) | -| ~z f~ | Make current function or comments visible in buffer as much as possible | +| Key binding | Description | +|-----------------+---------------------------------------------------------------------------------------------| +| ~SPC TAB~ | switch to alternate buffer in the current window (switch back and forth) | +| ~C TAB/C-S TAB~ | cycle back/forward over previous buffers while showing them (only supported with Ivy layer) | +| ~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) | +| ~SPC b D~ | kill a visible buffer using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC u SPC b D~ | kill a visible buffer and its window using [[https://github.com/abo-abo/ace-window][ace-window]] | +| ~SPC b C-d~ | kill other buffers | +| ~SPC b C-D~ | kill buffers using a regular expression | +| ~SPC b e~ | erase the content of the buffer (ask for confirmation) | +| ~SPC b h~ | open =*spacemacs*= home buffer | +| ~SPC b H~ | open or select the =*Help*= buffer | +| ~SPC b n~ | switch to next buffer avoiding buffers matching =spacemacs-useless-buffers-regexp= | +| ~SPC b m~ | open =*Messages*= buffer | +| ~SPC u SPC b m~ | kill all buffers and windows except the current one | +| ~SPC b M~ | kill all buffers matching the regexp | +| ~SPC b p~ | switch to previous buffer avoiding buffers matching =spacemacs-useless-buffers-regexp= | +| ~SPC b P~ | copy clipboard and replace buffer (useful when pasting from a browser) | +| ~SPC b R~ | revert the current buffer (reload from disk) | +| ~SPC b s~ | switch to the =*scratch*= buffer (create it if needed) | +| ~SPC b u~ | reopen the most recently killed file buffer | +| ~SPC b w~ | toggle read-only (writable state) | +| ~SPC b x~ | kill the current buffer and window (does not delete the visited file) | +| ~SPC b Y~ | copy whole buffer to clipboard (useful when copying to a browser) | +| ~z f~ | Make current function or comments visible in buffer as much as possible | **** Create a new empty buffer diff --git a/layers/+completion/ivy/packages.el b/layers/+completion/ivy/packages.el index 2407039d85d8..a043d86bcfa8 100644 --- a/layers/+completion/ivy/packages.el +++ b/layers/+completion/ivy/packages.el @@ -210,6 +210,12 @@ "rl" 'ivy-resume "sl" 'ivy-resume "bb" 'ivy-switch-buffer) + ;; Common Ctrl-TAB buffer switch behavior + (with-eval-after-load 'evil + (evil-global-set-key 'motion (kbd "") 'ivy-switch-buffer) + (evil-global-set-key 'motion (kbd "") 'ivy-switch-buffer)) + (define-key ivy-mode-map (kbd "") 'ivy-next-line-and-call) + (define-key ivy-mode-map (kbd "") 'ivy-previous-line-and-call) ;; Moved C-k to C-M-k (define-key ivy-switch-buffer-map (kbd "C-M-k") 'ivy-switch-buffer-kill) (define-key ivy-reverse-i-search-map