2021-02-21 02:59:11 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
2021-02-20 11:40:03 +00:00
|
|
|
;; 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
|
2021-03-19 16:14:06 +00:00
|
|
|
"w" '(evil-window-map :which-key "window"))
|
|
|
|
|
|
|
|
(general-def evil-window-map
|
|
|
|
"m" #'delete-other-windows
|
|
|
|
"u" #'winner-undo
|
|
|
|
"C-r" #'winner-redo)
|
2021-02-20 11:40:03 +00:00
|
|
|
|
|
|
|
;; 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)
|