问题描述
我已将此.vimrc 复制粘贴到Fedora 15中的/etc/vimrc中.每次我使用vim做任何事情时,我都会发现许多行号错误,这些错误似乎不是我的vimrc文件的正确行号,因为这些行上没有任何'\'.
I've copy pasted this .vimrc into my /etc/vimrc in Fedora 15. Every time I use vim for anything, I get a number of errors with line numbers which don't seem to be the correct line numbers of my vimrc file because there aren't any '\'s on those lines.
我已经对此进行了搜索,还有一个类似的堆栈溢出问题,但是我认为这与我的问题无关.
I've googled this and there is a similar stack overflow question, but I believe it is irrelevant to my question.
我还删除了所有表示MySys() == linux/max/windows
等的内容,因为我使用的是Linux,所以我只使用了linux行.
I also removed everything that said MySys() == linux/max/windows
or etc because I'm using linux so I just used the linux lines.
有什么想法吗?
编辑---
这是我(很少)修改过的vimrc文件:
Here's my (barely) modified vimrc file:
https://docs.google.com/document/d/1PznK0FizGlBr6W6m9wikM334q8b6KFFCgmsF-f8MX3s/edit?hl = zh_CN
推荐答案
您在此处提到的错误通常发生在以下情况之一:
Error you mentioned here normally happens in one of the following cases:
- 您正在尝试在
:execute
中使用换行符. - 您正在尝试在vim处于兼容模式时使用行连续.
- You are trying to use line continuation inside
:execute
. - You are trying to use line continuation when vim is in compatible mode.
要删除第二种情况,请使用vim -N
运行vim.如果没有错误出现,请在vimrc的顶部添加set nocompatible
.如果仍然出现错误,请搜索exe
(因为:execute
可以被截断为:exe
)并检查是否将匹配\n\s*\\
的行传递给了:execute
.
To remove the second case run vim using vim -N
. If no errors appear, add set nocompatible
at the top of the vimrc. If errors still appear, search for exe
(as :execute
can be truncated to :exe
) and check out whether somewhere line matching \n\s*\\
is passed to :execute
.
这篇关于.vimrc导致错误(E10:\应后跟/、?或&)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!