hackweek-emacs/cnf/global-keybindings.el

96 lines
2.7 KiB
EmacsLisp

;; EXAMPLE: Global override of keybinding
;; Ged rid of default bindings I don't enjoy :<
(general-def :states '(normal insert emacs visual) :keymaps 'override
;; This motherf***** + another ESC used to close my windows. NOO MOOORE!
"M-ESC" (lambda () (interactive) (message "You pressed it again Mr. Fatfinger...")))
;; GLOBAL BINDINGS
(general-def
:states '(normal insert visual)
:keymaps 'override
"C-j" 'evil-scroll-down
"C-k" 'evil-scroll-up
;; "<XF86AudioLowerVolume>" 'evil-scroll-down
;; "<XF86AudioRaiseVolume>" 'evil-scroll-up
)
;; This is a reference to the leader key defined in essentials.el
;; It basically means: <YOUR-LEADER> + whatever is configured below
;; E.g. "SPC SPC" actually means "SPC SPC SPC" because it is prefix with `my-leader'
(my-leader
;; These are the states for which the keybinding should work
:states '(normal visual emacs)
;; This is the keymap for which the keybinding should work.
;; Override is the GLOBAL keymap but there are specific ones for each mode
:keymaps 'override
;; This ignores the sole keybinding of "SPC SPC" to use this "namespace" for mode specific bindings
"SPC" '(:ignore t :which-key "Mode Specific Binds")
"SPC SPC" 'counsel-M-x
"f" 'counsel-find-file
"g" 'magit-status
"h" 'evil-avy-goto-line
"i" 'counsel-imenu
"y" 'counsel-yank-pop
";" 'evilnc-comment-or-uncomment-lines
"." 'save-buffer
;; window stuff
"w" '(:ignore t :which-key "Window")
;; quick switch to other window
"a" 'ace-window
"w v" 'split-window-right
"w h" 'split-window-below
"w f" 'toggle-maximize-buffer
"w L" 'windsize-right
"w H" 'windsize-left
"w J" 'windsize-down
"w K" 'windsize-up
;; switch stuff
"s" '(:ignore t :which-key "Switch")
"s b" 'switch-to-buffer
"s n" 'switch-to-next-buffer
"s p" 'switch-to-prev-buffer
"s s" 'counsel-switch-buffer
"s a" 'ace-swap-window
;; kill stuff
"k" '(:ignore t :which-key "Kill")
"k b" 'kill-buffer
"k w" 'delete-window
"k W" 'kill-buffer-and-window
"k o b" 'kill-some-buffers
"k o w" 'delete-other-windows
"k q q" 'kill-emacs
"k k" 'kill-current-buffer
;; buffer stuff
"b" '(:ignore t :which-key "Buffer (revert)")
"b r" 'revert-buffer
"b a r" 'auto-revert-mode
;; edit stuff
"e" '(:ignore t :which-key "Edit")
"e c" '((lambda() (interactive) (dired my/emacsconf)) :which-key "edit emacs config")
;; ui stuff
"q" '(:ignore t :which-key "Quality :)")
"q t" 'phga/cycle-themes
"q =" 'phga/text-scale-adjust
;; tools
"t u" 'vundo
;; describe stuff
"?" '(:ignore t :which-key "Describe")
"? v" 'describe-variable
"? f" 'describe-function
"? c" 'describe-char
"? m" 'describe-mode
"? k" 'describe-key
"? F" 'describe-face
)
(provide 'global-keybindings)