采购 .vimrc 时的警告消息 [英] Warning message when sourcing .vimrc

查看:38
本文介绍了采购 .vimrc 时的警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的主目录中设置一个 .vimrc 文件.它包含的唯一内容如下.

I am trying to set up a .vimrc file in my home directory. The only thing it contains is the following.

" Enable syntax highlighting
syntax on

每当我想获取运行 的文件时.~/.vimrc 返回这条信息.

Whenever I want to source the file running . ~/.vimrc this message is returned.

/Users/username/.vimrc:3: unmatched "

我的工作环境如下.

  • MacOS Lion 10.7.2
  • zsh 4.3.12 (i386-apple-darwin11.2.0)
  • oh_my_zsh
  • 终端 2.2.1
  • VIM 7.3

我怎样才能摆脱这个警告/错误消息.什么意思?!

How can I get rid of this warning/error message. What does it mean?!

编辑

当我从 bash 尝试同样的方法时,它也不起作用.

When I try the same from bash it does not work either.

bash-3.2$ . ~/.vimrc 
bash: /Users/username/.vimrc: line 1: unexpected EOF while looking for matching `"'
bash: /Users/username/.vimrc: line 3: syntax error: unexpected end of file
bash-3.2$ 

推荐答案

您可以运行 .~/.bashrc 在控制台
但是你应该在 vim 中运行 :source ~/.vimrc
vim 会自动运行 ~/.vimrc,你不需要手动运行.

you can run . ~/.bashrc in console
but you should run :source ~/.vimrc in vim
vim will run ~/.vimrc automatically, you don't need run it manually.

输入 :ver 进行检查:

   system vimrc file: "$VIMvimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIMgvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIMEmenu.vim"

这篇关于采购 .vimrc 时的警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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