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

Make SPC TAB window-aware #2551

Closed
wants to merge 1 commit into from
Closed
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
44 changes: 22 additions & 22 deletions doc/DOCUMENTATION.org
Original file line number Diff line number Diff line change
Expand Up @@ -1330,28 +1330,28 @@ dotfile.
**** Buffers manipulation key bindings
Buffer manipulation commands (start with ~b~):

| Key Binding | Description |
|-------------+-------------------------------------------------------------------------|
| ~SPC TAB~ | switch to alternate buffer (switch back and forth) |
| ~SPC b b~ | switch to a buffer using =helm= |
| ~SPC b d~ | kill the current buffer (does not delete the visited file) |
| ~SPC b e~ | erase the content of the buffer (ask for confirmation) |
| ~SPC b h~ | open =*spacemacs*= home buffer |
| ~SPC b k~ | kill a buffer |
| ~SPC b K~ | kill all buffers except the current one |
| ~SPC b C-K~ | kill all buffers matching the regexp |
| ~SPC b m h~ | move a buffer to the left |
| ~SPC b m j~ | move a buffer to the bottom |
| ~SPC b m k~ | move a buffer to the top |
| ~SPC b m l~ | move a buffer to the right |
| ~SPC b M~ | swap windows using [[https://github.com/abo-abo/ace-window][ace-swap-window]] |
| ~SPC b n~ | switch to next buffer avoiding special buffers |
| ~SPC b p~ | switch to previous buffer avoiding special buffers |
| ~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 w~ | toggle read-only (writable state) |
| ~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) |
| ~SPC b b~ | switch to a buffer using =helm= |
| ~SPC b d~ | kill the current buffer (does not delete the visited file) |
| ~SPC b e~ | erase the content of the buffer (ask for confirmation) |
| ~SPC b h~ | open =*spacemacs*= home buffer |
| ~SPC b k~ | kill a buffer |
| ~SPC b K~ | kill all buffers except the current one |
| ~SPC b C-K~ | kill all buffers matching the regexp |
| ~SPC b m h~ | move a buffer to the left |
| ~SPC b m j~ | move a buffer to the bottom |
| ~SPC b m k~ | move a buffer to the top |
| ~SPC b m l~ | move a buffer to the right |
| ~SPC b M~ | swap windows using [[https://github.com/abo-abo/ace-window][ace-swap-window]] |
| ~SPC b n~ | switch to next buffer avoiding special buffers |
| ~SPC b p~ | switch to previous buffer avoiding special buffers |
| ~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 w~ | toggle read-only (writable state) |
| ~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 |

**** Buffers manipulation manipulation micro-state
A convenient buffer manipulation micro-state allows to quickly cycles through
Expand Down
7 changes: 5 additions & 2 deletions spacemacs/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,12 @@ The body of the advice is in BODY."
(ert t))

(defun spacemacs/alternate-buffer ()
"Switch back and forth between current and last buffer."
"Switch back and forth between current and last buffer in the
current window."
(interactive)
(switch-to-buffer (other-buffer (current-buffer) t)))
(if (evil-alternate-buffer)
(switch-to-buffer (car (evil-alternate-buffer)))
(switch-to-buffer (other-buffer (current-buffer) t))))

(defun spacemacs/highlight-TODO-words ()
"Highlight keywords for "
Expand Down