Working with yaml files in vim

when working with yaml files, indentation is crucial. You can setup vim to make it a little easier, like this:

:set ai ts=2 sw=2 expandtab

The above will set tabstop and shiftwidth to 2 spaces, and make the tab key create spaces instead of tabs. So with this config, you will type 2 spaces, whenever you press tab, just like yaml likes it.

This can of course be put in your vimrc file.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.