Permalink
Browse files

Define vi movement bindings for calendar mode and remap original 'k' …

…to 'K'.
  • Loading branch information...
1 parent d2bec2d commit 230667360cd24a7a5819ee91e1839417545b9ae5 @winfred-lu committed Mar 20, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 winfred-evil.el
View
@@ -2,6 +2,7 @@
(require 'evil)
(evil-mode 1)
+(evil-set-initial-state 'calendar-mode 'emacs)
(evil-set-initial-state 'Custom-mode 'normal)
(evil-set-initial-state 'grep-mode 'emacs)
(evil-set-initial-state 'Info-mode 'emacs)
@@ -80,7 +81,14 @@
;;;;;; local key bindings (modeful) ;;;;;;
-;; key bindings for cc-mode
+(eval-after-load "calendar"
+ '(progn
+ (evil-define-key 'emacs calendar-mode-map "j" 'calendar-forward-week)
+ (evil-define-key 'emacs calendar-mode-map "k" 'calendar-backward-week)
+ (evil-define-key 'emacs calendar-mode-map "h" 'calendar-backward-day)
+ (evil-define-key 'emacs calendar-mode-map "l" 'calendar-forward-day)
+ (evil-define-key 'emacs calendar-mode-map "K" 'org-agenda-action)))
+
(eval-after-load 'cc-mode
'(progn
(evil-define-key 'insert c-mode-map (kbd "RET") 'evil-ret)))

0 comments on commit 2306673

Please sign in to comment.