Skip to content

Commit

Permalink
vimrc: don't fail with skip_defaults_vim setting if eval feature is m…
Browse files Browse the repository at this point in the history
…issing

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 /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

Closes: #99
  • Loading branch information
mika committed May 27, 2020
1 parent 6aef288 commit 3703c80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion etc/vim/vimrc
Expand Up @@ -27,7 +27,11 @@ runtime! debian.vim
" | Do *not* source $VIMRUNTIME/defaults.vim (in case no user vimrc is found),
" | since that prevents overwriting values we want to set in this file,
" | instead we set settings similar to what can be found in default.vim below
let g:skip_defaults_vim=1
" |
" | Only do this part when Vim was compiled with the +eval feature.
if 1
let g:skip_defaults_vim=1
endif

" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
Expand Down

2 comments on commit 3703c80

@jkirk
Copy link
Contributor

@jkirk jkirk commented on 3703c80 May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just quickly tested with vim.tiny in my Debian/jessie docker:

root@c17833b790fb:/# cat /etc/debian_version 
8.11

root@c17833b790fb:/# dpkg -l | grep vim
ii  vim-common                2:7.4.488-7+deb8u4       amd64        Vi IMproved - Common files
ii  vim-tiny                  2:7.4.488-7+deb8u4       amd64        Vi IMproved - enhanced vi editor - compact version

root@c17833b790fb:/# vim.tiny /etc/vim/vimrc
Error detected while processing /usr/share/vim/vimrc:
line   61:
E474: Invalid argument: display=truncate
line  201:
E474: Invalid argument: listchars=eol:$,precedes:«,extends:»,tab:»·,trail:·
Press ENTER or type command to continue

(No vim-only binary was provided. Is there an update-alternative trick or so?)

I am not sure if we can expect our configuration to work with vim.tiny.

@jkirk
Copy link
Contributor

@jkirk jkirk commented on 3703c80 May 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here the output of my Debian/bullseye docker:

root@bf2ae5e25dda:/# dpkg -l |grep vim
ii  vim-common              2:8.2.0716-3        all          Vi IMproved - Common files
ii  vim-tiny                2:8.2.0716-3        amd64        Vi IMproved - enhanced vi editor - compact version

root@bf2ae5e25dda:/# vim.tiny /etc/vim/vimrc
Error detected while processing /usr/share/vim/vimrc:
line  201:
E474: Invalid argument: listchars=eol:$,precedes:«,extends:»,tab:»·,trail:·
Press ENTER or type command to continue

Maybe we need to skip everything with vim-tiny?

Please sign in to comment.