eclipse 开发人员是否真的使用 vim 在 Windows 操作系统上编写代码(Java)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3827876/
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
Do developers actually use vim to write code (Java) on a Windows OS?
提问by Manius
...or is vi/vim only used when developing on a non-Windows OS?
...还是 vi/vim 仅在非 Windows 操作系统上开发时使用?
If not, what feature(s) does vim provide that modern IDEs such as Eclipse do not? Why would one elect to use vim over Eclipse (or IntelliJ, Websphere, or other feature-rich IDEs) when developing on a Windows workstation? Note that I'm referring to Java development and to some degree compiled languages, not shell scripting or other forms of scripting.
如果没有,vim 提供了哪些现代 IDE(例如 Eclipse)没有的特性?在 Windows 工作站上进行开发时,为什么会选择使用 vim 而不是 Eclipse(或 IntelliJ、Websphere 或其他功能丰富的 IDE)?请注意,我指的是 Java 开发和某种程度的编译语言,而不是 shell 脚本或其他形式的脚本。
回答by amphetamachine
Java is a ridiculously complicated language and I can't think of a single person who has memorized all the method parameters and return types of even the builtin classes in the JDK. Being that Java is self-documenting via JavaDoc comments and turning those into manual pages to be paged through seems pointless when you have an IDE like Eclipse that will call up the specific documentation for a particular method or class.
Java 是一种极其复杂的语言,我想不出有一个人能记住 JDK 中甚至内置类的所有方法参数和返回类型。由于 Java 是通过 JavaDoc 注释进行自我记录并将其转换为要翻阅的手册页,因此当您拥有像 Eclipse 这样的 IDE 会调用特定方法或类的特定文档时,这似乎毫无意义。
In short, when you're using (g)Vim, unless you're using some heavy extensions, you're flying blind most of the time and have most of the logic figured out in your head (or, you're using screen(1)
and have the man page opened on the other terminal).
简而言之,当您使用 (g)Vim 时,除非您使用一些繁重的扩展,否则大部分时间您都是盲目的,并且脑子里已经想通了大部分逻辑(或者,您正在使用screen(1)
和在另一个终端上打开手册页)。
I'm a big fan of Vim, but for larger, more library-heavy languages like Java, I wouldn't use anything other than Eclipse. A friend of mine once conjectured that Java development was nearly impossible without an intelligent IDE and I agree.
我是 Vim 的忠实粉丝,但对于像 Java 这样的更大、更依赖库的语言,我不会使用除 Eclipse 之外的任何其他语言。我的一个朋友曾经推测,如果没有智能 IDE,Java 开发几乎是不可能的,我同意。
回答by SyntaxT3rr0r
When you are used to a powerful "text editor", be it vim or Emacs (no flamewars here), it can be at time verydifficult to use a "lesser" text editor, like the ones provided by default by the various IDEs.
当你习惯了一个强大的“文本编辑器”,无论是一次Vim或者Emacs的(在这里没有论战),它可以在时间非常难用一个“更小”的文本编辑器一样,通过各种IDE默认提供的那些。
What I do is simple: sometimes I doneed to do things in my .javasource file that are simply done fastly under Emacs. So what do I do? I switch from my IDE to Emacs (it's one shortcut away, on another virtual desktop), do my stuff, and switch back to IntelliJ IDEA (my Java IDE of choice).
我所做的很简单:有时我确实需要在我的.java源文件中做一些在 Emacs 下快速完成的事情。那我该怎么办?我从我的 IDE 切换到 Emacs(这是一个快捷方式,在另一个虚拟桌面上),做我的事情,然后切换回 IntelliJ IDEA(我选择的 Java IDE)。
Problem is, as amphetachinepointed out: using onlyvim or Emacs to do Java development feels like living in the stone age.
问题是,正如安非他命所指出的:只使用vim 或 Emacs 进行 Java 开发感觉就像生活在石器时代。
In the best of both world the "text editor" at the center of my IDE would be Emacs (or vim) and yet feature all the shiny real-time errors/warning, code-completion, code traversal and whatnots that good Java IDEs have.
在两全其美的情况下,位于我的 IDE 中心的“文本编辑器”将是 Emacs(或 vim),并且具有优秀的 Java IDE 具有的所有闪亮的实时错误/警告、代码完成、代码遍历和诸如此类的功能.
P.S: here's a +7 upvote, +4 favorites question I asked as to how to always sync .java(or other files for that matter) between Emacs and IntelliJ IDEA:
PS:这是我问的关于如何在 Emacs 和 IntelliJ IDEA 之间始终同步.java(或与此相关的其他文件)的 +7 赞成、+4 收藏的问题:
Emacs: Often switching between Emacs and my IDE's editor, how to automatically 'synch' the files?
回答by Chris Dennett
vim allows remote, thin-client access over Telnet or SSH, whereas Eclipse cannot. The most you can do is remote desktop, which can be inconvenient and slow. Also, vim has been developed for many, many years and some people are quite used to the environment. vim is also blazing fast, and allows dominance over the code through a multitude of key commands, if you are an expert :)
vim 允许通过 Telnet 或 SSH 进行远程瘦客户端访问,而 Eclipse 则不能。您最多可以做的是远程桌面,这可能既不方便又慢。另外,vim已经开发了很多很多年,有些人已经很习惯这个环境了。vim 也非常快,如果您是专家,它允许通过大量关键命令来控制代码:)
It is possible to use the features of Eclipse through vim (see Eclim -- http://eclim.org/) but this is still in development and can be unstable or hard to set up.
可以通过 vim 使用 Eclipse 的功能(请参阅 Eclim -- http://eclim.org/),但它仍在开发中并且可能不稳定或难以设置。
What you get from Eclipse is a very fast UI if you are using it locally, with lots of powerful refactoring tools. However, some people like the simple route :)
如果您在本地使用它,那么您从 Eclipse 获得的是一个非常快速的 UI,并带有许多强大的重构工具。但是,有些人喜欢简单的路线:)
回答by Denis Tulskiy
See answer to thisquestion:
请参阅此问题的答案:
Despite Vim's multitude of plugins, nothing comes close to the language-aware refactoring and coding capabilities of the modern IDE.
尽管 Vim 有众多插件,但现代 IDE 的语言感知重构和编码能力却是无可匹敌。
When you work with large projects, powerful editor is never enough. You need to be able to navigate through hundreds of classes, find all usages, overrides and stuff. You need to be able to refactor your code easily. IntelliJ IDEA and Netbeans have plenty of functionality and shortcuts that are specifically targeted at java development. Vim is a great tool, but java is better suited for IDEs, and you should use this to your advantage.
当您处理大型项目时,强大的编辑器是远远不够的。您需要能够浏览数百个类,找到所有用法、覆盖和内容。您需要能够轻松地重构您的代码。IntelliJ IDEA 和 Netbeans 具有大量专门针对 Java 开发的功能和快捷方式。Vim 是一个很棒的工具,但 java 更适合 IDE,您应该充分利用它。
回答by dime
I was a hardcore vim user, but I switched over to Eclipse.
我是一个铁杆 vim 用户,但我切换到 Eclipse。
There are two vi plugins/keybindings for it. One is free, the other is commercial. I preferred the commercial one: seems to work better for certain things.
它有两个 vi 插件/键绑定。一个是免费的,另一个是商业的。我更喜欢商业的:似乎对某些事情更有效。
Eclipse can do a lot of things that gvim can't do (or make them easier).
Eclipse 可以做很多 gvim 不能做的事情(或者让它们更容易)。
Compiling/debugging/running.
Setting up build environment.
Javadocs, code completion, etc.
Refactoring, source control pluins, code organizing.
Project setup, etc. It's easy to share a project with other developers. Lots of FOSS java projects have eclipse files for easy setup.
编译/调试/运行。
设置编译环境。
Javadocs、代码完成等。重构、源代码控制插件、代码组织。
项目设置等。很容易与其他开发人员共享项目。很多 FOSS Java 项目都有 Eclipse 文件以便于设置。
Just to name a few.
仅举几个。
回答by Amit
vi editor is "mostly" used by a *nix user in a command line environment for example if the only option to connect to the Unix / Linux box is through a telnet / ssh clients.
vi 编辑器“主要”由命令行环境中的 *nix 用户使用,例如,如果连接到 Unix / Linux 机器的唯一选项是通过 telnet / ssh 客户端。
If your client machine / desktop is for example, Linux with Genome or KDE etc, you would always prefer Eclipse type enviroments which give you rich features like creating and managing projects, connection to code repositories, easy navigation through multiple files and debugging etc.
例如,如果您的客户端机器/桌面是带有 Genome 或 KDE 等的 Linux,您总是更喜欢 Eclipse 类型的环境,它为您提供丰富的功能,如创建和管理项目、连接到代码存储库、轻松浏览多个文件和调试等。
But, I know some die-hard fans of vi or emacs who would still, invariably use vi or emacs for all practical purposes.
但是,我知道一些 vi 或 emacs 的铁杆粉丝,他们仍然会出于所有实际目的而始终使用 vi 或 emacs。
vi or emacs are very rich programming tools. you can do almost any king of navigation and editing with the key combination based commands. But they are a bit hard to get handy with them and even if you are an expert, working on multiple files and large projects is difficult as per my experience.
vi 或 emacs 是非常丰富的编程工具。您几乎可以使用基于组合键的命令进行任何导航和编辑之王。但是使用它们有点困难,即使您是专家,根据我的经验,处理多个文件和大型项目也很困难。
But using vi on a Windows machine is very rare and if someone does it, I can't imagine the reason behind.
但是在 Windows 机器上使用 vi 是非常罕见的,如果有人这样做,我无法想象背后的原因。
回答by Amit
Download gvim for windows, it seems exactly the same as the linux equivalent.
下载 gvim for windows,看起来和 linux 完全一样。
回答by Raghuram
Vim also does syntax highlighting for multiple programming languages. This, along with the keyboard shortcuts, makes it a better tool for making minor code changes than launching Eclipse and going to the relevant file.
Vim 还为多种编程语言进行语法高亮显示。这与键盘快捷键一起,使其成为比启动 Eclipse 并转到相关文件更适合进行少量代码更改的工具。