vim: my 2 cents yaml debugger

Par mc, 18 novembre 2009 10 h 55 min

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:

  1. use vim as package management tool
  2. edit koha code with vim
  3. acceder aux mappings normaux depuis le mode edition
  4. copier/coller dans vim

Laisser un commentaire

Panorama Theme by Themocracy