junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.7k stars 1.9k forks source link

error message on opening .vimrc #1262

Closed EricEWeir closed 5 months ago

EricEWeir commented 5 months ago

Explain the problem here ...

When I open my .vimrc in macOS textedit I get the following error message (vim-plug works fine):

/Users/ericweir/.vimrc: line 1: syntax error near unexpected token `('
/Users/ericweir/.vimrc: line 1: `call plug#begin('~/.vim/plugged')'

call plug#begin('~/.vim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-session'
Plug 'lervag/wiki.vim'
Plug 'lervag/lists.vim'
Plug 'dahu/vim-help'
Plug 'dahu/learnvim'
Plug 'masukomi/vim-markdown-folding'
Plug 'preservim/vim-markdown'
Plug 'davidoc/taskpaper.vim'
Plug 'mattn/calendar.vim'
Plug 'tyru/capture.vim'
Plug 'preservim/nerdtree'
call plug#end()
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan  4 2024 03:08:50)
macOS version - arm64
Compiled by GitHub Actions
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl                -ebcdic             +localmap           +printer            +textprop
+arabic             +emacs_tags         +lua/dyn            +profile            +timers
+autocmd            +eval               +menu               +python/dyn         +title
+autochdir          +ex_extra           +mksession          +python3/dyn-stable +toolbar
-autoservername     +extra_search       +modify_fname       +quickfix           +transparency
+balloon_eval       -farsi              +mouse              +reltime            +user_commands
+balloon_eval_term  +file_in_path       +mouseshape         +rightleft          +vartabs
+browse             +find_in_path       +mouse_dec          +ruby/dyn           +vertsplit
++builtin_terms     +float              -mouse_gpm          +scrollbind         +vim9script
+byte_offset        +folding            -mouse_jsbterm      +signs              +viminfo
+channel            -footer             +mouse_netterm      +smartindent        +virtualedit
+cindent            +fork()             +mouse_sgr          +sodium             +visual
+clientserver       +fullscreen         -mouse_sysmouse     +sound              +visualextra
+clipboard          +gettext            +mouse_urxvt        +spell              +vreplace
+cmdline_compl      -hangul_input       +mouse_xterm        +startuptime        +wildignore
+cmdline_hist       +iconv              +multi_byte         +statusline         +wildmenu
+cmdline_info       +insert_expand      +multi_lang         -sun_workshop       +windows
+comments           +ipv6               -mzscheme           +syntax             +writebackup
+conceal            +job                +netbeans_intg      +tag_binary         -X11
+cryptv             +jumplist           +num64              -tag_old_static     -xattr
+cscope             +keymap             +odbeditor          -tag_any_white      -xfontset
+cursorbind         +lambda             +packages           -tcl                +xim
+cursorshape        +langmap            +path_extra         +termguicolors      -xpm
+dialog_con_gui     +libcall            +perl/dyn           +terminal           -xsmp
+diff               +linebreak          +persistent_undo    +terminfo           -xterm_clipboard
+digraphs           +lispindent         +popupwin           +termresponse       -xterm_save
+dnd                +listcmds           +postscript         +textobjects
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe
 -DMACOS_X -DMACOS_X_DARWIN -g -O3 -flto -arch x86_64 -arch arm64 -I/usr/local/Cellar/libsodium/1.0.
19/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Wstrict-protot
ypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations -Wno-error=missing-field-initializers
 -Wno-error=deprecated-declarations -Wno-error=unused-function
Linking: clang -arch x86_64 -arch arm64 -L/usr/local/lib -flto -o Vim -lm -lncurses /usr/local/lib/l
ibsodium.a -liconv /usr/local/lib/libintl.a -framework AppKit
junegunn commented 5 months ago

syntax error near unexpected token is an error message from bash, not from Vim. For some reason, your bash shell is "source"ing the .vimrc file, which is obviously a misconfiguration.