-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdix-evil.el
66 lines (48 loc) · 2.09 KB
/
dix-evil.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
;;; dix-evil.el --- optional evil-integration with dix.el
;; Copyright (C) 2015-2016 Kevin Brubeck Unhammer
;; Author: Kevin Brubeck Unhammer <[email protected]>
;; Version: 0.1.0
;; Url: http://wiki.apertium.org/wiki/Emacs
;; Keywords: languages
;; Package-Requires: ((dix "0.3.0") (evil "1.0.7"))
;; This file is not part of GNU Emacs.
;; This program 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 2, or (at your option)
;; any later version.
;;
;; This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Extensions to dix.el for using it with evil-mode.
;; Usage:
;; (eval-after-load 'evil (eval-after-load 'dix '(require 'dix-evil)))
;;; Code:
;;;============================================================================
;;;
;;; Evil integration
;;;
(require 'evil)
(require 'dix)
(evil-declare-motion #'dix-next)
(evil-declare-motion #'dix-previous)
(evil-declare-motion #'dix-move-to-top)
(evil-declare-motion #'dix-backward-up-element)
(evil-declare-motion #'dix-goto-pardef)
(evil-declare-not-repeat #'dix-view-pardef)
(evil-declare-not-repeat #'dix-grep-all)
(advice-add #'dix-goto-pardef :before (defun dix-goto-pardef-push-jump (&rest ignore)
(evil--jumps-push)))
(add-hook 'dix-mode-hook
(defun dix-avoid-slow-paren-matching ()
"Avoid `evil-highlight-closing-paren-at-point-states' in `dix-mode'.
That functionality is very slow in big nXML files."
(set (make-local-variable 'evil-highlight-closing-paren-at-point-states) nil)))
(provide 'dix-evil)
;;;============================================================================
;;; dix-evil.el ends here