vim / vim

The official Vim repository

Home Page:https://www.vim.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error detected while processing... when startup vim with -u option

heavenshell opened this issue · comments

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

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

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

Thank you