feat: add emacs window management keybinds

This commit is contained in:
Swarsel 2024-08-16 11:37:33 +02:00
parent 4dc2b59670
commit d33c24f710
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
2 changed files with 201 additions and 189 deletions

View file

@ -9340,6 +9340,7 @@ I also define some keybinds to some combinations directly. Those are used mostly
"ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link") "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
"os" '((lambda () (interactive) (org-store-link)) :which-key "store link") "os" '((lambda () (interactive) (org-store-link)) :which-key "store link")
"od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block") "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
"on" '((lambda () (interactive) (nixpkgs-fmt)) :which-key "format nix-block")
;; "c" '(:ignore c :which-key "capture") ;; "c" '(:ignore c :which-key "capture")
;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal") ;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
;; "cs" '(markdown-download-screenshot :which-key "screenshot") ;; "cs" '(markdown-download-screenshot :which-key "screenshot")
@ -9375,9 +9376,13 @@ I also define some keybinds to some combinations directly. Those are used mostly
"hd" 'devdocs-lookup "hd" 'devdocs-lookup
"w" '(:ignore t :which-key "window") "w" '(:ignore t :which-key "window")
"wl" 'windmove-right "wl" 'windmove-right
"w <right>" 'windmove-right
"wh" 'windmove-left "wh" 'windmove-left
"w <left>" 'windmove-left
"wk" 'windmove-up "wk" 'windmove-up
"w <up>" 'windmove-up
"wj" 'windmove-down "wj" 'windmove-down
"w <down>" 'windmove-down
"wr" 'winner-redo "wr" 'winner-redo
"wd" 'delete-window "wd" 'delete-window
"w=" 'balance-windows-area "w=" 'balance-windows-area
@ -9385,6 +9390,7 @@ I also define some keybinds to some combinations directly. Those are used mostly
"wu" 'winner-undo "wu" 'winner-undo
"wr" 'winner-redo "wr" 'winner-redo
"w/" 'evil-window-vsplit "w/" 'evil-window-vsplit
"w\\" 'evil-window-vsplit
"w-" 'evil-window-split "w-" 'evil-window-split
"wm" '(delete-other-windows :wk "maximize") "wm" '(delete-other-windows :wk "maximize")
"<right>" 'up-list "<right>" 'up-list

View file

@ -291,10 +291,10 @@ create a new one."
(call-interactively 'nixpkgs-fmt-region))))) (call-interactively 'nixpkgs-fmt-region)))))
;; Make ESC quit prompts ;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
;; Set up general keybindings ;; Set up general keybindings
(use-package general (use-package general
:config :config
(general-create-definer swarsel/leader-keys (general-create-definer swarsel/leader-keys
:keymaps '(normal insert visual emacs) :keymaps '(normal insert visual emacs)
@ -325,6 +325,7 @@ create a new one."
"ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link") "ol" '((lambda () (interactive) (org-insert-link)) :which-key "insert link")
"os" '((lambda () (interactive) (org-store-link)) :which-key "store link") "os" '((lambda () (interactive) (org-store-link)) :which-key "store link")
"od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block") "od" '((lambda () (interactive) (org-babel-demarcate-block)) :which-key "demarcate (split) src-block")
"on" '((lambda () (interactive) (nixpkgs-fmt)) :which-key "format nix-block")
;; "c" '(:ignore c :which-key "capture") ;; "c" '(:ignore c :which-key "capture")
;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal") ;; "cj" '((lambda () (interactive) (org-capture nil "jj")) :which-key "journal")
;; "cs" '(markdown-download-screenshot :which-key "screenshot") ;; "cs" '(markdown-download-screenshot :which-key "screenshot")
@ -360,9 +361,13 @@ create a new one."
"hd" 'devdocs-lookup "hd" 'devdocs-lookup
"w" '(:ignore t :which-key "window") "w" '(:ignore t :which-key "window")
"wl" 'windmove-right "wl" 'windmove-right
"w <right>" 'windmove-right
"wh" 'windmove-left "wh" 'windmove-left
"w <left>" 'windmove-left
"wk" 'windmove-up "wk" 'windmove-up
"w <up>" 'windmove-up
"wj" 'windmove-down "wj" 'windmove-down
"w <down>" 'windmove-down
"wr" 'winner-redo "wr" 'winner-redo
"wd" 'delete-window "wd" 'delete-window
"w=" 'balance-windows-area "w=" 'balance-windows-area
@ -370,14 +375,15 @@ create a new one."
"wu" 'winner-undo "wu" 'winner-undo
"wr" 'winner-redo "wr" 'winner-redo
"w/" 'evil-window-vsplit "w/" 'evil-window-vsplit
"w\\" 'evil-window-vsplit
"w-" 'evil-window-split "w-" 'evil-window-split
"wm" '(delete-other-windows :wk "maximize") "wm" '(delete-other-windows :wk "maximize")
"<right>" 'up-list "<right>" 'up-list
"<left>" 'down-list "<left>" 'down-list
)) ))
;; General often used hotkeys ;; General often used hotkeys
(general-define-key (general-define-key
"C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card "C-M-a" (lambda () (interactive) (org-capture nil "a")) ; make new anki card
;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist ;; "C-M-d" 'swarsel-obsidian-daily ; open daily obsidian file and create if not exist
;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards ;; "C-M-S" 'swarsel-anki-set-deck-and-notetype ; switch deck and notetype for new anki cards