开发人员实际上是否使用 vim 在 Windows 操作系统上编写代码(Java)?
...或者 vi/vim 仅在非 Windows 操作系统上开发时使用?
如果没有,vim 提供了哪些现代 IDE(例如 Eclipse)没有提供的功能?在 Windows 工作站上进行开发时,为什么会选择使用 vim 而不是 Eclipse(或 IntelliJ、Websphere 或其他功能丰富的 IDE)?请注意,我指的是 Java 开发以及某种程度上的编译语言,而不是 shell 脚本或其他形式的脚本。
...or is vi/vim only used when developing on a non-Windows OS?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Java 是一种极其复杂的语言,我想不出有谁能记住 JDK 中内置类的所有方法参数和返回类型。 Java 是通过 JavaDoc 注释进行自我记录的,当您有像 Eclipse 这样的 IDE 来调用特定方法或类的特定文档时,将这些注释转变成可供分页的手册页似乎毫无意义。
简而言之,当你使用 (g)Vim 时,除非你使用一些重型扩展,否则大多数时候你都是盲目的,并且大部分逻辑都在你的头脑中弄清楚(或者,你正在使用 < code>screen(1) 并在另一个终端上打开手册页)。
我是 Vim 的忠实粉丝,但对于像 Java 这样规模更大、库较多的语言,我不会使用 Eclipse 以外的任何语言。我的一个朋友曾经推测,如果没有智能 IDE,Java 开发几乎是不可能的,我同意这一点。
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.
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).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 还是 Emacs(这里没有激烈的争论),有时使用“较小的”文本编辑器(例如所提供的编辑器)可能会非常各种 IDE 默认情况下。
我所做的事情很简单:有时我确实需要在我的.java源文件中做一些在Emacs下快速完成的事情。那我该怎么办?我从 IDE 切换到 Emacs(这是一个快捷方式,位于另一个虚拟桌面上),完成我的工作,然后切换回 IntelliJ IDEA(我选择的 Java IDE)。
问题是,正如 amphetachine 所指出的:仅使用 vim 或 Emacs 进行 Java 开发感觉就像生活在石器时代。
在这两个世界中最好的情况下,我的 IDE 中心的“文本编辑器”将是 Emacs(或 vim),但具有优秀的 Java IDE 所具有的所有闪亮的实时错误/警告、代码完成、代码遍历以及诸如此类的功能。
PS:这是我提出的一个 +7 赞成、+4 收藏的问题,关于如何在 Emacs 和 IntelliJ IDEA 之间始终同步 .java (或其他相关文件):
Emacs:经常在 Emacs 和 IDE 编辑器之间切换,如何自动“同步”文件?
When you are used to a powerful "text editor", be it vim or Emacs (no flamewars here), it can be at time very difficult to use a "lesser" text editor, like the ones provided by default by the various IDEs.
What I do is simple: sometimes I do need to do things in my .java source 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).
Problem is, as amphetachine pointed out: using only vim or Emacs to do Java development feels like living in the stone age.
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.
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:
Emacs: Often switching between Emacs and my IDE's editor, how to automatically 'synch' the files?
vim 允许通过 Telnet 或 SSH 进行远程瘦客户端访问,而 Eclipse 则不能。您最多可以做的是远程桌面,这可能不方便且速度慢。另外,vim 已经发展了很多很多年,有些人已经很习惯这个环境了。 vim 的速度也非常快,如果您是专家,则可以通过大量关键命令来控制代码:)
可以通过 vim 使用 Eclipse 的功能(请参阅 Eclim -- http://eclim.org/),但这仍在开发中,可能不稳定或难以设置。
如果您在本地使用 Eclipse,您将获得非常快速的 UI,并具有许多强大的重构工具。然而,有些人喜欢简单的路线:)
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 :)
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.
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 :)
vi 编辑器“主要”由 *nix 用户在命令行环境中使用,例如,如果连接到 Unix / Linux 机器的唯一选项是通过 telnet / ssh 客户端。
例如,如果您的客户端计算机/桌面是带有 Genome 或 KDE 等的 Linux,您总是更喜欢 Eclipse 类型的环境,它为您提供丰富的功能,例如创建和管理项目、连接到代码存储库、轻松导航多个文件和调试等
。 ,我认识一些 vi 或 emacs 的铁杆粉丝,他们仍然会出于所有实际目的而使用 vi 或 emacs。
vi 或 emacs 是非常丰富的编程工具。您可以使用基于组合键的命令进行几乎任何导航和编辑。但它们有点难以使用,即使您是专家,根据我的经验,处理多个文件和大型项目也很困难。
但是在 Windows 机器上使用 vi 非常罕见,如果有人这样做,我无法想象背后的原因。
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.
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.
But, I know some die-hard fans of vi or emacs who would still, invariably use vi or emacs for all practical purposes.
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.
But using vi on a Windows machine is very rare and if someone does it, I can't imagine the reason behind.
请参阅此问题的答案:
当您处理大型项目时,强大的编辑器是远远不够的。您需要能够浏览数百个类,找到所有用法、覆盖等等。您需要能够轻松重构代码。 IntelliJ IDEA 和 Netbeans 具有大量专门针对 java 开发的功能和快捷方式。 Vim 是一个很棒的工具,但 java 更适合 IDE,您应该充分利用它。
See answer to this question:
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.
我是一名铁杆 vim 用户,但我转而使用 Eclipse。
有两个 vi 插件/键绑定。一种是免费的,另一种是商业的。我更喜欢商业版:似乎对某些事情更有效。
Eclipse 可以做很多 gvim 做不到的事情(或者让它们变得更容易)。
编译/调试/运行。
设置构建环境。
Javadoc、代码补全等
重构、源代码控制插件、代码组织。
项目设置等。与其他开发人员共享项目很容易。许多 FOSS java 项目都有 eclipse 文件以方便设置。
仅举几例。
I was a hardcore vim user, but I switched over to 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.
Eclipse can do a lot of things that gvim can't do (or make them easier).
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.
Just to name a few.
下载 Windows 版的 gvim,它看起来与 linux 版的完全一样。
Download gvim for windows, it seems exactly the same as the linux equivalent.
Vim 还为多种编程语言提供语法突出显示。这与键盘快捷键一起使其成为比启动 Eclipse 并转到相关文件更好的工具来进行较小的代码更改。
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.