How to swap the buffers in 2 windows emacs

前端 未结 8 1414
情深已故
情深已故 2020-12-22 20:51

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

相关标签:
8条回答
  • 2020-12-22 21:15

    If you are using Prelude you can just use C-c s (prelude-swap-windows). From the Prelude documentation:

    C-c s runs the command crux-swap-windows (found in prelude-mode-map), which is an alias for crux-transpose-windows in crux.el.

    0 讨论(0)
  • 2020-12-22 21:16

    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"))
    
    0 讨论(0)
提交回复
热议问题