macvimrc位置_MacVim的vimrc文件识别出现问题

I'm having difficulty getting MacVim (7.3-64) to recognize my .vimrc and .gvimrc files since upgrading to OS X 10.7.3. Previous, I've simply symlinked my .vimrc and .gvimrc using these commmands:

$ ln -s ~/.vim/vimrc /usr/local/Cellar/macvim/7.3-57/MacVim.app/Contents/Resources/vim/.vimrc

$ ln -s ~/.vim/gvimrc /usr/local/Cellar/macvim/7.3-57/MacVim.app/Contents/Resources/vim/.gvimrc

However, when I currently symlink my rc files, I can not get MacVim to recognize them. I've installed MacVim via Homebrew. Does anyone have any suggests as to what the problem could be?

解决方案

The ~/.vim/ folder (for colorschemes and scripts) and the ~/.vimrc file (for custom settings and mappings) are guaranteed to work on every UNIX-like systems but neither of these are required for Vim (and MacVim) to work properly.

Start without symlinks or whatever : no .vim folder and no .vimrc or .gvimrc in your home folder. Does MacVim work? You are supposed to see a window with some introductory text, do you see that?

Quit MacVim and turn to the original .(g)vimrc files you want to use: where are they located? Where did you get them from? What is their content? Do you actually, really need them? Do their names actually start with a dot (do you see them or not in the Finder)? What is their encoding (in vim, :set fileencoding? and in the terminal, $ file /path/to/original/.vimrc)? Please, paste the content of the .vimrc file you want to use in your question.

If you are absolutely certain you need these files to work efficiently in Vim and assuming you actually have a custom .vimrc somewhere on your Mac, open Terminal.app and type this command (without the $):

$ cp /path/to/original/.vimrc ~/.vimrc

to copy your .vimrc to the canonical location.

Now launch MacVim. What do you see? You are supposed to see a window with some introductory text, is that what you see?

If MacVim doesn't work correctly with your ~/.vimrc you might want to comment its content, relaunch MacVim, uncomment a few lines and so on until you eventually find a bad setting.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值