1

Editing src blocks directly in org file is nice but you cannot benefit from all minor modes that would be enabled in dedicated code edit buffer, more then that for a big babel file the performance struggles. Usually I forget to do this additional keystroke and end up editing in org. Is there any out-of-the-box option or simple workaround this can be made automatic - e.g. whenever I hit edit command the buffer is opened automatically and gets activated with all input continuing there?

p.s. I'm using evil - one thing that came to my mind was capturing some evil-into-insert-mode-hook and checking if I'm inside a src block, but this is does not cover all cases of course

1 Answer 1

0

Ok, figured that out on my own - at least, for evil:

 (add-hook 'org-mode-hook (lambda() (make-local-variable 'evil-insert-state-entry-hook) ;; making this hook act only locally in the buffer where org-mode-hook has been called (add-hook 'evil-insert-state-entry-hook #'org-edit-src-code))) 
1
  • You should be able to accept your own answer by now. Commented Feb 20, 2024 at 12:01

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.