运行“source .vimrc"时出错; [英] error while running "source .vimrc"
本文介绍了运行“source .vimrc"时出错;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在 ubuntu 中运行source .vimrc"时,我有一个简单的 vimrc 文件,但出现以下错误.
i am having a simple vimrc file when i run "source .vimrc" in ubuntu I am getting the following error.
$ source .vimrc
bash: .vimrc: line 3: syntax error near unexpected token `"syntax"'
bash: .vimrc: line 3: `if has("syntax")'
这是我的脚本文件
set term=builtin_ansi
set nu
if has("syntax")
syntax on
endif
我的 vim 中确实安装了语法.
I do have syntax installed in my vim.
vim --version | grep syntax
vim: /home/shankaran/src/ns/service/build/dp/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/libpython2.7.so.1.0)
vim: /home/shankaran/src/ns/service/build/dp/lib/libssl.so.1.0.0: no version information available (required by /usr/lib/libpython2.7.so.1.0)
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
推荐答案
您尝试从 bash 获取 Vim 配置文件.从 Vim 中实现:
You tried to source your Vim configuration file from bash. Do it from Vim:
$ vim
:source /path/to/.vimrc
如果它位于 ~/.vimrc
,Vim 将自动获取该文件.
If it's located at ~/.vimrc
, Vim will source that file automatically.
这篇关于运行“source .vimrc"时出错;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文