vim: my 2 cents yaml debugger
my ~/.vim/ftplugin/yaml.vim
" put yamllint or any yamlparser in your $PATH
" personnaly, i have
" yamllint () { perl -MYAML -e 'print Dump YAML::LoadFile("'"$1"'")' }
" in my .zshenv
" type ,c in normal mode to know if you file is valid
nnoremap ,c :!yamllint %<cr>
" the common mistakes are
"
" forget a space after the : at the end of a key
" /:\S
" replace : by ; at the end of a key
" /^[^:]+;\s
" forget the comma when you write [ key, { a: a } ]
" /\v\[^,]+\{
"
" put it all together:
" now you can type ,E in normal mode to walk through
" the common mistakes you wrote
nnoremap ,E /\v:\S<bar>\[[^,]+\{<bar>^[^:]+;\s<cr>Related posts: