3

A solution I discovered while answering a duplicate: it should be faster than the existing answer, as it uses just a couple of matches/builtin functions, rather than looping over lines. The algorithm is simpler, too. However, it may not work if there are blank lines or comments between the { and the case, or comments at the front of those lines—I would ...


2

I put together a little function that defaults to using cindent() for the indent, unless we are indenting a { line that directly follows a case statement (I've been twiddling a lot with indentexpr lately): function s:indent(lnum, offset) abort return a:lnum <= 0 \ ? indent('.') \ : indent(a:lnum) + a:offset endfunction function! c#...


1

This issue has already been answered, but I though I could also add my solution: As suggested by filbranden, it's better to not modified vim's system files. Instead, he suggested to use skip_defaults_vim=1 or create a .vimrc file in my home directory to disable the default features. If I want any of the default features, I can add them to my .vimrc file. In ...


Only top voted, non community-wiki answers of a minimum length are eligible