Error detected while processing... when startup vim with -u option
heavenshell opened this issue · comments
Shinya Ohyanagi commented
I found startup vim with -u option to specify vimrc raised error.
Steps to reproduce
- Add below plugin in to
~/.vim/pack/test/opt/sample/plugin.vim
let s:items = [
\ 'foo',
\ 'bar',
\ ]
function! s:sample() abort
echomsg s:items->join(' ')
endfunction
command! Sample :call s:sample()
- create .vimrc
packadd sample
- start vim with -u option
vim -u ~/.vimrc
- Error raised
s_ohyanagi@a961a4e1ba1d:~$ vim -u .vimrc
Error detected while processing /home/s_ohyanagi/.vimrc[1]../home/s_ohyanagi/.vim/pack/test/opt/sample/plugin/sample.vim:
line 1:
E697: Missing end of List ']':
line 2:
E10: \ should be followed by /, ? or &
line 3:
E10: \ should be followed by /, ? or &
line 4:
E10: \ should be followed by /, ? or &
line 1:
E697: Missing end of List ']':
line 2:
E10: \ should be followed by /, ? or &
line 3:
E10: \ should be followed by /, ? or &
line 4:
E10: \ should be followed by /, ? or &
Press ENTER or type command to continue
- Enter vim and exectute
:Sample
Error detected while processing function <SNR>2_sample:
line 1:
E121: Undefined variable: s:items
- when I start vim without -u option, error not raised and can execute command
Kapture.2024-04-16.0.44.54.mp4
Thank you
Expected behaviour
Startup vim succeed and can execute loaded command
Version of Vim
9.1.330
Environment
OS: Ubuntu 23.10
Terminal: Terminal.app(SSH from macOS)
value of $TERM: xterm-256color
shell: GNU bash, version 5.2.15
Logs and stack traces
No response
Christian Brabandt commented
you are starting Vim in compatible mode. use -N
to start in nocompatible mode.
Shinya Ohyanagi commented
oh... I had forgotten about nocompatible...
Thank you