Herbert Sitz <hes...@gmail.com> writes: > I was playing around with Evil and like it quite a bit. It feels better than > the previous Viper/Vimpulse package I was using, plus documentation is good, > clear, and it seems easy to customize. > > One problem with Org for me has been keybindings. Even with a Vim emulator > that > does a decent job of vim-ifying Emacs, it still leaves all of the (numerous) > Org-specific keymappings to deal with. It turns out to be quite easy to add > custom keymappings to Org-mode to make commands accessible in a more Vim-like > way. I've added the code below to my .emacs and it's a good start. Maybe > some > vim-friendly Org users will have ideas on how to grow it from here:
Herbert, thanks for these. Very useful. I already had some bindings but have added some more based on yours. My current setup is: #+begin_src emacs-lisp (defun esf/evil-key-bindings-for-org () ;;(message "Defining evil key bindings for org") (evil-declare-key 'normal org-mode-map "gh" 'outline-up-heading "gj" 'org-forward-same-level "gk" 'org-backward-same-level "gl" 'outline-next-visible-heading "H" 'org-beginning-of-line ; smarter behaviour on headlines etc. "L" 'org-end-of-line ; smarter behaviour on headlines etc. "t" 'org-todo ; mark a TODO item as DONE ",c" 'org-cycle ",e" 'org-export-dispatch ",n" 'outline-next-visible-heading ",p" 'outline-previous-visible-heading ",t" 'org-set-tags-command ",u" 'outline-up-heading "$" 'org-end-of-line ; smarter behaviour on headlines etc. "^" 'org-beginning-of-line ; ditto "-" 'org-ctrl-c-minus ; change bullet style "<" 'org-metaleft ; out-dent ">" 'org-metaright ; indent ) (mapcar (lambda (state) (evil-declare-key state org-mode-map (kbd "M-l") 'org-metaright (kbd "M-h") 'org-metaleft (kbd "M-k") 'org-metaup (kbd "M-j") 'org-metadown (kbd "M-L") 'org-shiftmetaright (kbd "M-H") 'org-shiftmetaleft (kbd "M-K") 'org-shiftmetaup (kbd "M-J") 'org-shiftmetadown)) '(normal insert))) #+end_src I've been using evil now for quite a few months and I am very happy with it. Especially for RSI sufferers, a mode based editor avoiding most C- and M- commands is very nice. Combined with ratpoison and keynav, my fingers seldom have to leave the home row! -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1 : using Org release_7.8.09-529-g035ab3.dirty