forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-viper.el
33 lines (24 loc) · 1.39 KB
/
init-viper.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
(eval-after-load "viper"
'(progn
;; C-z is usually 'iconify-or-deiconify-frame, but viper uses it to toggle
;; vi/emacs input modes, causing confusion in non-viper buffers
(global-unset-key "\C-z")
(setq viper-mode t)
(setq viper-custom-file-name (convert-standard-filename "~/.emacs.d/.viper"))
(define-key viper-insert-global-user-map [kp-delete] 'viper-delete-char)
(define-key viper-insert-global-user-map (kbd "C-n") 'dabbrev-expand)
(define-key viper-insert-global-user-map (kbd "C-p") 'dabbrev-expand)
;; Stop C-u from clobbering prefix-arg -- I always use C-b/C-f to scroll
(define-key viper-vi-basic-map "\C-u" nil)
;; Vim-style searching of the symbol at point, made easy by highlight-symbol
(autoload 'highlight-symbol-next "highlight-symbol" "Highlight symbol at point")
(autoload 'highlight-symbol-prev "highlight-symbol" "Highlight symbol at point")
(setq highlight-symbol-on-navigation-p t)
(define-key viper-vi-global-user-map "*" 'highlight-symbol-next)
(define-key viper-vi-global-user-map "#" 'highlight-symbol-prev)))
;; Work around a problem in Cocoa emacs, wherein setting the cursor coloring
;; is incredibly slow; viper sets the cursor very frequently in insert mode
(when *is-cocoa-emacs*
(eval-after-load "viper"
'(defun viper-change-cursor-color (new-color &optional frame))))
(provide 'init-viper)