[英]error in .vimrc file
e
n " Automatically detect file types.
set nocompatible " We don't want vi compatibility.
" Add recently accessed projects menu (project plugin)
set viminfo^=!
" Minibuffer Explorer Settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" alt+n or alt+p to navigate between entries in QuickFix
map <silent> <m-p> :cp <cr>
map <silent> <m-n> :cn <cr>
" Change which file opens after executing :Rails command
let g:rails_default_file='config/database.yml'
syntax enable
and here's the error I got: 这是我得到的错误:
Espresso:ruby PowerBook$ vim .vimrc
".vimrc" [New File]
Error detected while processing /Users/PowerBook/.vimrc:
line 2:
E163: There is only one file to edit
Press ENTER or type command to continue
I'm new to vi.Could anyone give me a reference of all this syntaxes mean? 我是vi的新手,有人可以给我所有这些语法的参考吗? It's so overwhelming for me right now.
现在对我来说太压倒了。
it's the n
character, which is a command to go to next file. 这是
n
字符,这是转到下一个文件的命令。 Also e
does not make much sense in .vimrc
as it just reloads the file you just loaded... 另外
e
在.vimrc
中没有多大意义,因为它只是重新加载您刚刚加载的文件...
The syntax of the .vimrc
is just normal vim commands - you can think of it as you'd enter the file by hand, adding :
to the beginning of every line. .vimrc
的语法只是普通的vim命令-您可以在手动输入文件时想到它,在每行的开头添加:
。
You probably want your config file to look like: 您可能希望您的配置文件如下所示:
" Automatically detect file types.
set nocompatible " We don't want vi compatibility.
" Add recently accessed projects menu (project plugin)
set viminfo^=!
" Minibuffer Explorer Settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" alt+n or alt+p to navigate between entries in QuickFix
map <silent> <m-p> :cp <cr>
map <silent> <m-n> :cn <cr>
" Change which file opens after executing :Rails command
let g:rails_default_file='config/database.yml'
syntax enable
This old question and it's top rated answers are probably the most mindblowing reference to vim. 这个古老的问题及其最受好评的答案可能是对vim最令人兴奋的参考。 I suggest also reading some vim tutorials
我建议还阅读一些vim教程
In your case the problem is in the 1st and 2nd line. 在您的情况下,问题出在第一行和第二行。
e
n " Automatically detect file types.
These e
and n
are Vi(m) (ex) commands on the start of the lines (but in .vimrc
they don't need the :
prefix. 这些
e
和n
是行首的Vi(m)(ex)命令(但在.vimrc
它们不需要:
前缀。
See their documentation at http://www.polarhome.com/vim/manual/v72/editing.html#:edit_f and http://www.polarhome.com/vim/manual/v72/editing.html#:next . 请参阅其文档, 网址为http://www.polarhome.com/vim/manual/v72/editing.html#:edit_f和http://www.polarhome.com/vim/manual/v72/editing.html#:next 。
So they mean e
edit file but there is no argument, so it's probably an error (usually most of the people doesn't specify e
command(s) in their .vimrc
因此,它们的意思是
e
编辑文件,但没有参数,因此可能是一个错误(通常大多数人未在.vimrc
指定e
命令
n
means next (buffer), but as far as You does not specify more files on the commandline to start vim
, it can't work, as there are no more buffers. n
表示下一个(缓冲区),但是由于您没有在命令行上指定更多文件来启动vim
,所以它无法工作,因为没有更多的缓冲区。
IMHO you should delete those commands from your .vimrc
. 恕我直言,您应该从
.vimrc
删除这些命令。
HTH 高温超导
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.