The place I work has mixed-indents all over. Unfortunately, that is the style the company has decided on (yuck.) I would rather not see the "mixed-indent" errors produced by syntastic in vim, but I don't want to turn it off altogether. Is there a way to disable whitespace checks or something? Or can I switch to a better checker somehow? My vimrc automatically removes trailing whitespace and fixes indents, so I really don't need those checks anyway.
Asked
Active
Viewed 1,358 times
2
-
Syntastic doesn't produce any error message, external checkers do. Configure the relevant checkers not to issue warnings about whitespace and you're done. – lcd047 Jun 12 '15 at 21:22
-
Yeah, but how? I was able to fix up my python linter with an rc file, but in all my searching there appears to be no easy fix for c++ files. Is there some line I can add to my .vimrc file that will pass the right command line parameters or something? "Configure the relevant checkers" is means nothing to me. – Cory Jun 12 '15 at 21:30
-
Yes, you can fix it by changing a single line in your vimrc. However, finding out enough about your exact setup to be able to tell you which line would that be, is not possible through SO comments. Thus, either invest a few minutes reading the manual, or post an issue to the official issue tracker. – lcd047 Jun 12 '15 at 21:36
1 Answers
4
I suppose it's vim-airline. Reading the 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
Also:
* 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' ]

theGiallo
- 146
- 6
-
Thank you, thank you, thank you. I was going crazy trying to find this, specifically for PHP. I thought it was `Syntastic`, but could not find anything in PHP's CLI that threw errors like that. It turns out `airline` does some syntax checking of its own outside `Syntastic`. – trysis Apr 26 '16 at 20:17
-
By the way, for my own edification, which plugin is this from? A lot of the other `airline` functionality is from plugins that you have to have already installed, like with `vundle`, but that seems not to be the case with whitespace, wordcount, and a couple others. Are these internal to `vim`, or internal to `airline`, or dependencies of `airline` somehow? – trysis Apr 26 '16 at 20:24
-
1I'd say it's https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/extensions/whitespace.vim – theGiallo May 04 '16 at 15:28
-
So it's internal to airline, hnot its own plugin or a copy of another plugin? – trysis May 04 '16 at 15:49
-
1From https://github.com/vim-airline/vim-airline it seems it's a stand alone extension provided by airline. Extras vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: whitespace – theGiallo May 04 '16 at 16:13