Eclipse 与 Vim 的无痛集成?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/597117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:38:32  来源:igfitidea点击:

Painless integration of Eclipse with Vim?

eclipsevimplugins

提问by Adnan

Has anyone managed to get Vim integrated into Eclipse painlessly? I just want to use Vim for the editor while retaining the general Eclipse interface. I have tried using Eclim plugin but the editor seemed to crash more often than work (the site said that the editor replacement functionality is still beta).

有没有人设法轻松地将 Vim 集成到 Eclipse 中?我只想在编辑器中使用 Vim,同时保留通用的 Eclipse 界面。我曾尝试使用 Eclim 插件,但编辑器似乎比工作更经常崩溃(该站点表示编辑器替换功能仍处于测试阶段)。

On the flip side, is there any IDE which matches Eclipse's functionality—mainly the integration with SVN, ant, etc.—and is also able to use Vim?

另一方面,是否有任何 IDE 与 Eclipse 的功能相匹配——主要是与 SVN、ant 等的集成——并且还能够使用 Vim?

I mostly use eclipse for SAS SCL, Java and Javascript programming and find the eclipse editor too "mouse-y".

我主要将 Eclipse 用于 SAS SCL、Java 和 Javascript 编程,并且发现 Eclipse 编辑器太“鼠标”了。

I'd also like, in a perfect world, to use vimdiff as a diff viewer for SVN (we use TortoiseSVN) while checking for diffs or conflicts during merge etc. I admit I havent spent a lot of time trying to get these things to work. I feel guilty about spending too much time on potential wild-goose-chases while my other team members are working away at their code, perfectly content with all that Eclipse has to offer.

我还想在一个完美的世界中使用 vimdiff 作为 SVN 的差异查看器(我们使用 TortoiseSVN),同时在合并过程中检查差异或冲突等。我承认我没有花很多时间试图让这些东西工作。当我的其他团队成员正在处理他们的代码时,我对花费太多时间在潜在的疯狂追逐上感到内疚,完全满足于 Eclipse 所提供的一切。

Edit: Just found this while desperately browsing around: Vim plugin. Any experience using this? From the claims on the site, it sounds perfect.

编辑:刚刚在拼命浏览时发现了这个:Vim plugin。有使用这个的经验吗?从网站上的声明来看,这听起来很完美。

采纳答案by Adnan

http://vimplugin.org, which I found over the weekend was the closest I could come to a nice integration. Unfortunately when I opened more than 2 files in my IDE, it made my entire workstation unresponsive. And I didn't even use the "new process" option for the editor.

http://vimplugin.org,我在周末发现它是我最接近良好集成的地方。不幸的是,当我在 IDE 中打开 2 个以上的文件时,它使我的整个工作站无响应。而且我什至没有为编辑器使用“新流程”选项。

So bottom line it does seem that there is no decent integration available yet. Although with some it's close. I'm rooting for vimplugin to stabilize and I'll also some time (when I'm not eating up my employer's time like now) play some more with hte plugin to see if I can make it usable.

所以最重要的是,似乎还没有像样的集成可用。虽然有些接近。我希望 vimplugin 稳定下来,我也会有一段时间(当我没有像现在这样占用雇主的时间时)使用 hte 插件再玩一些,看看我是否可以使它可用。

回答by Krzysztof Kot

I've been using Vrapperfor about 2 months and it works great. It is simple to install, and makes life much easier.

我已经使用Vrapper大约 2 个月了,效果很好。它安装简单,让生活更轻松。

It doesn't integrate Vim with Eclipse, it just emulates Vim's behaviour so you don't need to have Vim installed.

它没有将 Vim 与 Eclipse 集成,它只是模拟 Vim 的行为,因此您不需要安装 Vim。

EDIT:

编辑:

I have been experiencing errors while refactoring methodsin Eclipse (only when Vrapper was installed) so I stopped using it.

我在 Eclipse 中重构方法时遇到错误(仅在安装 Vrapper 时),所以我停止使用它。

Now I'm using ViPlugin(very similar to vrapper). It works great (especially since version 2.0) and I recommend it, but it is not free (but cheap and has a trial version)

现在我正在使用ViPlugin(与 vrapper 非常相似)。它工作得很好(尤其是从 2.0 版开始),我推荐它,但它不是免费的(但便宜且有试用版)

Edit

编辑

As the new post mentioned, if we always use the rename dialog to rename, it can be a work around for Varpper.

正如新帖子所提到的,如果我们总是使用重命名对话框来重命名,那么 Varpper 可以解决这个问题。

Preferences > Java > and uncheck "Rename in editor without dialog"

首选项 > Java > 并取消选中“在没有对话框的编辑器中重命名”

http://sourceforge.net/apps/trac/vrapper/ticket/96

http://sourceforge.net/apps/trac/vrapper/ticket/96

回答by VonC

The consensus seems summarized in that Wanted: VIM in Eclipsearticle.

共识似乎总结在通缉:Eclipse 中的 VIM文章中。

No decent Vi plugin exists for eclipse, except viplugin which does not offer macro mechanisms.

除了不提供宏机制的 viplugin 外,eclipse 不存在像样的 Vi 插件。

vi

六

Whereas on the NetBeans side... jvidoes a killing job ;)

而在NetBeans 方面...... jvi做了一个杀戮工作 ;)

alt text

替代文字

回答by user365076

WOW, this is the one!

哇,就是这个!

http://vrapper.sourceforge.net/home/

http://vrapper.sourceforge.net/home/

It just came out a few months ago, and seems much better than the other alternatives...and it is open source.

