.vimrc导致错误(E10:\应后跟/、?或&) [英] .vimrc causes error (E10: \ should be followed by /, ? or &)

查看:198
本文介绍了.vimrc导致错误(E10:\应后跟/、?或&)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将此.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:

  1. 您正在尝试在:execute中使用换行符.
  2. 您正在尝试在vim处于兼容模式时使用行连续.
  1. You are trying to use line continuation inside :execute.
  2. 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:\应后跟/、?或&)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