MacVim的vimrc文件识别出现问题 [英] Trouble with vimrc file recognition with MacVim
问题描述
自从升级到OS X 10.7.3后,我很难让MacVim(7.3-64)识别我的.vimrc
和.gvimrc
文件.以前,我只是使用以下命令对.vimrc
和.gvimrc
进行了符号链接:
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
但是,当我当前符号链接我的rc文件时,我无法使MacVim识别它们.我已经通过Homebrew安装了MacVim.有谁对问题可能有什么建议?
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?
推荐答案
保证~/.vim/
文件夹(用于colorchemes和脚本)和~/.vimrc
文件(用于自定义设置和映射)可以在每个类似UNIX的系统上工作.系统,但Vim(和MacVim)正常运行都不需要这些系统.
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.
-
开始时没有符号链接或任何符号:主文件夹中没有
.vim
文件夹,也没有.vimrc
或.gvimrc
. MacVim是否可以工作?您应该会看到一个带有一些介绍性文字的窗口,看到了吗?
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?
退出MacVim并转到要使用的原始.(g)vimrc
文件:它们在哪里?你从哪里得到的?他们的内容是什么?您是否真的需要它们?它们的名称实际上是否以点开头(您是否在Finder中看到它们)?它们的编码是什么(在vim中为:set fileencoding?
,在终端中为$ file /path/to/original/.vimrc
)?请粘贴要在问题中使用的.vimrc
文件的内容.
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.
如果您完全确定需要这些文件才能在Vim中有效运行,并假设您在Mac上确实有自定义的.vimrc
,请打开Terminal.app并键入以下命令(没有$
):
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
复制将您的.vimrc
复制到规范位置.
to copy your .vimrc
to the canonical location.
现在启动MacVim.你看到了什么?您应该看到一个带有一些介绍性文字的窗口,这就是您看到的内容吗?
Now launch MacVim. What do you see? You are supposed to see a window with some introductory text, is that what you see?
如果MacVim在您的~/.vimrc
上无法正常使用,您可能要注释其内容,重新启动MacVim,取消注释几行,依此类推,直到最终发现错误的设置.
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.
这篇关于MacVim的vimrc文件识别出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!