简体   繁体   中英

Errors while sourcing .vimrc

I am using bash terminal and in my.vimrc I have the following lines:

set number
"set tags+=/users/vinod/ctags_related/tags
imap 2s <SPACE><SPACE>

When I save and then try to source my.vimrc, I get the following errors:

bash: /users/vinod/.vimrc: line 2: unexpected EOF while looking for matching `"'
bash: /users/vinod/.vimrc: line 4: syntax error: unexpected end of file

The line number shown in the second error doesn't exist in my.vimrc

Why am I getting these errors? How can I fix them?

TIA

Vinod

If you are doing source ~/.vimrc from the terminal prompt, then you are getting errors you should expect. The .vimrc file contains vimscript, which only the vim program understands. Bash is giving you errors because it is not supposed to source that file. When you start vim, normally by just typing vim and hitting enter, vim will automatically source your .vimrc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM