且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MacVim的vimrc文件识别出现问题

更新时间:2023-12-02 16:40:16

保证~/.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.

  1. 开始时没有符号链接或任何符​​号:主文件夹中没有.vim文件夹,也没有.vimrc.gvimrc. MacVim是否可以工作?您应该会看到一个带有一些介绍性文字的窗口,看到了吗?

  1. 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.