#+TITLE: Key - Window #+AUTHOR: Juan Placencia * Package Define window key package. #+BEGIN_SRC emacs-lisp (use-package emacs :after uno-key :config (provide 'uno-key-window)) #+END_SRC * Keybinds #+BEGIN_SRC emacs-lisp (use-package emacs :after uno-key-window :general (uno-leader-define "w" '(:ignore t :which-key "Window") "wd" '(delete-window :which-key "Delete window") "wD" '(delete-other-windows :which-key "Delete other windows") "wm" '(uno/key/window/toggle-maximize :which-key "Toggle maximize") "ws" '(uno/key/window/split-below :which-key "Split down and focus") "wS" '(split-window-below :which-key "Split down") "wv" '(uno/key/window/split-right :which-key "Split right and focus") "wV" '(split-window-right :which-key "Split right")) :init (defun uno/key/window/toggle-maximize () "Maximize buffer" (interactive) (save-excursion (if (and (= 1 (length (window-list))) (assoc ?_ register-alist)) (jump-to-register ?_) (progn (window-configuration-to-register ?_) (delete-other-windows))))) (defun uno/key/window/split-below () "Split the window vertically and focus the new window." (interactive) (split-window-below) (windmove-down)) (defun uno/key/window/split-right () "Split the window horizontally and focus the new window." (interactive) (split-window-right) (windmove-right))) #+END_SRC