简体   繁体   English

OSX / Yosemite上的MacVim:根本看不到编辑器窗口

[英]MacVim on OSX / Yosemite: no editor windows visible at all

Installed MacVim on my Yosemite 10.10.2 Macbook Pro today from http://www.macupdate.com/app/mac/25988/macvim 今天在我的Yosemite 10.10.2 Macbook Pro上安装了MacVim,来自http://www.macupdate.com/app/mac/25988/macvim

The problem is that no editor window(s) are visible. 问题是没有可见的编辑器窗口。 If I open a file using the menu, there's simply no effect: no editor window appears. 如果我使用菜单打开文件,则根本没有效果:不显示编辑器窗口。 It's not hidden behind other windows, it's not listed in the Windows menu, it's just entirely undisplayed. 它没有隐藏在其他窗口后面,它没有在Windows菜单中列出,它只是完全没有显示。

Strangely, the file will appear in the MRU list, though. 奇怪的是,该文件将出现在MRU列表中。 So this renders the entire editor completely useless. 所以这使得整个编辑器完全没用。 Should I just build gvim myself? 我应该自己构建gvim吗? Is this app actually being maintained by anyone? 这个应用程序是否真的由任何人维护?

I'd read some answers which suggest running: 我读了一些建议运行的答案:

brew install macvim

... does the trick. ......诀窍。

You might want to try that first. 您可能想先尝试一下。

What worked for me... 什么对我有用......

However, this didn't work for me because although it updated my macvim, the one being linked to in the /Applications folder was not the version being updated by brew . 但是,这对我不起作用,因为虽然它更新了我的macvim,但是在/ Applications文件夹中链接的那个不是brew正在更新的版本。

So, here are the steps I had to take. 所以,这是我必须采取的步骤。

  1. Quit MacVim if open. 如果打开则退出MacVim。
  2. Delete the MacVim file in /Applications. 删除/ Applications中的MacVim文件。
  3. In the terminal, run: 在终端中,运行:

     brew install macvim --override-system-vim 
  4. Run (this will add the link to your Applications file): 运行(这将添加指向您的Applications文件的链接):

     brew linkapps macvim 

I can't be sure every step above is required, or that the --override-system-vim flag is required, but I can tell you that doing the above steps worked for me. 我无法确定上面的每一步都是必需的,或者需要--override-system-vim标志,但我可以告诉你,执行上述步骤对我--override-system-vim

Hope this helps. 希望这可以帮助。

It looks like MacVim development has been moved to a new repository (and maybe a different group of developers?): 看起来MacVim开发已经转移到一个新的存储库(也许是一组不同的开发人员?):

https://github.com/macvim-dev/macvim https://github.com/macvim-dev/macvim

This repo has had changes applied to fix MacVim's graphical problems under Yosemite. 此回购已应用更改以修复Yosemite下的MacVim图形问题。 (This is the same location that brew's macvim formula currently pulls its source from, which is why MacVim works on Yosemite when installed via brew.) (这与brew的macvim公式目前从其源头获取的位置相同,这就是为什么MacVim在通过brew安装时在Yosemite上工作的原因。)

They also have a set of precompiled binary releases: 它们还有一组预编译的二进制版本:

https://github.com/macvim-dev/macvim/releases https://github.com/macvim-dev/macvim/releases

The latest (" snapshot 76 ") has worked fine for me in Yosemite so far. 到目前为止,最新的(“ 快照76 ”)在优胜美地对我来说很好。 You just need to download the .tbz archive, double-click it to unpack to a folder, then drag the MacVim.app icon to Applications -- much easier and less invasive than installing a whole package management system and build environment! 您只需要下载.tbz存档,双击它以解压缩到一个文件夹,然后将MacVim.app图标拖到应用程序 - 比安装整个软件包管理系统和构建环境更容易,更少侵入! :) :)

Note: I had to execute a command given in another StackOverflow answer to correct a rendering glitch seen in full screen mode for snapshot 76: 注意:我必须执行另一个StackOverflow应答中给出的命令,以纠正在全屏模式下为快照76看到的渲染故障:

$ defaults write org.vim.MacVim MMNativeFullScreen 0

I got the same problem today. 我今天遇到了同样的问题。

