为什么不执行.vimrc?

问题描述:

当我尝试使用. .vimrc它给错:为什么不执行.vimrc?

bash: runtime! command not found 
bash: syntax: command not found 
bash: filetype: command not found 
bash: filetype: command not found 

它只是随机无缘无故拦工作,所有其他点文件似乎很好地工作。该.vimrc包含此:

runtime! archlinux.vim 
set number 
set noswapfile 
set nobackup 
syntax on 
set autoindent 
set smartindent 
set smarttab 
filetype plugin on 
filetype indent on 
set incsearch 
set hlsearch 

它也给一个评论里面的错误,当它在那里。

+2

你是否试图执行'.vimrc'文件? – alex

.(或source)命令是一个bash命令,它在当前shell实例的上下文中读取一个文件(该文件应该是有效的bash脚本)。

.vimrc文件一个bash脚本,它的东西是阅读和vim而不是bash处理。

尝试使用Pascal编译器编译C代码没有什么不同。该文件内容不适合您尝试使用它的内容。 .vimrc文件应在下次运行vim实例时自动拾取。

+0

噢好吧谢谢你,我一直以为你需要使用'source'来启动这东西左右 – visu

~/.vimrcvim的运行时配置文件,即该文件在启动时将被vim读取,并且所有语句都是vim特定的。

当你试图在sourcebash文件,你所得到的错误,bash不知道像runtimevim具体陈述,syntax

+0

当我源〜/ .vimrc我得到这个错误。我在'〜/ .vimrc'的开头有''语法',并且我得到了'bash:syntax:command not found ...' –