dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE

yaml.vim (567B)


      1 augroup yaml_config
      2 
      3     " Inspired by Ian Young's script
      4     setlocal autoindent shiftwidth=2 expandtab
      5     setlocal indentexpr=GetYamlIndent()
      6     setlocal indentkeys=o,O,*<Return>,!^F
      7 
      8     function! GetYamlIndent()
      9         let lnum = v:lnum - 1
     10         if lnum == 0
     11             return 0
     12         endif
     13         let line = substitute(getline(lnum),'\s\+$','','')
     14         let indent = indent(lnum)
     15         let increase = indent + &sw
     16         if line =~ ':$'
     17             return increase
     18         else
     19             return indent
     20         endif
     21     endfunction
     22 
     23 augroup END