No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
lukhas Merge pull request #12 from ZzAntares/master
Let the user choose whether point should stay after swapping buffers
Latest commit cb517ec Jun 15, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore * .gitignore: ignore .elc file Oct 6, 2014
LICENSE Initial commit May 15, 2014
README.md Let the user choose whether point should stay after swapping buffers May 28, 2016
buffer-move.el Misalignment fixed May 28, 2016

README.md

buffer-move

This file is for lazy people wanting to swap buffers without typing C-x b on each window. This is useful when you have :

+--------------+-------------+
|              |             |
|    #emacs    |    #gnus    |
|              |             |
+--------------+-------------+
|                            |
|           .emacs           |
|                            |
+----------------------------+

and you want to have :

+--------------+-------------+
|              |             |
|    #gnus     |   .emacs    |
|              |             |
+--------------+-------------+
|                            |
|           #emacs           |
|                            |
+----------------------------+

With buffer-move, just go in #gnus, do buf-move-left, go to #emacs (which now should be on top right) and do buf-move-down.

To use it, simply put a (require 'buffer-move) in your ~/.emacs and define some keybindings. For example, i use :

(global-set-key (kbd "<C-S-up>")     'buf-move-up)
(global-set-key (kbd "<C-S-down>")   'buf-move-down)
(global-set-key (kbd "<C-S-left>")   'buf-move-left)
(global-set-key (kbd "<C-S-right>")  'buf-move-right)

By default the point will switch along with the moving buffer, if you want the point to stay (as vim switches) you can set buffer-move-stay-after-swap to a non-nil value like so:

(setq buffer-move-stay-after-swap t)

Alternatively, you may let the current window switch back to the previous buffer, instead of swapping the buffers of both windows. Set the following customization variable to 'move to activate this behavior:

(setq buffer-move-behavior 'move)