Permalink
Browse files

Add vi movement key bindings for cscope-list-entry-mode and etags-sel…

…ect-mode.
  • Loading branch information...
1 parent 62f71ca commit 0c0e5b3b2a83444f2a850fa7e524be4815a1ed89 @winfred-lu committed Mar 14, 2012
Showing with 15 additions and 0 deletions.
  1. +5 −0 winfred-evil.el
  2. +10 −0 winfred-keys.el
View
@@ -6,6 +6,7 @@
(evil-set-initial-state 'grep-mode 'emacs)
(evil-set-initial-state 'Info-mode 'emacs)
(evil-set-initial-state 'Man-mode 'emacs)
+(evil-set-initial-state 'cscope-list-entry-mode 'emacs)
;; kj as escape to return to normal mode
(define-key evil-insert-state-map "k" #'cofi/maybe-exit)
@@ -99,6 +100,10 @@
(eval-after-load "etags-select"
'(progn
+ (evil-define-key 'emacs etags-select-mode-map "j" 'evil-next-visual-line)
+ (evil-define-key 'emacs etags-select-mode-map "k" 'evil-previous-visual-line)
+ (evil-define-key 'emacs etags-select-mode-map "\C-f" 'evil-scroll-page-down)
+ (evil-define-key 'emacs etags-select-mode-map "\C-b" 'evil-scroll-page-up)
(evil-define-key 'emacs etags-select-mode-map (kbd "RET") 'etags-select-goto-tag)))
(eval-after-load "lisp"
View
@@ -9,6 +9,7 @@
;; undo evil's key bindings
(define-key evil-insert-state-map "\C-e" 'end-of-line)
(define-key evil-normal-state-map "\C-e" 'end-of-line)
+(define-key evil-insert-state-map "\C-y" 'yank)
;; yank at motion state
(define-key evil-motion-state-map "y" 'evil-yank)
@@ -19,6 +20,15 @@
;;;;;; local key bindings (modeful) ;;;;;;
+(add-hook 'cscope-list-entry-hook
+ '(lambda ()
+ (define-key cscope-list-entry-keymap "j" 'evil-next-visual-line)
+ (define-key cscope-list-entry-keymap "k" 'evil-previous-visual-line)
+ (define-key cscope-list-entry-keymap "q" 'delete-window)
+ (define-key cscope-list-entry-keymap "\C-f" 'evil-scroll-page-down)
+ (define-key cscope-list-entry-keymap "\C-b" 'evil-scroll-page-up)
+ (define-key cscope-list-entry-keymap (kbd "RET") 'cscope-select-entry-other-window)))
+
(add-hook 'html-mode-hook
'(lambda ()
(local-set-key (kbd "C-c o") 'browse-url-at-point)))

0 comments on commit 0c0e5b3

Please sign in to comment.