Here’s how to get the syntax highlighting for vim on a mac

1. Grab the syntax coloring script written by Clark Evans from vim.org

2. Copy the above script in ~/.vim/yaml.vim (I didn’t have a “.vim” folder, so I created one)

3. Edit (or create) the “.vimrc” file in your home directory and add the following lines


:syntax enable
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/yaml.vim

4. Give your YAML file a “.yml” extension.

That’s it!