I am using emacs I find that sometimes I have 2 files separated into 2 windows.
For example: I open 1 file using C-x C-f file1.c RET
and I split t
If you are using Prelude you can just use C-c s
(prelude-swap-windows
). From the Prelude documentation:
C-c s
runs the commandcrux-swap-windows
(found inprelude-mode-map
), which is an alias forcrux-transpose-windows
in crux.el.
The following code snippet can do switch buffer.
(defun ab/switch-buffer-each-other (arg)
"switch current buffer with other window buffer
right-2-left and up-2-down"
(interactive "p")
(cond
((windmove-find-other-window 'right) (buf-move-right))
((windmove-find-other-window 'left) (buf-move-left))
((windmove-find-other-window 'up) (buf-move-up))
((windmove-find-other-window 'down) (buf-move-down)))
(message "switch buffer done"))