-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.viper
50 lines (40 loc) · 2.02 KB
/
.viper
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
(setq viper-syntax-preference 'extended)
(setq-default viper-auto-indent t)
(setq viper-ex-style-motion nil)
(setq viper-ex-style-editing nil)
(setq viper-inhibit-startup-message t)
(setq viper-want-ctl-h-help t)
(setq viper-expert-level 5)
;(viper-buffer-search-enable) ; g <motion> then n
(define-key viper-vi-global-user-map (kbd "gf") 'find-file-at-point)
(define-key viper-vi-global-user-map (kbd "gg") 'viper-goto-first-line)
(define-key viper-vi-global-user-map (kbd "*") 'viper-search-forward-for-symbol-at-point)
(define-key viper-vi-global-user-map (kbd "#") 'viper-search-backward-for-symbol-at-point)
(define-key viper-vi-global-user-map (kbd "C-]") 'viper-jump-to-tag-at-point)
(define-key viper-vi-global-user-map (kbd "C-t") 'pop-tag-mark)
(define-key viper-vi-global-user-map (kbd "TAB") 'bs-show)
(add-to-list 'viper-major-mode-modifier-list '(inferior-python-mode insert-state viper-comint-mode-modifier-map))
(add-to-list 'viper-major-mode-modifier-list '(inferior-python-mode vi-state viper-comint-mode-modifier-map))
(defvar viper-python-mode-modifier-map (make-sparse-keymap) "Fix viper shadowing python-mode")
(define-key viper-python-mode-modifier-map (kbd "<backspace>") 'viper-exec-key-in-emacs)
(add-to-list 'viper-major-mode-modifier-list '(python-mode insert-state viper-python-mode-modifier-map))
(add-to-list 'viper-major-mode-modifier-list '(python-mode vi-state viper-python-mode-modifier-map))
;; modded from vimlike.el
(defun viper-jump-to-tag-at-point ()
(interactive)
(let ((tag (thing-at-point 'symbol)))
(find-tag tag)))
(defun viper-goto-first-line ()
(interactive)
(viper-goto-line 1))
(defun viper-search-for-symbol-at-point (forward)
(let ((symbol (thing-at-point 'symbol)))
(setq viper-s-string symbol)
(setq viper-s-forward forward)
(viper-search symbol forward 1)))
(defun viper-search-forward-for-symbol-at-point ()
(interactive)
(viper-search-for-symbol-at-point t))
(defun viper-search-backward-for-symbol-at-point ()
(interactive)
(viper-search-for-symbol-at-point nil))