Wrong indentation when editing Yaml in Vim

前端 未结 7 1137
一整个雨季
一整个雨季 2021-01-30 03:50

Vim does not seem to correctly react at a dash symbol in YAML files therefore breaking the format.

For example I have a block which should look like this:



        
7条回答
  •  佛祖请我去吃肉
    2021-01-30 04:21

    Here's the augroup I have for yaml:

    augroup filetype_yaml
        autocmd!
        autocmd BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent
        autocmd FileType yaml |
            setlocal shiftwidth=2 |
            setlocal softtabstop=2 |
            setlocal tabstop=2
    augroup END
    

提交回复
热议问题