Open Konfekt opened 8 months ago
In the meantime
augroup DetectIndent
autocmd!
autocmd BufReadPost * DetectIndent |
\ if &l:softtabstop > 4 | let &l:softtabstop = 4 | endif |
\ if &l:shiftwidth > 4 | let &l:shiftwidth = 4 | endif
augroup END
serves as a workaround
I think this is a good idea. Do you think 8 spaces would be a good maximum? The Linux kernel uses tabs rendered as 8 spaces so I think someone using 8-space indents wouldn't be entirely unreasonable.
Yes, this limit is what I am using in my vimrc as well.
Would you like to open a PR?
In a file with two lines of which one has many leading spaces, the detected indent is huge. How about a maximal indent similar to the minimal one ?