Skip to content

Commit

Permalink
window: Prefer the built-in window-swap-states
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0210 committed Dec 12, 2023
1 parent 59e8753 commit 9d2b5fe
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
("C-c <down>". sanityinc/toggle-current-window-dedication)
:map ctl-x-4-map
("s" . toggle-window-split)
("t" . transpose-windows))
("t" . window-swap-states))
:config
(bind-key "C-x 2" (split-window-func-with-other-buffer 'split-window-vertically))
(bind-key "C-x 3" (split-window-func-with-other-buffer 'split-window-horizontally))
Expand Down Expand Up @@ -408,15 +408,6 @@
(other-window 1)
(switch-to-buffer (other-buffer))))))

(defun transpose-windows ()
"Swap the buffers shown in current and next window."
(interactive)
(let ((this-buffer (window-buffer))
(next-window (next-window nil :no-minibuf nil)))
(set-window-buffer nil (window-buffer next-window))
(set-window-buffer next-window this-buffer)
(select-window next-window)))

(defun sanityinc/split-window()
"Split the window to see the most recent buffer in the other window.
Call a second time to restore the original window configuration."
Expand Down

0 comments on commit 9d2b5fe

Please sign in to comment.