On Thursday, 30 Mar 2017 at 10:14, Guido Van Hoecke wrote:
> Eric,
>
> Care to share your org-evil mappings?
sure:
#+begin_src emacs-lisp
(defun esf/evil-key-bindings-for-org ()
;;(message "Defining evil key bindings for org")
(when (fboundp 'evil-declare-key)
;; normal, motion and visual commands
(mapcar (lambda (state)
(evil-declare-key state org-mode-map
" " 'evil-scroll-down
" e" 'org-edit-special
" g" 'org-babel-goto-named-src-block
" j" 'org-babel-next-src-block
" k" 'org-babel-previous-src-block
" l" 'org-next-link
" n" 'org-babel-next-src-block
" p" 'org-babel-previous-src-block
" u" 'outline-up-heading
"gh" 'outline-up-heading
"gj" 'org-forward-heading-same-level
"gk" 'org-backward-heading-same-level
"gl" 'outline-next-visible-heading
"t" 'org-todo ; mark a TODO item as DONE
",e" 'org-export-dispatch
",i" 'org-inlinetask-insert-task
",l" 'org-insert-link
",L" 'org-store-link
",n" 'outline-next-visible-heading
",oa" #'org-annotate-add-note
",od" #'org-annotate-display-notes
",p" 'outline-previous-visible-heading
",r" 'org-ref-insert-cite-link
;; ",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
(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 motion visual))
;; and these are only for motion and visual so that . does not repeat them
(mapcar (lambda (state)
(evil-declare-key state org-mode-map
"H" 'org-beginning-of-line ; smarter behaviour on headlines etc.
;; "L" 'end-of-line ; do not want "smarter" behaviour on headlines etc.
"L" 'org-end-of-line ; do not want "smarter" behaviour on headlines etc.
))
'(motion visual))
(evil-declare-key 'insert org-mode-map
(kbd "<backspace>") 'hungry-delete-backward
(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)
(when (not esf/pandora-p)
(evil-declare-key 'insert org-mode-map
(kbd "<backspace>") 'hungry-delete-backward))))
#+end_src
> One 'conflict' which bites me every time is this:
I cannot help with this unfortunately other than to maybe trying to
advise the search function...
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.1.1, Org release_9.0.5-391-g36c7cf