Improvements for C-o b and implement C-o z
This commit is contained in:
@@ -1,10 +1,34 @@
|
|||||||
(provide 'thoom-tweaks)
|
(provide 'thoom-tweaks)
|
||||||
|
|
||||||
|
(defun consult-buffer-other-window-no-focus ()
|
||||||
|
(interactive)
|
||||||
|
(with-selected-window (next-window)
|
||||||
|
(consult-buffer)))
|
||||||
|
|
||||||
|
(defvar thoom/zoom-saved-windows nil
|
||||||
|
"Variable to store the current window configuration for thoom/zoom.")
|
||||||
|
|
||||||
|
(defun thoom/zoom-window ()
|
||||||
|
"Delete other windows, or restore the saved window configuration if available."
|
||||||
|
(interactive)
|
||||||
|
(if (and thoom/zoom-saved-windows
|
||||||
|
(not (window-configuration-p thoom/zoom-saved-windows)))
|
||||||
|
;; Clean up if the saved config isn't valid anymore.
|
||||||
|
(setq thoom/zoom-saved-windows nil))
|
||||||
|
|
||||||
|
(if thoom/zoom-saved-windows
|
||||||
|
(progn
|
||||||
|
(set-window-configuration thoom/zoom-saved-windows)
|
||||||
|
(setq thoom/zoom-saved-windows nil))
|
||||||
|
(setq thoom/zoom-saved-windows (current-window-configuration))
|
||||||
|
(delete-other-windows)))
|
||||||
|
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:bind (("C-o" . nil)
|
:bind (("C-o" . nil)
|
||||||
("C-o C-o" . other-window)
|
("C-o C-o" . other-window)
|
||||||
("C-o o" . other-window)
|
("C-o o" . other-window)
|
||||||
("C-o b" . consult-buffer-other-window)
|
("C-o b" . consult-buffer-other-window-no-focus)
|
||||||
|
("C-o B" . consult-buffer-other-window)
|
||||||
("C-o /" . split-window-right)
|
("C-o /" . split-window-right)
|
||||||
("C-o -" . split-window-below)
|
("C-o -" . split-window-below)
|
||||||
("C-o C-k" . delete-window)
|
("C-o C-k" . delete-window)
|
||||||
@@ -17,6 +41,7 @@
|
|||||||
;; TODO C-wasd for resizing
|
;; TODO C-wasd for resizing
|
||||||
;; TODO C-/ for undo window state change
|
;; TODO C-/ for undo window state change
|
||||||
;; TODO z for zooming
|
;; TODO z for zooming
|
||||||
|
("C-o z" . thoom/zoom-window)
|
||||||
;; TODO other-window scrolling
|
;; TODO other-window scrolling
|
||||||
("C-o n" . next-buffer)
|
("C-o n" . next-buffer)
|
||||||
("C-o p" . previous-buffer)
|
("C-o p" . previous-buffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user