它几个月前刚刚发布,看起来比其他替代品要好得多……而且它是开源的。

回答by ldog

I use Viable, which is a new plugin for Eclipse providing Vi emulation. It is very similar to vrapper, but it doesn't have the same problem as vrapper with refactoring (as cysiek10 described.)

我使用Viable,它是 Eclipse 提供 Vi 仿真的新插件。它与 vrapper 非常相似,但它没有与 vrapper 相同的重构问题(如 cysiek10 所述。)

It's got some pretty cool features which none of the other Vim emulators in Eclipse seem to have (though jvi for NetBeans has a few of these) such as:

它有一些非常酷的功能,Eclipse 中的其他 Vim 模拟器似乎都没有(尽管 NetBeans 的 jvi 有一些),例如:

  • Visual block mode
  • External filters and commands
  • Command history
  • Window splits (love having this one!)
  • 视觉块模式
  • 外部过滤器和命令
  • 命令历史
  • 窗户裂开(喜欢这个!)

It is pay; however, you can try the full version for free just like viPlugin.

是报酬;但是,您可以像 viPlugin 一样免费试用完整版。

回答by TerryP

I never had much luck with vim integration into any IDE, be it Eclipse, Visual Studio, NetBeans, or sth else. Instead when stuck using an IDE, I just make the IDE launch a custom program: which passes the file onto vim using the client/server feature.

我在将 vim 集成到任何 IDE(无论是 Eclipse、Visual Studio、NetBeans 还是其他 IDE)方面都没有多少运气。相反,当使用 IDE 卡住时,我只是让 IDE 启动一个自定义程序:它使用客户端/服务器功能将文件传递到 vim。

I.e. vim --servername SomeName --remote-{choice of how to open it: splits or tabs} {extra args like filename and +line#}

即 vim --servername SomeName --remote-{选择如何打开它:拆分或标签} {额外的参数,如文件名和 + 行#}

回答by ArriveW

I just tried Eclim http://eclim.org/and found it really good. I can still edit inside Vim, and enjoy most of the benefits of the eclipse IDE inside Vim (such as better omni completions).

我刚刚尝试了 Eclim http://eclim.org/并发现它非常好。我仍然可以在 Vim 中进行编辑,并享受 Vim 中 eclipse IDE 的大部分好处(例如更好的 omni 完成)。

The best thing about Eclim is we are still using the original Vim, so I can enjoy all the existing benefits (my own functions, macros, etc.) while having the extra convenience provided by an IDE.

Eclim 最好的一点是我们仍然使用原始的 Vim,所以我可以享受所有现有的好处(我自己的函数、宏等),同时拥有 IDE 提供的额外便利。

回答by Andy White

I tried Eclim and didn't like it at all. I ended using this plugin called "viPlugin," which actually works well enough to warrant using it every day. Here is the site for viPlugin:

我尝试了 Eclim,但根本不喜欢它。我最终使用了这个名为“viPlugin”的插件,它实际上运行良好,足以保证每天使用它。这是 viPlugin 的站点:

http://www.viplugin.com

http://www.viplugin.com

The big downside of this plugin is that it's not free. I paid for it, and I think it's worth it.

这个插件的最大缺点是它不是免费的。我付了钱,我认为这是值得的。

回答by sherzodr

Vrapper does the trick.

Vrapper 做到了这一点。

After installing Vrapper you need to remove CTRL+W key binding in Eclipse settings. Or else it keeps closing the editor when you actually meant Backspace.

安装 Vrapper 后,您需要在 Eclipse 设置中删除 CTRL+W 键绑定。否则,当您实际使用 Backspace 时,它​​会一直关闭编辑器。

It also comes with "surround" and split window plugins. Be sure to install those.

它还带有“环绕”和拆分窗口插件。一定要安装那些。

This is not 100% Vim, though. And nothing is 100% Vim except for Vim (doh!). You will find some commands missing (or you may not, depending on how "vimy" you are). But vrapper has :vimcommand, which opens up Vim editor with the current file in the buffer and places your cursor in the exact location in the file. This way you can continue editing from where you left off. When you're done in Vim just close the editor, and you return to your eclipse editor.

不过,这不是 100% Vim。除了 Vim 之外,没有什么是 100% Vim(哦!)。你会发现一些命令丢失(或者你可能没有,这取决于你的“vimy”程度)。但是 vrapper 有:vim命令,它可以打开 Vim 编辑器,其中包含缓冲区中的当前文件,并将光标放在文件中的确切位置。这样您就可以从上次中断的地方继续编辑。在 Vim 中完成后,只需关闭编辑器,然后返回到 eclipse 编辑器。

I hope this was helpful.

我希望这可以帮到你。

回答by OscarRyz

...is there any IDE which matches Eclipse's functionality -- mainly the integration with SVN, ant, etc. -- and is also able to use Vim?

...是否有任何 IDE 与 Eclipse 的功能相匹配——主要是与 SVN、ant 等的集成——并且还能够使用 Vim?

IntelliJ IDEA has a very good VI plugin, but I didn't like it, although the plugin did it's work.

IntelliJ IDEA 有一个非常好的 VI 插件,但我不喜欢它,尽管该插件确实有效。

My problem was I have formed habits to use IDEA and those were harder and my experiment didn't it through. So I uninstall the plugin, and learned idea shortcuts instead.

我的问题是我已经养成了使用 IDEA 的习惯,而那些习惯更难,我的实验没有通过。所以我卸载了插件,而是学习了idea的快捷方式。

But, is not free :(

但是,不是免费的:(