dotfiles/emacs-lisp/keybindings.org
main 56520667c4
Emacs changes
Signed-off-by: main <magic_rb@redalder.org>
2022-06-07 17:08:42 +02:00

1.5 KiB

Keybindings

This file contains all keybindings of my Emacs configuration. I chose to put them all into one file for easy reference and also cross package consistency is easier to ensure when you have everything on one screen.

First we need to define a new minor mode.

  (define-minor-mode magic_rb/userbind-mode
    "Minor mode for user keybindings of Magic_RB."
    :lighter " userbind."
    :global t
    :keymap (make-sparse-keymap))

Then we hook our minor mode on meow-mode-hook, but only after meow-mode is loaded.

   (add-hook 'after-init-hook 'magic_rb/userbind-mode)
  (general-def
    :keymaps '(magic_rb/userbind-mode-map)
    :prefix "C-c"
    "o f" 'org-roam-node-find
    "o i" 'org-roam-node-insert
    "o t" 'org-roam-tag-add
    "o T" 'org-roam-tag-remove
    "o r" 'org-roam-ref-add
    "o R" 'org-roam-ref-remove
    "o c" 'org-roam-capture
    "o b" 'org-roam-buffer-toggle
    "o a" 'org-agenda


    "j f" 'consult-find
    "j r" 'consult-ripgrep
    "j l" 'consult-line
    "j b" 'consult-project-buffer

    "p v" 'projectile-run-vterm
    "p m" 'projectile-vc
    "p s" 'projectile-switch-project

    "w t" 'windmove-left
    "w r" 'windmove-up
    "w n" 'windmove-down
    "w s" 'windmove-right

    "b i" 'indent-region
    "b c" 'comment-dwim

    "l l" 'lsp
    "l r" 'lsp-workspace-restart
    "l e" 'lsp-execute-code-action)