繁体   English   中英

.vimrc文件中的错误

[英]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

这个古老的问题及其最受好评的答案可能是对vim最令人兴奋的参考。 我建议还阅读一些vim教程

在您的情况下,问题出在第一行和第二行。

e
n  " Automatically detect file types.

这些en是行首的Vi(m)(ex)命令(但在.vimrc它们不需要:前缀。

请参阅其文档, 网址http://www.polarhome.com/vim/manual/v72/editing.html#:edit_fhttp://www.polarhome.com/vim/manual/v72/editing.html#:next

因此,它们的意思是e编辑文件,但没有参数,因此可能是一个错误(通常大多数人未在.vimrc指定e命令

n表示下一个(缓冲区),但是由于您没有在命令行上指定更多文件来启动vim ,所以它无法工作,因为没有更多的缓冲区。

恕我直言,您应该从.vimrc删除这些命令。

高温超导

暂无
暂无

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

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