~thecatster/.emacs.d

.emacs.d/lisp/catsters-evil.el -rw-r--r-- 2.7 KiB
2c969f2eDaniil Rose Update gitignore to include elpa 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)

(use-package goto-chg)

(use-package evil
  :init
  (setq evil-want-integration t)
  (setq evil-want-keybinding nil)
  (setq evil-want-C-u-scroll t)
  (setq evil-want-C-i-jump nil)
  :config
  (evil-mode 1)
  (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
  (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
  ;; Use visual line motions even outside of visual-line-mode buffers
  (evil-global-set-key 'motion "j" 'evil-next-visual-line)
  (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
  (evil-set-initial-state 'messages-buffer-mode 'normal)
  (evil-set-initial-state 'dashboard-mode 'normal))

(use-package evil-collection
  :custom
  (evil-collection-setup-minibuffer t)
  :config
  (evil-collection-init))

(use-package undo-fu
  :config
  (define-key evil-normal-state-map "u" 'undo-fu-only-undo)
  (define-key evil-normal-state-map "\C-r" 'undo-fu-only-redo))

(use-package evil-org
  :hook (org-mode . evil-org-mode))

(use-package evil-nerd-commenter
  :config
  (evilnc-default-hotkeys))

(use-package evil-easymotion)

(use-package evil-embrace
  :config
  (evil-embrace-enable-evil-surround-integration))

(use-package evil-escape
  :config
  (evil-escape-mode 1))

(use-package evil-indent-plus
  :config
  (evil-indent-plus-default-bindings))

(use-package evil-lion
  :config
  (evil-lion-mode))

(use-package evil-numbers
  :config
  (define-key evil-normal-state-map (kbd "C-c +") 'evil-numbers/inc-at-pt)
  (define-key evil-normal-state-map (kbd "C-c -") 'evil-numbers/dec-at-pt))

(use-package evil-snipe
  :config
  (evil-snipe-override-mode 1))

(use-package vimish-fold
  :ensure
  :after evil)

(use-package evil-vimish-fold
  :ensure
  :after vimish-fold
  :hook ((prog-mode conf-mode text-mode) . evil-vimish-fold-mode))

(use-package exato)

(use-package general
  :after evil
  :config
  (general-create-definer catster/leader-keys
    :keymaps '(normal insert visual emacs)
    :prefix "SPC"
    :global-prefix "C-SPC")
  (catster/leader-keys
    ;; Basics
    "ff" 'find-file
    "x" 'execute-extended-command
    ;; Buffers
    "bk" 'kill-buffer
    "bs" 'consult-buffer
    "br" 'split-window-right
    "bb" 'split-window-below
    "bw" 'mark-whole-buffer
    ;; Nerd Commenter
    "cc" 'evilnc-comment-or-uncomment-lines
    "cl" 'evilnc-quick-comment-or-uncomment-to-the-line
    "cp" 'evilnc-comment-or-uncomment-paragraphs
    "cr" 'comment-or-uncomment-region
    "cv" 'evilnc-toggle-invert-comment-line-by-line
    "c."  'evilnc-copy-and-comment-operator
    ;; EasyMotion
    "j" 'evilem-motion-next-visual-line
    "k" 'evilem-motion-previous-visual-line))

(provide 'catsters-evil)
;;; catsters-evil.el ends here