简体   繁体   English

采购.vimrc 时出错

[英]Errors while sourcing .vimrc

I am using bash terminal and in my.vimrc I have the following lines:我正在使用 bash 终端,在 my.vimrc 我有以下几行:

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:当我保存并尝试获取 my.vimrc 时,我收到以下错误:

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第二个错误中显示的行号在 my.vimrc 中不存在

Why am I getting these errors?为什么我会收到这些错误? How can I fix them?我该如何修复它们?

TIA TIA

Vinod维诺德

If you are doing source ~/.vimrc from the terminal prompt, then you are getting errors you should expect.如果您在终端提示符下执行source ~/.vimrc ,那么您会收到您应该预料到的错误。 The .vimrc file contains vimscript, which only the vim program understands. .vimrc文件包含 vimscript,只有 vim 程序可以理解。 Bash is giving you errors because it is not supposed to source that file. Bash 给您错误,因为它不应该获取该文件。 When you start vim, normally by just typing vim and hitting enter, vim will automatically source your .vimrc当您启动 vim 时,通常只需键入vim并按 Enter,vim 将自动获取您的.vimrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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