The solution: 解决方案:

mv ~/.vimrc ~/.vimrc_bak

It looks like there is something wrong with my .vimrc file. 看起来我的.vimrc文件有问题。

I was having the same issue, and one of the answers in here helped me, but not for the reason explained so I thought this might be useful for others. 我遇到了同样的问题,其中一个答案对我有帮助,但不是因为解释的原因所以我认为这可能对其他人有用。

Some plugins might depend on the version of vim, and may work in version 7 but not in version 8, when you install MacVim this could be version 8, and the terminal vim version might be 7, both will use the same .vim folder and .vimrc to load the plugins and configuration, when you open the vim from terminal it might still work because the plugins were depending on vim version 7, but when you try to execute MacVim it will try to load the plugins using version 8 and then it will crash, the reason some of the answers worked it's because they are replacing the system vim, therefore MacVim and vim will be in the same major version, if you have upgraded from the previous version the best you can do it's to clear up the plugins folder and then load MacVim or vim and check that everything is working, then start applying the plugins one by one checking that they are not breaking vim. 有些插件可能依赖于vim的版本,可能在版本7中有效,但在版本8中无法工作,当你安装MacVim时,这可能是版本8,终端vim版本可能是7,两者都将使用相同的.vim文件夹和.vimrc加载插件和配置,当你从终端打开vim它可能仍然有效,因为插件依赖于vim版本7,但是当你尝试执行MacVim时它会尝试使用版本8加载插件然后它会崩溃,部分答案之所以有效,是因为他们正在更换系统vim,因此MacVim和vim将处于相同的主要版本,如果你从之前的版本升级了最好你可以做到这一点来清理插件文件夹然后加载MacVim或vim并检查一切是否正常,然后开始逐个应用插件检查它们是否正在破坏vim。 At least with this method I found that one of the plugins was not working as expected and removing it solved the "MacVim" issue. 至少使用这种方法,我发现其中一个插件没有按预期工作,并且删除它解决了“MacVim”问题。

In summary: - move your .vim as .vim_bak - move your .vimrc as .vimrc_bak (suggested by @hai feng kao) 总结: - 将.vim移动为.vim_bak - 将.vimrc移动为.vimrc_bak(由@hai feng kao建议)

And test if this solves the issue, if that's the case then a plugin is breaking your installation and you will need to activate some and figure out which is the one that causes the issue. 并测试这是否解决了问题,如果是这种情况,那么插件正在破坏您的安装,您将需要激活一些并找出导致问题的那个。

Hope this helps to others, I've followed a lot of these recommendations without success until I decided to upgrade vim (terminal) and this started to break as well, that pointed me in the right direction. 希望这有助于其他人,我已经遵循了很多这些建议而没有成功,直到我决定升级vim(终端)并且这也开始打破,这指向了我正确的方向。

Again hope this saves some hours for some. 再次希望这可以节省一些时间。

I had the same symptom with MacVim launching with no window and command-N doesn't start any a new one. 我有相同的症状,MacVim启动没有窗口和命令 - N没有启动任何新的。 brew re-install didn't help. brew重新安装没有帮助。

It turned out there was another instance of macvim installed on my system somehow, in the Downloads folder. 事实证明,在我的系统上安装了另一个macvim实例,在Downloads文件夹中。 I found out by clicking "MacVim" --> "About MacVim" and it was a version from 2014. I found the instance and deleted it. 我通过点击“MacVim” - >“关于MacVim”找到了它,它是2014年的版本。我找到了实例并删除了它。

I created an alias for the newly installed version and copied that into Applications folder so spotlight search can find the new one. 我为新安装的版本创建了一个别名,并将其复制到Applications文件夹中,以便聚光灯搜索可以找到新版本。 That solved my problem. 这解决了我的问题。

I had this problem upon updating from MacOS 10.12.5 to 10.12.6. 从MacOS 10.12.5更新到10.12.6时出现此问题。

I uninstalled MacVim by moving it to the trashcan and downloading it again. 我通过将MacVim移动到垃圾桶并再次下载来卸载MacVim。

I would guess that the new version fixed whatever issue it had with the new operating system. 我猜想新版本修复了新操作系统的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM