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.

Manius
  • 3,594
  • 3
  • 34
  • 44
  • 3
    Not need to vote for close I think: it is an interesting question and the answers so far are good – SyntaxT3rr0r Sep 30 '10 at 05:15
  • 1
    @Webinator: Not programming related though probably it will fit better here: http://bit.ly/ProgrammersQA -- http://programmers.stackexchange.com/ – OscarRyz Sep 30 '10 at 05:20
  • When you want to write a Hello World. – irreputable Sep 30 '10 at 07:04
  • This isn't an answer to the question so... Why not get the best of both worlds in so far as you can? Each of the big three java IDEs have a plugin to give you VI keybindings. If you really are dead set on using gvim itself, then have a look at eclim. – whaley Sep 30 '10 at 13:16
  • Oscar what part of "developers" and "Java" is not programming related? – Manius Oct 01 '10 at 08:59
  • This isn't subjective, just complex depending on circumstances. Argumentative perhaps, but I've yet to see a single flame below. Why close? – Manius Oct 02 '10 at 17:29

8 Answers8

21

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
  • 27,620
  • 12
  • 60
  • 72
  • 1
    Or, to answer the question in the OP's title: "Windows isn't developer friendly; just look at COM." – amphetamachine Sep 30 '10 at 05:16
  • 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. – Manius Oct 01 '10 at 09:08
  • 1
    not that heavy: http://www.vim.org/scripts/script.php?script_id=1785 – idbrii Jan 06 '11 at 20:57
  • This post is a bit old, but this might be a kind of solution. Not sure. https://github.com/liangxianzhe/oh-my-vim – theoden8 Oct 05 '15 at 21:30
  • 1
    The eclim project (eclim.org), which aims to expose Eclipse's most helpful features to vim (in Java, C++, etc), can create Eclipse Projects, build and run them, do proper code completion, manage import statements, show JavaDocs, display invalid syntax (like the vim plugin Syntastic), help refactor code, automatically format, and more. In addition, the `fugitive` vim plugin for GitHub is arguably better than Eclipse's. Eclim isn't perfect (e.g., no C++ documentation yet), but it supercharges vim enough to make (especially Java) development reasonable. – mellow-yellow Mar 21 '18 at 13:25
  • I use Ideavim plugin with Intellij. Best of both worlds(Intellij's amazing intellisense, debugger, filetree etc with vim's basic verbs and motion support). I also have easymotion and quickscope setup in ideavim. – theprogrammer May 20 '20 at 20:07
8

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?

Community
  • 1
  • 1
SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120
  • What specifically (features) do you need to do that can't be done in an IDE? – Manius Oct 02 '10 at 17:25
  • 1
    @Crusader: It's easy to build up your regular expression in vim (with incsearch which is disabled in Eclipse when regex is enabled). It's also quick to sort selected text (or pass a selection to any command line filter like sort, grep, or comm). Also Vim macros. – idbrii Jan 06 '11 at 20:50
  • @Crusader: commenting after a long time... Basically if you ask what Emacs has to offer that IntelliJ or Eclipse don't it's that you've never **really** used Emacs ;) Seriously. – SyntaxT3rr0r Jan 12 '11 at 21:03
  • pydave's answer is the one of the few instances where I've actually heard some concrete capabilities which modern IDEs lack, but still, maybe it's just my specific needs but I just don't care about things like sorting selected text or using grep or macros. Features like refactoring, 'find all references', package explorer, code generation, integrated debugger, (I could go on forever) are too powerful and productive to go without. – Manius Jan 13 '11 at 01:14
  • @Crusader: I think you have trouble accepting that the way *I* work I do actually get the best of both world. Did I write that I didn't use an IDE? Certainly **NOT**. I, also, do refactor, do "find all references", do "package explore" and whatnots. But when I need a real editor to perform advanced manipulation, I'm one shortcut away from my source file opened in Emacs. And I do get the best of both world. Don't even **think** about trying to make it sound like I'm not using IntelliJ IDEA (which btw owns your IDE, no matter which one you use, unless it happens to be IntelliJ ;) – SyntaxT3rr0r Jan 13 '11 at 23:00
4

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
  • 22,412
  • 8
  • 58
  • 84
  • 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 Sep 30 '10 at 05:41
  • 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.) – Manius Sep 30 '10 at 06:10
  • @Crusader: I guess sometimes you need to develop in the exact environment that your program will work in. – Denis Tulskiy Sep 30 '10 at 06:29
  • @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? – Manius Oct 01 '10 at 09:05
  • 1
    @Crusader: "I can't think of any issues." While it might not be tulskiy's case, if you're writing mainframe programs or anything else that requires cross-compilation, you may be doing so on a remote machine and compiling on the target platform may be faster. – idbrii Jan 06 '11 at 20:54
2

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
  • 466
  • 6
  • 11
  • 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 Sep 30 '10 at 23:37
  • 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.) – Manius Oct 02 '10 at 17:20
2

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.

Community
  • 1
  • 1
Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68
  • "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." All of that can be done via bash in Linux. – Zack Macomber Oct 30 '18 at 18:19
2

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.

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
dime
  • 545
  • 1
  • 5
  • 13
1

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

1

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
  • 51,854
  • 11
  • 110
  • 122
  • 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) – Manius Oct 06 '10 at 06:08