vimrc: support vim-tiny and older versions of vim
authorMichael Prokop <mika@grml.org>
Wed, 27 May 2020 11:41:13 +0000 (13:41 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 28 May 2020 12:25:08 +0000 (14:25 +0200)
commit94d6068324284c8c75bc6774ab73bfa29cb94374
tree784c6a3b919fb3a22d5610687baa9d39878e8cf5
parent91376e3f72889f1c0827af339e7981b9a89d9aed
vimrc: support vim-tiny and older versions of vim

If vim-tiny is present (lacking +eval feature, see `vim --version`),
then invoking vim fails with:

| Error detected while processing /usr/share/vim/vimrc:
| line   30:
| E319: Sorry, the command is not available in this version: let g:skip_defaults_vim=1

The file /usr/share/vim/vimrc is a symlink to /etc/vim/vimrc:

| % ls -la /usr/share/vim/vimrc
| lrwxrwxrwx 1 root root 14 May 12 02:37 /usr/share/vim/vimrc -> /etc/vim/vimrc

So if the eval feature is missing, don't set skip_defaults_vim=1.

Furthermore, on older vim versions we're failing with:

| Error detected while processing /code/etc/vim/vimrc:
| line   61:
| E474: Invalid argument: display=truncate
| line  201:
| E474: Invalid argument: listchars=eol:$,precedes:«,extends:»,tab:»·,trail:·

The "set display=truncate" only works as of patch-7.4.2115 or newer,
see upstream vim.git commit b9a46fec3e79.

The listchars setting only works when running in utf-8 mode,
by default vim-tiny is running in latin1 though.

Closes: grml/grml-etc-core#99
etc/vim/vimrc