I'm constantly editing a big yaml file with many multi-line strings, which are BASH scripts.

In org-mode I would use something like:

#+begin_src sh
echo "cool"

And then just to C-c ' (org-edit-src-code) to edit this portion of the file in a special "buffer" with the Shell-script[bash] mode.

Is it possible to do this in a YAML file? To select a portion of the file and edit it on its own buffer?

An example of this is:

  data: |
    # this is my shell script
    echo "cool"
    # the end

Is it possible to edit this multi-line string as a Shell-script[bash] and also having Emacs removing the 4 spaces (which are part of yaml, stucture)? or Can I use org-edit-src-code outside org-mode?

  • Have you looked at Mutliple Major Modes (aka mmm-mode)? – nega Jul 9 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.