Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
521 views
in Technique[技术] by (71.8m points)

comments - Warning message when sourcing .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

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

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

My working environment is the following.

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

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

EDIT

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$ 
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

type :ver to check:

   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"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...