[英]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
这是我得到的错误:
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
我是vi的新手,有人可以给我所有这些语法的参考吗? 现在对我来说太压倒了。
这是n
字符,这是转到下一个文件的命令。 另外e
在.vimrc
中没有多大意义,因为它只是重新加载您刚刚加载的文件...
.vimrc
的语法只是普通的vim命令-您可以在手动输入文件时想到它,在每行的开头添加:
。
您可能希望您的配置文件如下所示:
" 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
在您的情况下,问题出在第一行和第二行。
e
n " Automatically detect file types.
这些e
和n
是行首的Vi(m)(ex)命令(但在.vimrc
它们不需要:
前缀。
请参阅其文档, 网址为http://www.polarhome.com/vim/manual/v72/editing.html#:edit_f和http://www.polarhome.com/vim/manual/v72/editing.html#:next 。
因此,它们的意思是e
编辑文件,但没有参数,因此可能是一个错误(通常大多数人未在.vimrc
指定e
命令
n
表示下一个(缓冲区),但是由于您没有在命令行上指定更多文件来启动vim
,所以它无法工作,因为没有更多的缓冲区。
恕我直言,您应该从.vimrc
删除这些命令。
高温超导
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.