Browse Source

vim: do not put extra indent for lists in YAML

master
Elouan Martinet 7 months ago
parent
commit
7ce610bc50
  1. 7
      vim/indent/yaml.vim

7
vim/indent/yaml.vim

@ -111,7 +111,12 @@ function GetYAMLIndent(lnum)
"
" - |-
" Block scalar without indentation indicator
return previndent+shiftwidth()
if line =~# s:liststartregex
" List line should have indent equal to previous indent
return previndent
else
return previndent+shiftwidth()
endif
elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$'
" - |+2
" block scalar with indentation indicator

Loading…
Cancel
Save