tags:

views:

380

answers:

8

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

+4  A: 

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

Chris Dennett
I have been developing on UNIX remotely for over five years (Using VNC) and find it it much better to use than vi for development. However, for editing random files like /etc/hosts, I still use vi. Having used IntelliJ, Netbeans and Eclipse, I would only use IntelliJ because it is nicer to edit and refactor with.
Peter Lawrey
I don't understand why anyone would **need** to access source code remotely vs building locally (taking advantage of things like integrated source code versioning) and just doing an ftp or some other deployment process? (Unless they're making small changes directly on a production server or something crazy, but that can't be common.)
Crusader
@Crusader: I guess sometimes you need to develop in the exact environment that your program will work in.
tulskiy
@tulskiy: It just sounds like something bad is going on in this case, like not having a proper dev/qa/prod dedicated environment or some such. You could automate deployment from a workstation running whatever to any environment you want, I can't think of any issues. I feel I'm far more productive with an enhanced IDE such as Eclipse. Perhaps doing some uncommon things are easier via vi-like features but if it only helps 1% of the time and has a sharp learning/memory curve, I think time is better spent elsewhere?
Crusader
+6  A: 

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.

amphetamachine
Or, to answer the question in the OP's title: "Windows isn't developer friendly; just look at COM."
amphetamachine
I've developed on Windows for half my life and never had to deal with anything COM related. Not saying it isn't miserable (have watched others deal), but even if we agreed that Windows wasn't dev friendly, it is user friendly for the most part, and devs are users.
Crusader
A: 

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

blakejc70
A: 

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.

Raghuram
Eclipse can take far too long to start up, but after making such a change I'd always want to check into source control, so I'm willing to wait a few extra seconds most of the time. (Not sure if Vim integrates with SVN)
Crusader
+1  A: 

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.

Amit
I work in a company where half of the programmers use gvim to edit their code and Visual Studio to debug it. One keystroke in either to flip to the other.
dash-tom-bang
But why? That's the question I'm asking. What features or capabilities specifically motivate this? (Also VS isn't Java so it's a bit off topic, but still an interesting question.)
Crusader
+4  A: 

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:

http://stackoverflow.com/questions/2703296

Webinator
What specifically (features) do you need to do that can't be done in an IDE?
Crusader
+1  A: 

See answer to this question:

Despite Vim's multitude of plugins, nothing comes close to the language-aware refactoring and coding capabilities of the modern 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.

tulskiy
+1  A: 

I was a hardcore vim used, but switched over to Eclipse.

There is two vi plugins/keybindings for it. One if free, one is commercial. I've found the commercial one better to my liking (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.

dime