dotfiles/emacs/.emacs.d/config/init-windows.el
2021-03-19 12:14:06 -04:00

40 lines
1.0 KiB
EmacsLisp

;; -*- lexical-binding: t; -*-
;; Window-related configuration
;; winum-mode allows selecting windows by number
(use-package winum
:config
(winum-mode)
:custom
(winum-scope 'frame-local))
;; winner-mode lets you undo and redo changes to the window layout
(winner-mode 1)
;; Keybindings
(leader-def-key
"0" #'winum-select-window-0-or-10
"1" #'winum-select-window-1
"2" #'winum-select-window-2
"3" #'winum-select-window-3
"4" #'winum-select-window-4
"5" #'winum-select-window-5
"6" #'winum-select-window-6
"7" #'winum-select-window-7
"8" #'winum-select-window-8
"9" #'winum-select-window-9
"w" '(evil-window-map :which-key "window"))
(general-def evil-window-map
"m" #'delete-other-windows
"u" #'winner-undo
"C-r" #'winner-redo)
;; Condense the which-key display for window selection bindings
(push '(("\\(.*\\) 0" . "select-window-0") . ("\\1 0..9" . "window 0..9"))
which-key-replacement-alist)
(push '((nil . "select-window-[1-9]") . t) which-key-replacement-alist)
(provide 'init-windows)