aserebryakov / filestyle

filestyle is a Vim plugin that highlights unwanted whitespace and characters.
http://www.vim.org/scripts/script.php?script_id=5065
Apache License 2.0
30 stars 5 forks source link

Make \t\t\t\s\s indent schema possible #45

Open dhyannataraj opened 5 years ago

dhyannataraj commented 5 years ago

Hi! In some projects codestyle allows to use several spaces after tabs for indention. So it would be good if there would be possibility to configure filestyle to accept it.

As far as I can see it there can be two modes in it.

  1. spaces after tabs (or some number of it) are totally legal. So user can enumerate numbers of spaces that are acceptable 2 for accept \t\s\s 1,2,3 for accept \t\s*{1,3} (regexp are in perl-style sorry)

The last one I've solved with

let g:filestyle_ignore_patterns = ['^\t* \{1,3}\S']

but it take me a while, i am not good with vim regexp. Better to have it in the code of plugin or at least in documentation...

  1. Second mode is when spaces after tabs are acceptable, but should draw an attention.

As far as I can see this mode should be configured in the same way, and only spaces after \t* should be highlighted in some warning highlight background (i.e. gray: all is ok, but please pay attention)

This mode will suit me better then the first one, but I am not able to implement using tools that are described in plugin docs.