This plugin is vim-airline's whitespace extension ported to lightline. It provides indication of trailing whitespace, mixed indentation and inconsistent indentation.
Install using a plugin manager of your choice, for example:
call dein#add('deponian/vim-lightline-whitespace')
- Register the component:
let g:lightline.component_expand = {'whitespace': 'lightline#whitespace#check'}
- Set color to the component (use
warning
orerror
):
let g:lightline.component_type = {'whitespace': 'warning'}
- Add the component to the lightline, for example to the right side:
let g:lightline.active = { 'right': [[ 'whitespace' ]] }
Max number of lines in file where whitespace checking is enabled.
Default:
20000
Separator between trail/mixed/inconsistent indicators.
Default:
" "
Format of trailing whitespace indicator.
%s
will be replaced with line number.Default:
"[%s] trail"
Format of mixed indentation indicator.
%s
will be replaced with line number.Default:
"[%s] mixed"
Format of inconsistent indentation indicator.
%s
will be replaced with line range.Default:
"[%s] inconsistent"
Disable specific whitespace checks for individual filetypes.
Default:
{}
Vim-airline's default:
{'make': ['mixed', 'inconsistent']}
Which filetypes have special treatment of /* */ comments, matters for inconsistent indentation algorithm.
Default:
[]
Vim-airline's default:
[ 'arduino', 'c', 'cpp', 'cuda', 'go', 'javascript', 'ld', 'php' ]
Customize the type of mixed indent checking to perform.
Algorithm 0: must be all spaces or all tabs before the first non-whitespace character
Algorithm 1: certain number of spaces are allowed after tabs, but not in between this algorithm works well for /* */ style comments in a tab-indented file
Algorithm 2: 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
Default:
0
Thanks to authors of original whitespace extension from vim-airline plugin.
Also thanks to @maximbaz and his lightline-trailing-whitespace repository which I used as a reference.