From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: evil-mode and org
Date: Thu, 30 Mar 2017 16:48:07 +0100 [thread overview]
Message-ID: <87k276kbpk.fsf@ucl.ac.uk> (raw)
In-Reply-To: <2addcb35f67b455ba02295550e5b2ec7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Guido Van Hoecke's message of "Thu, 30 Mar 2017 10:14:07 +0000")
[-- Attachment #1: Type: text/plain, Size: 3640 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
next prev parent reply other threads:[~2017-03-31 4:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1a0d15aafd944fa3864394d8e212046f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-29 15:11 ` evil-mode and org Eric S Fraga
2017-03-30 10:14 ` Guido Van Hoecke
2017-03-30 17:03 ` Guido Van Hoecke
[not found] ` <2addcb35f67b455ba02295550e5b2ec7@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-30 15:48 ` Eric S Fraga [this message]
2017-04-10 12:22 ` Matt Price
[not found] ` <013bacb6be3a49b1b8633fb7d2ad1ddc@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-04-10 14:49 ` Eric S Fraga
2017-03-28 12:57 Matt Price
2017-03-28 13:23 ` Peter Neilson
2017-03-29 15:12 ` John Kitchin
2017-03-29 17:36 ` Peter Neilson
2017-03-30 1:33 ` John Hendy
2017-03-30 1:37 ` John Hendy
[not found] ` <e73a5e1e52db498f95cf60c7a983be27@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-29 15:21 ` Eric S Fraga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k276kbpk.fsf@ucl.ac.uk \
--to=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).