You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.5 KiB

Key - Window

Package

Define window key package.

  (use-package emacs
    :after uno-key
    :config
    (provide 'uno-key-window))

Keybinds

  (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)))