[lfs-dev] Configuring vim and position of defaults.vim

Ken Moffat zarniwhoop at ntlworld.com
Mon Mar 12 08:57:13 PDT 2018

TL;DR - I think 'let skip_defaults_vim=1' should come BEFORE
'source $VIMRUNTIME/defaults.vim' in /etc/vimrc.

Some weeks ago I complained about the change in vim's behaviour
(dropping back to previous position in a file), which turned out to
be caused by the inclusion of defaults.vim.

I thought I had a workaround, but in the end it didn't work so I
thought I would have to get used to it.  Meanwhile, I think it was
Thomas who said he liked this behaviour.

After much grumbling in my own file edits, today I rearranged some
explanatorr text in a BLFS xml file (break a command explanation by
inserting a newline) - the new line was severely indented, so I
started to backspace, and then near the beginning of the line the
backspace suddenly skipped back 8 spaces, i.e. it seemed to have
inserted a tab there.

So, I tried skipping the defaults in my own ~/.vimrc, and logging
out.  In the end I concluded that had not helped.  Searching around,
I eventually came upon

The last comment, from 'user brammool' seemed relevant (to a
question: If I like the defaults, but don't want them to overwrite
my system settings, the workaround is to source defaults.vim in the
system vimrc file, add the (few) settings I need and end with setting
"skip_defaults_vim"?) -

 Loading defaults.vim first does not allow for disabling that, that's
 a catch 22.

So, I tried changing my own /etc/vimrc to start:
" Begin /etc/vimrc
let skip_defaults_vim=1
source $VIMRUNTIME/defaults.vim

set nocompatible

And that now seems to have restored the old behaviour, both when
editing that command explanation, and when making my own local git

Truth, in front of her huge walk-in wardrobe, selected black leather
boots with stiletto heels for such a barefaced truth.
                                     - Unseen Academicals

More information about the lfs-dev mailing list