Do developers actually use vim to write code (Java

2019-04-24 11:26发布

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

8条回答
别忘想泡老子
2楼-- · 2019-04-24 11:44

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 :)

查看更多
我命由我不由天
3楼-- · 2019-04-24 11:45

Download gvim for windows, it seems exactly the same as the linux equivalent.

查看更多
Melony?
4楼-- · 2019-04-24 11:51

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.

查看更多
爷的心禁止访问
5楼-- · 2019-04-24 11:58

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.

查看更多
不美不萌又怎样
6楼-- · 2019-04-24 12:01

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?

查看更多
迷人小祖宗
7楼-- · 2019-04-24 12:04

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.

查看更多
登录 后发表回答