我工作的地方到处都是混合缩进。不幸的是,这就是公司决定的风格(哎呀。)我宁愿看不到"混合缩进"合成器在vim中产生的错误,但我不想完全关闭它。有没有办法禁用空格检查或什么?或者我可以以某种方式切换到更好的检查器?我的vimrc会自动删除尾随空格并修复缩进,所以我真的不需要那些检查。
答案 0 :(得分:4)
我想它是vim-airline。 阅读help:
* customize the type of mixed indent checking to perform.
" must be all spaces or all tabs before the first non-whitespace character
let g:airline#extensions#whitespace#mixed_indent_algo = 0 (default)
" certain number of spaces are allowed after tabs, but not in between
" this algorithm works well for /** */ style comments in a tab-indented file
let g:airline#extensions#whitespace#mixed_indent_algo = 1
" spaces are allowed after tabs, but not in between
" this algorithm works well with programming styles that use tabs for
" indentation and spaces for alignment
let g:airline#extensions#whitespace#mixed_indent_algo = 2
此外:
* configure which whitespace checks to enable.
" indent: mixed indent within a line
" long: overlong lines
" trailing: trailing whitespace
" mixed-indent-file: different indentation in different lines
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing', 'long', 'mixed-indent-file' ]