~thecatster/.emacs.d

.emacs.d/evil.org -rw-r--r-- 4.5 KiB
2c969f2eDaniil Rose Update gitignore to include elpa 7 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#+TITLE: Evil Config
#+AUTHOR: Daniel Rose (The Catster)
#+DESCRIPTION: An Evil configuration that enables me to express my inner demon.
#+STARTUP: overview
#+LANGUAGE: en
#+OPTIONS: num:nil
#+ATTR_HTML: :style margin-left: auto; margin-right: auto;
#+PROPERTY: header-args :tangle lisp/catsters-evil.el :mkdirp yes

I love Emacs. I rarely get attached to things, and don't believe with
associating a person directly with an organisation or project, but
Emacs is one I will stand by.

That said, the keybindings are definitely hit or miss. I've used the
vanilla keybindings since the day I switched to Emacs from (neo)vi(m),
but every now and again I have an urge to use the (neo)vi(m) ones. I
recently purchased my laptop for senior year/university, and it has a
very awkward placement of the control keys, and has a tendency to "let
go" of the key.

This makes using vanilla keybindings obnoxious, and has made me more
seriously set up Evil.

But, I still really like vanilla keybindings, and don't see enough of
a reason to switch over to Evil. Keeping this config here /just in
case/.

* Basics
#+BEGIN_SRC emacs-lisp
(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))
#+END_SRC
* Plugins
** Evil Collection
#+BEGIN_SRC emacs-lisp
(use-package evil-collection
  :custom
  (evil-collection-setup-minibuffer t)
  :config
  (evil-collection-init))
#+END_SRC

** Undo Fu
#+BEGIN_SRC emacs-lisp
(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))
#+END_SRC

** Evil Org
#+BEGIN_SRC emacs-lisp
(use-package evil-org
  :hook (org-mode . evil-org-mode))
#+END_SRC

** Nerd Commenter
#+BEGIN_SRC emacs-lisp
(use-package evil-nerd-commenter
  :config
  (evilnc-default-hotkeys))
#+END_SRC

** Evil EasyMotion
#+BEGIN_SRC emacs-lisp
(use-package evil-easymotion)
#+END_SRC

** Evil Embrace.el
#+BEGIN_SRC emacs-lisp
(use-package evil-embrace
  :config
  (evil-embrace-enable-evil-surround-integration))
#+END_SRC

** Evil Escape
#+BEGIN_SRC emacs-lisp
(use-package evil-escape
  :config
  (evil-escape-mode 1))
#+END_SRC

** Evil Indent Plus
#+BEGIN_SRC emacs-lisp
(use-package evil-indent-plus
  :config
  (evil-indent-plus-default-bindings))
#+END_SRC

** Evil Lion
#+BEGIN_SRC emacs-lisp
(use-package evil-lion
  :config
  (evil-lion-mode))
#+END_SRC

** Evil Numbers
#+BEGIN_SRC emacs-lisp
(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))
#+END_SRC

** Evil Snipe
#+BEGIN_SRC emacs-lisp
(use-package evil-snipe
  :config
  (evil-snipe-override-mode 1))
#+END_SRC

** Evil Vimish Fold
#+BEGIN_SRC emacs-lisp
(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))
#+END_SRC

** EXATO
#+BEGIN_SRC emacs-lisp
(use-package exato)
#+END_SRC

* General
#+BEGIN_SRC emacs-lisp
(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
    "." '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))

#+END_SRC
* Provide
#+BEGIN_SRC emacs-lisp
(provide 'catsters-evil)
;;; catsters-evil.el ends here
#+END_SRC