0

I want to bind evil leader keys for org-edit-src-save and org-edit-src-exit in org-src-mode. And I have:

(evil-leader/set-key-for-mode 'org-src-mode
  "s" 'org-edit-src-save
  "'" 'org-edit-src-exit)

But it doesn't work. What's wrong with my code?

1 Answer 1

1

When we use org-src-mode, the major mode is changed to the language we are editing.

So 'org-src-mode should change to the language mode or you can set it globally. For example:

#+BEGIN_SRC emacs-lisp
|
#+END_SRC

(C-c ') then the major mode in new buffer is emacs-lisp-mode, not org-src-mode. So you should set evil-leader keys for emacs-lisp-mode, such as:

(evil-leader/set-key-for-mode 'emacs-lisp-mode
  "s" 'org-edit-src-save
  "'" 'org-edit-src-exit)

or, set it globally by:

(evil-leader/set-key
  "s" 'org-edit-src-save
  "'" 'org-edit-src-exit)
1
  • Welcome. I have tried to improve the language of the post. I hope I have kept your meaning. Aug 22, 2016 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.