-
Notifications
You must be signed in to change notification settings - Fork 12
/
evil-vars.el
1322 lines (1124 loc) · 40.1 KB
/
evil-vars.el
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; evil-vars.el --- Settings and variables
;; Author: Vegard Øye <vegard_oye at hotmail.com>
;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
;;
;; This file is NOT part of GNU Emacs.
;;; License:
;; This file is part of Evil.
;;
;; Evil is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Evil is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Evil. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
;;; Hooks
(defvar evil-after-load-hook nil
"Functions to be run when loading of evil is finished.
This hook can be used the execute some initialization routines
when evil is completely loaded.")
;;; Initialization
(defvar evil-pending-custom-initialize nil
"A list of pending initializations for custom variables.
Each element is a triple (FUNC VAR VALUE). When evil is
completely loaded then the functions (funcall FUNC VAR VALUE) is
called for each element. FUNC should be a function suitable for
the :initialize property of `defcustom'.")
(defun evil-custom-initialize-pending-reset (var value)
"Add a pending customization with `custom-initialize-reset'."
(push (list 'custom-initialize-reset var value)
evil-pending-custom-initialize))
(defun evil-run-pending-custom-initialize ()
"Executes the pending initializations.
See `evil-pending-custom-initialize'."
(dolist (init evil-pending-custom-initialize)
(apply (car init) (cdr init)))
(remove-hook 'evil-after-load-hook 'evil-run-pending-custom-initialize))
(add-hook 'evil-after-load-hook 'evil-run-pending-custom-initialize)
;;; Setters
(defun evil-set-toggle-key (key)
"Set `evil-toggle-key' to KEY.
KEY must be readable by `read-kbd-macro'."
(let ((old-key (read-kbd-macro
(if (boundp 'evil-toggle-key)
evil-toggle-key
"C-z")))
(key (read-kbd-macro key)))
(with-no-warnings
(dolist (pair '((evil-motion-state-map evil-emacs-state)
(evil-insert-state-map evil-emacs-state)
(evil-emacs-state-map evil-exit-emacs-state)))
(when (boundp (car pair))
(let ((map (symbol-value (car pair)))
(fun (cadr pair)))
(when (keymapp map)
(define-key map key fun)
(define-key map old-key nil))))))))
(defun evil-set-custom-state-maps (var pending-var key make newlist)
"Changes the list of special keymaps.
VAR is the variable containing the list of keymaps.
PENDING-VAR is the variable containing the list of the currently pending
keymaps.
KEY the special symbol to be stored in the keymaps.
MAKE the creation function of the special keymaps.
NEWLIST the list of new special keymaps."
(set-default pending-var newlist)
(when (default-boundp var)
(dolist (map (default-value var))
(when (and (boundp (car map))
(keymapp (default-value (car map))))
(define-key (default-value (car map)) (vector key) nil))))
(set-default var newlist)
(evil-update-pending-maps))
(defun evil-update-pending-maps (&optional file)
"Tries to set pending special keymaps.
This function should be called from an `after-load-functions'
hook."
(let ((maps '((evil-make-overriding-map . evil-pending-overriding-maps)
(evil-make-intercept-map . evil-pending-intercept-maps))))
(while maps
(let* ((map (pop maps))
(make (car map))
(pending-var (cdr map))
(pending (symbol-value pending-var))
newlist)
(while pending
(let* ((map (pop pending))
(kmap (and (boundp (car map))
(keymapp (symbol-value (car map)))
(symbol-value (car map))))
(state (cdr map)))
(if kmap
(funcall make kmap state)
(push map newlist))))
(set-default pending-var newlist)))))
(defun evil-set-visual-newline-commands (var value)
"Set the value of `evil-visual-newline-commands'.
Setting this variable changes the properties of the appropriate
commands."
(with-no-warnings
(when (default-boundp var)
(dolist (cmd (default-value var))
(evil-set-command-property cmd :exclude-newline nil)))
(set-default var value)
(dolist (cmd (default-value var))
(evil-set-command-property cmd :exclude-newline t))))
(defun evil-set-custom-motions (var values)
"Sets the list of motion commands."
(with-no-warnings
(when (default-boundp var)
(dolist (motion (default-value var))
(evil-add-command-properties motion :keep-visual nil :repeat nil)))
(set-default var values)
(mapc #'evil-declare-motion (default-value var))))
;;; Customization group
(defgroup evil nil
"Extensible vi layer."
:group 'emulations
:prefix 'evil-)
(defcustom evil-auto-indent t
"Whether to auto-indent when entering Insert state."
:type 'boolean
:group 'evil)
(make-variable-buffer-local 'evil-auto-indent)
(defcustom evil-shift-width 4
"The offset used by \\<evil-normal-state-map>\\[evil-shift-right] \
and \\[evil-shift-left]."
:type 'integer
:group 'evil)
(make-variable-buffer-local 'evil-shift-width)
(defcustom evil-shift-round t
"Whether \\<evil-normal-state-map>\\[evil-shift-right] \
and \\[evil-shift-left] round to the nearest multiple \
of `evil-shift-width'."
:type 'boolean
:group 'evil)
(make-variable-buffer-local 'evil-shift-round)
(defcustom evil-default-cursor
(list (or (frame-parameter nil 'cursor-color) "black") t)
"The default cursor.
May be a cursor type as per `cursor-type', a color string as passed
to `set-cursor-color', a zero-argument function for changing the
cursor, or a list of the above."
:type '(set symbol (cons symbol symbol) string function)
:group 'evil)
(defcustom evil-repeat-move-cursor t
"Whether \"\\<evil-normal-state-map>\\[evil-repeat]\" \
moves the cursor."
:type 'boolean
:group 'evil)
(defcustom evil-cross-lines nil
"Whether motions may cross newlines."
:type 'boolean
:group 'evil)
(defcustom evil-move-cursor-back t
"Whether the cursor is moved backwards when exiting Insert state."
:type 'boolean
:group 'evil)
(defcustom evil-track-eol t
"If non-nil line moves after a call to `evil-end-of-line' stay at eol.
This is analogous to `track-eol' but deals with the end-of-line
interpretation of evil."
:type 'boolean
:group 'evil)
(defcustom evil-mode-line-format 'before
"The position of the mode line tag.
`before' means before the mode list, `after' means after it,
and nil means no mode line tag."
:type 'symbol
:group 'evil)
(defcustom evil-word "[:word:]_"
"The characters to be considered as a word.
This should be a regexp set without the enclosing []."
:type 'string
:group 'evil)
(make-variable-buffer-local 'evil-word)
(defcustom evil-bigword "^ \t\r\n"
"The characters to be considered as a big word.
This should be a regexp set without the enclosing []."
:type 'string
:group 'evil)
(make-variable-buffer-local 'evil-bigword)
(defcustom evil-want-fine-undo nil
"Whether actions like \"cw\" are undone in several steps."
:type 'boolean
:group 'evil)
(defcustom evil-regexp-search t
"Whether to use regular expressions for searching."
:type 'boolean
:group 'evil)
(defcustom evil-search-wrap t
"Whether search wraps around."
:type 'boolean
:group 'evil)
(defcustom evil-flash-delay 2
"Time in seconds to flash search matches."
:type 'number
:group 'evil)
(defcustom evil-fold-level 0
"Default fold level."
:type 'integer
:group 'evil)
(defcustom evil-esc-delay 0.01
"Time in seconds to wait for another key after ESC."
:type 'number
:group 'evil)
(defcustom evil-show-paren-range 0
"The minimal distance between point and a parenthesis
which causes the parenthesis to be highlighted."
:type 'integer
:group 'evil)
(defcustom evil-ex-hl-update-delay 0.02
"Time in seconds of idle before updating search highlighting.
Setting this to a period shorter than that of keyboard's repeat
rate allows highlights to update while scrolling."
:type 'number
:group 'evil)
(defcustom evil-highlight-closing-paren-at-point-states
'(not emacs insert replace)
"The states in which the closing parenthesis at point should be highlighted.
All states listed here highlight the closing parenthesis at
point (which is Vim default behavior), all others highlight the
parenthesis before point (which is Emacs default behavior). If
this list contains the symbol 'not then its meaning is inverted,
i.e., all states listed here highlight the closing parenthesis
before point."
:type '(repeat symbol)
:group 'evil)
(defcustom evil-want-C-i-jump t
"Whether \"C-i\" jumps forward like in Vim."
:type 'boolean
:group 'evil)
(defcustom evil-want-C-u-scroll nil
"Whether \"C-u\" scrolls like in Vim."
:type 'boolean
:group 'evil)
(defcustom evil-want-C-w-delete t
"Whether \"C-w\" deletes a word in Insert state."
:type 'boolean
:group 'evil)
(defcustom evil-want-C-w-in-emacs-state nil
"Whether \"C-w\" prefixes windows commands in Emacs state."
:type 'boolean
:group 'evil)
(defcustom evil-want-change-word-to-end t
"Whether \"cw\" behaves like \"ce\"."
:type 'boolean
:group 'evil)
(defcustom evil-echo-state t
"Whether to signal the current state in the echo area."
:type 'boolean
:group 'evil)
(defcustom evil-complete-all-buffers t
"Whether completion looks for matches in all buffers."
:type 'boolean
:group 'evil)
(defcustom evil-complete-next-func
#'(lambda (arg)
(require 'dabbrev)
(let ((dabbrev-search-these-buffers-only
(unless evil-complete-all-buffers
(list (current-buffer))))
dabbrev-case-distinction)
(condition-case nil
(if (eq last-command this-command)
(dabbrev-expand nil)
(dabbrev-expand (- (abs (or arg 1)))))
(error (dabbrev-expand nil)))))
"Completion function used by \
\\<evil-insert-state-map>\\[evil-complete-next]."
:type 'function
:group 'evil)
(defcustom evil-complete-previous-func
#'(lambda (arg)
(require 'dabbrev)
(let ((dabbrev-search-these-buffers-only
(unless evil-complete-all-buffers
(list (current-buffer))))
dabbrev-case-distinction)
(dabbrev-expand arg)))
"Completion function used by \
\\<evil-insert-state-map>\\[evil-complete-previous]."
:type 'function
:group 'evil)
(defcustom evil-complete-next-minibuffer-func 'minibuffer-complete
"Minibuffer completion function used by \
\\<evil-insert-state-map>\\[evil-complete-next]."
:type 'function
:group 'evil)
(defcustom evil-complete-previous-minibuffer-func 'minibuffer-complete
"Minibuffer completion function used by \
\\<evil-insert-state-map>\\[evil-complete-previous]."
:type 'function
:group 'evil)
(defcustom evil-complete-next-line-func
#'(lambda (arg)
(let ((hippie-expand-try-functions-list
'(try-expand-line
try-expand-line-all-buffers)))
(hippie-expand arg)))
"Minibuffer completion function used by \
\\<evil-insert-state-map>\\[evil-complete-next-line]."
:type 'function
:group 'evil)
(defcustom evil-complete-previous-line-func
evil-complete-next-line-func
"Minibuffer completion function used by \
\\<evil-insert-state-map>\\[evil-complete-previous-line]."
:type 'function
:group 'evil)
(defcustom evil-lookup-func #'woman
"Lookup function used by \
\"\\<evil-motion-state-map>\\[evil-lookup]\"."
:type 'function
:group 'evil)
(defcustom evil-toggle-key "C-z"
"The key used to change to and from Emacs state.
Must be readable by `read-kbd-macro'. For example: \"C-z\"."
:type 'string
:group 'evil
:set #'(lambda (sym value)
(evil-set-toggle-key value)
(set-default sym value)))
(defcustom evil-default-state 'normal
"The default state.
This is the state a mode comes up in when it is not listed
in `evil-emacs-state-modes', `evil-insert-state-modes' or
`evil-motion-state-modes'. The value may be one of `normal',
`insert', `visual', `replace', `operator', `motion' and
`emacs'."
:type 'symbol
:group 'evil)
(defcustom evil-buffer-regexps
'(("^ \\*load\\*" . nil))
"Regular expression determining the initial state for a buffer.
Entries have the form (REGEXP . STATE), where REGEXP is a regular
expression matching the buffer's name and STATE is one of `normal',
`insert', `visual', `replace', `operator', `motion', `emacs' and nil.
If STATE is nil, Evil is disabled in the buffer."
:type '(alist :key-type string :value-type symbol)
:group 'evil)
(defcustom evil-emacs-state-modes
'(archive-mode
bbdb-mode
bookmark-bmenu-mode
bookmark-edit-annotation-mode
browse-kill-ring-mode
bzr-annotate-mode
calc-mode
cfw:calendar-mode
completion-list-mode
Custom-mode
debugger-mode
delicious-search-mode
desktop-menu-blist-mode
desktop-menu-mode
doc-view-mode
dvc-bookmarks-mode
dvc-diff-mode
dvc-info-buffer-mode
dvc-log-buffer-mode
dvc-revlist-mode
dvc-revlog-mode
dvc-status-mode
dvc-tips-mode
ediff-mode
efs-mode
Electric-buffer-menu-mode
emms-browser-mode
emms-mark-mode
emms-metaplaylist-mode
emms-playlist-mode
etags-select-mode
fj-mode
gc-issues-mode
gdb-breakpoints-mode
gdb-disassembly-mode
gdb-frames-mode
gdb-locals-mode
gdb-memory-mode
gdb-registers-mode
gdb-threads-mode
gist-list-mode
gnus-article-mode
gnus-browse-mode
gnus-group-mode
gnus-server-mode
gnus-summary-mode
google-maps-static-mode
ibuffer-mode
jde-javadoc-checker-report-mode
magit-commit-mode
magit-diff-mode
magit-key-mode
magit-log-mode
magit-mode
magit-reflog-mode
magit-show-branches-mode
magit-stash-mode
magit-status-mode
magit-wazzup-mode
mh-folder-mode
monky-mode
notmuch-hello-mode
notmuch-search-mode
notmuch-show-mode
occur-mode
org-agenda-mode
package-menu-mode
proced-mode
rcirc-mode
rebase-mode
recentf-dialog-mode
reftex-select-bib-mode
reftex-toc-mode
sldb-mode
slime-inspector-mode
slime-thread-control-mode
slime-xref-mode
sr-buttons-mode
sr-mode
sr-tree-mode
sr-virtual-mode
tar-mode
tetris-mode
tla-annotate-mode
tla-archive-list-mode
tla-bconfig-mode
tla-bookmarks-mode
tla-branch-list-mode
tla-browse-mode
tla-category-list-mode
tla-changelog-mode
tla-follow-symlinks-mode
tla-inventory-file-mode
tla-inventory-mode
tla-lint-mode
tla-logs-mode
tla-revision-list-mode
tla-revlog-mode
tla-tree-lint-mode
tla-version-list-mode
twittering-mode
urlview-mode
vc-annotate-mode
vc-dir-mode
vc-git-log-view-mode
vc-svn-log-view-mode
vm-mode
vm-summary-mode
w3m-mode
wab-compilation-mode
xgit-annotate-mode
xgit-changelog-mode
xgit-diff-mode
xgit-revlog-mode
xhg-annotate-mode
xhg-log-mode
xhg-mode
xhg-mq-mode
xhg-mq-sub-mode
xhg-status-extra-mode)
"Modes that should come up in Emacs state."
:type '(repeat symbol)
:group 'evil)
(defcustom evil-insert-state-modes
'(comint-mode
erc-mode
eshell-mode
geiser-repl-mode
gud-mode
inferior-apl-mode
inferior-caml-mode
inferior-emacs-lisp-mode
inferior-j-mode
inferior-python-mode
inferior-scheme-mode
inferior-sml-mode
internal-ange-ftp-mode
prolog-inferior-mode
reb-mode
shell-mode
slime-repl-mode
term-mode
wdired-mode)
"Modes that should come up in Insert state."
:type '(repeat symbol)
:group 'evil)
(defcustom evil-motion-state-modes
'(apropos-mode
Buffer-menu-mode
calendar-mode
color-theme-mode
command-history-mode
compilation-mode
dictionary-mode
ert-results-mode
help-mode
Info-mode
speedbar-mode
undo-tree-visualizer-mode
view-mode)
"Modes that should come up in Motion state."
:type '(repeat symbol)
:group 'evil)
(defvar evil-pending-overriding-maps nil
"An alist of pending overriding maps.")
(defvar evil-pending-intercept-maps nil
"An alist of pending intercept maps.")
(defcustom evil-overriding-maps
'((Buffer-menu-mode-map . nil)
(color-theme-mode-map . nil)
(comint-mode-map . nil)
(compilation-mode-map . nil)
(dictionary-mode-map . nil)
(ert-results-mode-map . motion)
(Info-mode-map . motion)
(speedbar-key-map . nil)
(speedbar-file-key-map . nil)
(speedbar-buffers-key-map . nil))
"Keymaps that should override Evil maps.
Entries have the form (MAP-VAR . STATE), where MAP-VAR is
a keymap variable and STATE is the state whose bindings
should be overridden. If STATE is nil, all states are
overridden."
:type '(alist :key-type symbol :value-type symbol)
:group 'evil
:set #'(lambda (var values)
(evil-set-custom-state-maps 'evil-overriding-maps
'evil-pending-overriding-maps
'override-state
'evil-make-overriding-map
values))
:initialize 'evil-custom-initialize-pending-reset)
(add-hook 'after-load-functions #'evil-update-pending-maps)
(defcustom evil-intercept-maps
'((edebug-mode-map . nil))
"Keymaps that should intercept Evil maps.
Entries have the form (MAP-VAR . STATE), where MAP-VAR is
a keymap variable and STATE is the state whose bindings
should be intercepted. If STATE is nil, all states are
intercepted."
:type '(alist :key-type symbol :value-type symbol)
:group 'evil
:set #'(lambda (var values)
(evil-set-custom-state-maps 'evil-intercept-maps
'evil-pending-intercept-maps
'intercept-state
'evil-make-intercept-map
values))
:initialize 'evil-custom-initialize-pending-reset)
(defcustom evil-motions
'(back-to-indentation
backward-char
backward-list
backward-paragraph
backward-sentence
backward-sexp
backward-up-list
backward-word
beginning-of-buffer
beginning-of-defun
beginning-of-line
beginning-of-visual-line
c-beginning-of-defun
c-end-of-defun
down-list
end-of-buffer
end-of-defun
end-of-line
end-of-visual-line
exchange-point-and-mark
forward-char
forward-list
forward-paragraph
forward-sentence
forward-sexp
forward-word
goto-last-change
ibuffer-backward-line
ibuffer-forward-line
isearch-abort
isearch-cancel
isearch-complete
isearch-del-char
isearch-delete-char
isearch-edit-string
isearch-exit
isearch-highlight-regexp
isearch-occur
isearch-other-control-char
isearch-other-meta-char
isearch-printing-char
isearch-query-replace
isearch-query-replace-regexp
isearch-quote-char
isearch-repeat-backward
isearch-repeat-forward
isearch-ring-advance
isearch-ring-retreat
isearch-toggle-case-fold
isearch-toggle-input-method
isearch-toggle-regexp
isearch-toggle-specified-input-method
isearch-toggle-word
isearch-yank-char
isearch-yank-kill
isearch-yank-line
isearch-yank-word-or-char
keyboard-quit
left-char
left-word
mouse-drag-region
mouse-save-then-kill
mouse-set-point
mouse-set-region
mwheel-scroll
move-beginning-of-line
move-end-of-line
next-error
next-line
paredit-backward
paredit-backward-down
paredit-backward-up
paredit-forward
paredit-forward-down
paredit-forward-up
pop-global-mark
pop-tag-mark
pop-to-mark-command
previous-error
previous-line
redo
right-char
right-word
scroll-down
scroll-up
undo
undo-tree-redo
undo-tree-undo
up-list)
"Non-Evil commands to initialize to motions."
:type '(repeat symbol)
:group 'evil
:set 'evil-set-custom-motions
:initialize 'evil-custom-initialize-pending-reset)
(defcustom evil-visual-newline-commands
'(LaTeX-section
TeX-font)
"Commands excluding the trailing newline of a Visual Line selection.
These commands work better without this newline."
:type '(repeat symbol)
:group 'evil
:set 'evil-set-visual-newline-commands
:initialize 'evil-custom-initialize-pending-reset)
(defcustom evil-want-visual-char-semi-exclusive nil
"Visual character selection to beginning/end of line is exclusive.
If non nil then an inclusive visual character selection which
ends at the beginning or end of a line is turned into an
exclusive selection. Thus if the selected (inclusive) range ends
at the beginning of a line it is changed to not include the first
character of that line, and if the selected range ends at the end
of a line it is changed to not include the newline character of
that line."
:type 'boolean
:group 'evil)
(defgroup evil-cjk nil
"CJK support"
:prefix "evil-cjk-"
:group 'evil)
(defcustom evil-cjk-emacs-word-boundary nil
"Determine word boundary exactly the same way as Emacs does."
:type 'boolean
:group 'evil-cjk)
(defcustom evil-cjk-word-separating-categories
'(;; Kanji
(?C . ?H) (?C . ?K) (?C . ?k) (?C . ?A) (?C . ?G)
;; Hiragana
(?H . ?C) (?H . ?K) (?H . ?k) (?H . ?A) (?H . ?G)
;; Katakana
(?K . ?C) (?K . ?H) (?K . ?k) (?K . ?A) (?K . ?G)
;; half-width Katakana
(?k . ?C) (?k . ?H) (?k . ?K) ; (?k . ?A) (?k . ?G)
;; full-width alphanumeric
(?A . ?C) (?A . ?H) (?A . ?K) ; (?A . ?k) (?A . ?G)
;; full-width Greek
(?G . ?C) (?G . ?H) (?G . ?K) ; (?G . ?k) (?G . ?A)
)
"List of pair (cons) of categories to determine word boundary
used in `evil-cjk-word-boundary-p'. See the documentation of
`word-separating-categories'. Use `describe-categories' to see
the list of categories."
:type '((character . character))
:group 'evil-cjk)
(defcustom evil-cjk-word-combining-categories
'(;; default value in word-combining-categories
(nil . ?^) (?^ . nil)
;; Roman
(?r . ?k) (?r . ?A) (?r . ?G)
;; half-width Katakana
(?k . ?r) (?k . ?A) (?k . ?G)
;; full-width alphanumeric
(?A . ?r) (?A . ?k) (?A . ?G)
;; full-width Greek
(?G . ?r) (?G . ?k) (?G . ?A)
)
"List of pair (cons) of categories to determine word boundary
used in `evil-cjk-word-boundary-p'. See the documentation of
`word-combining-categories'. Use `describe-categories' to see the
list of categories."
:type '((character . character))
:group 'evil-cjk)
(defface evil-ex-info '(( ((supports :slant))
:slant italic
:foreground "red"))
"Face for the info message in ex mode."
:group 'evil)
;; Searching
(defcustom evil-ex-search-vim-style-regexp nil
"If non-nil Vim-style backslash codes are supported in search patterns.
See `evil-transform-vim-style-regexp' for the supported backslash
codes. Note that this only affects the search command if
`evil-search-module' is set to 'evil. The isearch module always
uses plain Emacs regular expressions."
:type 'boolean
:group 'evil)
(defcustom evil-ex-interactive-search-highlight 'all-windows
"Determine in which windows the interactive highlighting should be shown."
:type '(radio (const :tag "All windows." all-windows)
(const :tag "Selected window." selected-window)
(const :tag "Disable highlighting." nil))
:group 'evil)
(defcustom evil-ex-search-case 'smart
"The case behaviour of the search command.
Smart case means that the pattern is case sensitive if and only
if it contains an upper case letter, otherwise it is case
insensitive."
:type '(radio (const :tag "Case sensitive." sensitive)
(const :tag "Case insensitive." insensitive)
(const :tag "Smart case." smart))
:group 'evil)
(defcustom evil-ex-substitute-case nil
"The case behaviour of the search command.
Smart case means that the pattern is case sensitive if and only
if it contains an upper case letter, otherwise it is case
insensitive. If nil then the setting of `evil-ex-search-case' is
used."
:type '(radio (const :tag "Same as interactive search." nil)
(const :tag "Case sensitive." sensitive)
(const :tag "Case insensitive." insensitive)
(const :tag "Smart case." smart))
:group 'evil)
(defcustom evil-ex-search-interactive t
"If t search is interactive."
:type 'boolean
:group 'evil)
(defcustom evil-ex-search-highlight-all t
"If t and interactive search is enabled, all matches are
highlighted."
:type 'boolean
:group 'evil)
(defcustom evil-ex-substitute-highlight-all t
"If t all matches for the substitute pattern are highlighted."
:type 'boolean
:group 'evil)
(defcustom evil-ex-substitute-interactive-replace t
"If t and substitute patterns are highlighted,
the replacement is shown interactively."
:type 'boolean
:group 'evil)
(defface evil-ex-search '((t :inherit isearch))
"Face for interactive search."
:group 'evil)
(defface evil-ex-lazy-highlight '((t :inherit lazy-highlight))
"Face for highlighting all matches in interactive search."
:group 'evil)
(defface evil-ex-substitute-matches '((t :inherit lazy-highlight))
"Face for interactive substitute matches."
:group 'evil)
(defface evil-ex-substitute-replacement '((((supports :underline))
:underline t
:foreground "red"))
"Face for interactive replacement text."
:group 'evil)
;;; Variables
(defmacro evil-define-local-var (symbol &optional initvalue docstring)
"Define SYMBOL as permanent buffer local variable, and return SYMBOL.
The parameters are the same as for `defvar', but the variable
SYMBOL is made permanent buffer local."
(declare (indent defun)
(debug (symbolp &optional form stringp)))
`(progn
(defvar ,symbol ,initvalue ,docstring)
(make-variable-buffer-local ',symbol)
(put ',symbol 'permanent-local t)))
(evil-define-local-var evil-state nil
"The current Evil state.
To change the state, use `evil-change-state'
or call the state function (e.g., `evil-normal-state').")
;; these may be used inside `evil-define-state'
(evil-define-local-var evil-next-state nil
"The Evil state being switched to.")
(evil-define-local-var evil-previous-state-alist nil
"For Each evil state the Evil state being switched from.")
(evil-define-local-var evil-previous-state nil
"The Evil state being switched from.")
(defvar evil-execute-in-emacs-state-buffer nil
"The buffer of the latest `evil-execute-in-emacs-state'.
When this command is being executed the current buffer is stored
in this variable. This is necessary in case the Emacs-command to
be called changes the current buffer.")
(evil-define-local-var evil-mode-line-tag nil
"Mode-Line indicator for the current state.")
(put 'evil-mode-line-tag 'risky-local-variable t)
(defvar evil-global-keymaps-alist nil
"Association list of keymap variables.
Entries have the form (MODE . KEYMAP), where KEYMAP
is the variable containing the keymap for MODE.")
(defvar evil-local-keymaps-alist nil
"Association list of keymap variables that must be
reinitialized in each buffer. Entries have the form
\(MODE . KEYMAP), where KEYMAP is the variable containing
the keymap for MODE.")
(defvar evil-state-properties nil
"Specifications made by `evil-define-state'.
Entries have the form (STATE . PLIST), where PLIST is a property
list specifying various aspects of the state. To access a property,
use `evil-state-property'.")
(evil-define-local-var evil-mode-map-alist nil
"Association list of keymaps to use for Evil modes.
Elements have the form (MODE . KEYMAP), with the first keymaps
having higher priority.")
(defvar evil-command-properties nil
"Specifications made by `evil-define-command'.")
(defvar evil-transient-vars '(cua-mode transient-mark-mode select-active-regions)
"List of variables pertaining to Transient Mark mode.")
(defvar evil-transient-vals nil
"Association list of old values for Transient Mark mode variables.
Entries have the form (VARIABLE VALUE LOCAL), where LOCAL is
whether the variable was previously buffer-local.")
(evil-define-local-var evil-no-display nil
"If non-nil, various Evil displays are inhibited.
Use the macro `evil-without-display' to set this variable.")
(defvar evil-type-properties nil
"Specifications made by `evil-define-type'.
Entries have the form (TYPE . PLIST), where PLIST is a property
list specifying functions for handling the type: expanding it,
describing it, etc.")
(defvar evil-interactive-alist nil
"Association list of Evil-specific interactive codes.")
(evil-define-local-var evil-motion-marker nil
"Marker for storing the starting position of a motion.")
(evil-define-local-var evil-this-type nil
"Current motion type.")
(evil-define-local-var evil-this-register nil
"Current register.")
(evil-define-local-var evil-this-macro nil
"Current macro register.")
(evil-define-local-var evil-this-operator nil
"Current operator.")
(evil-define-local-var evil-this-motion nil
"Current motion.")
(evil-define-local-var evil-this-motion-count nil
"Current motion count.")
(defvar evil-inhibit-operator nil
"Inhibit current operator.
If an operator calls a motion and the motion sets this variable
to t, the operator code is not executed.")
(defvar evil-inhibit-operator-value nil
"This variable is used to transfer the value
of `evil-inhibit-operator' from one local scope to another.")
;; used by `evil-define-operator'
(defvar evil-operator-range-beginning nil
"Beginning of `evil-operator-range'.")
(defvar evil-operator-range-end nil
"End of `evil-operator-range'.")
(defvar evil-operator-range-type nil
"Type of `evil-operator-range'.")
(defvar evil-operator-range-motion nil
"Motion of `evil-operator-range'.")