I use evil-mode and evil-leader, and I have the
<SPC>s keybinding to save the buffer. But when I edit a src code block in org-mode (with
C-'), I want
<SPC>s to run
org-edit-src-save instead of
save-buffer. Some things I tried:
;; I think this one has no effect because `set-key-for-mode` ;; probably only works with major-modes. (evil-leader/set-key-for-mode 'org-src-mode "s" 'org-edit-src-save) ;; This one works, but makes the binding global. (defun my/org-src-conf () (make-local-variable 'evil-leader--default-map) (make-local-variable 'evil-leader--mode-maps) (evil-leader/set-key "s" 'org-edit-src-save)) (add-hook 'org-src-mode-hook 'my/org-src-conf)
How can I achieve this local binding for evil-leader?