Is there any advantages or side-effects of an explicit set nocompatible that I'm perhaps missing?
Actually, there are many side-effects. Every time compatible is set or reset Vim rescans all options (except "terminal") and switches defaults when necessary. After that it rebuilds quite a few internal tables for iskeyword, spelling, vartabs etc. (see ...
One reason you might want to include a guarded set nocompatible in your .vimrc is that compatible will not be automatically unset if you specify the vimrc with the -u flag:
Using the "-u" argument with another argument than DEFAULTS has the side effect that the 'compatible' option will be on by default.
It's for this reason that I have this version* in ...
Add these two lines to the top of your newly created .vimrc:
For details, see :help defaults.vim:
If Vim is started normally and no user vimrc file is found, the $VIMRUNTIME/defaults.vim script is loaded. This will set 'compatible' off, switch on syntax highlighting and a few more things. See ...
There are too(?) many ways to do this.
writes all mappings and changed options to a file (.exrc by default)
2) Option window
opens a buffer with extra UI to change options (the code is in $VIMRUNTIME/optwin.vim); of course, the buffer is accessible by standard Vim commands too
3) Expression register
/usr/share/vim/vimrc is always sourced regardless of your vimrc (assuming $VIM doesn't point somewhere else - :h system-vimrc). The settings you're probably missing are in defaults.vim, a file that only gets sourced if you don't have a personal vimrc. To get them back add these two lines to your vimrc:
From :h defaults.vim:
If Vim is started normally and no user vimrc file is found, the
$VIMRUTIME/defaults.vim script is loaded.
Perhaps an empty vimrc is the same as no vimrc...? Anyways, try this...
Near the start of $VIMRUNTIME/defaults.vim you'll see:
So put something like this near the start of your ...
set fo-=r fo -=o
'formatoptions' 'fo' string (default: "tcqj", Vi default: "vt")
local to buffer
This is a sequence of letters which describes how automatic
formatting is to be done. See |fo-table|. When the 'paste' option is
on, no formatting is done (like 'formatoptions' is empty). ...
This bug was introduced on the Vim runtime update of May 12, 2020, with the update of syntax/sh.vim from version 189 to version 190 from April 14, 2020, which updated the shDoubleQuoted rule to include the part in bold below:
syn region shDoubleQuote matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ end=+"+ contained contains=@...
The lines that restores your settings are
autocmd BufWinLeave . mkview
autocmd BufWinEnter . silent loadview
They respectively save and load your settings for any file you open.
From the doc (:h mkview)
Write a Vim script that restores the contents of the
When [!] is included an ...
I looked at the source and I don't see any user-facing way to disable the bell limit. You'd have to build your own version as you mentioned. Think twice about that, though...
Rather than being a killjoy "feature" this apparently was implemented for the sake of Vim stability. I saw a couple comments indicating that rapid bell sequences can hang Vim. Here's ...