2 ms·
While we're at sharing neat vim configs, here's the one I was quite happy with at the time: I got tired of indent style arguments. I don't care. So I wrote a li
by smueller1234 3y ago
While we're at sharing neat vim configs, here's the one I was quite happy with at the time: I got tired of indent style arguments. I don't care. So I wrote a little heuristic to detect indent style, then configured vim with my preferences, and added this to .vimrc:
> map <F5> <Esc> :perl use Text::FindIndent;VIM::DoCommand($_) for
Text::FindIndent->to_vim_commands(join "\n", $curbuf->Get(1..$curbuf->Count()));<CR>
Text::FindIndent is the aforementioned heuristic as a Perl module. Sorry for the mangled quote, original at https://metacpan.org/pod/Text::FindIndent https://metacpan.org/pod/Text::FindIndent
When I work on existing code, I hit F5 and work within the author's preferences.