[vim/vim] Error detected while processing... when startup vim with -u option (Issue #14560)

17 views
Skip to first unread message

Shinya Ohyanagi

unread,
Apr 15, 2024, 11:59:19 AM4/15/24
to vim/vim, Subscribed

I found startup vim with -u option to specify vimrc raised error.

Steps to reproduce

  1. 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()
  1. create .vimrc
packadd sample
  1. start vim with -u option
vim -u ~/.vimrc
  1. 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
  1. Enter vim and exectute :Sample
Error detected while processing function <SNR>2_sample:
line    1:
E121: Undefined variable: s:items
  1. when I start vim without -u option, error not raised and can execute command

https://github.com/vim/vim/assets/56591/68b082a3-01b8-4139-90a0-cc16d1635307

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


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14560@github.com>

Christian Brabandt

unread,
Apr 15, 2024, 12:22:26 PM4/15/24
to vim/vim, Subscribed

you are starting Vim in compatible mode. use -N to start in nocompatible mode.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14560/2057249398@github.com>

Shinya Ohyanagi

unread,
Apr 15, 2024, 9:28:00 PM4/15/24
to vim/vim, Subscribed

Closed #14560 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/14560/issue_event/12480179391@github.com>

Shinya Ohyanagi

unread,
Apr 15, 2024, 9:28:06 PM4/15/24
to vim/vim, Subscribed

oh... I had forgotten about nocompatible...

Thank you


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/14560/2058072922@github.com>

Reply all
Reply to author
Forward
0 new messages