Do developers actually use vim to write code (Java) on a Windows OS?

16,796

Solution 1

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.

Solution 2

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?

Solution 3

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

Solution 4

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.

Solution 5

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.

Share:
16,796
Manius
Author by

Manius

Updated on July 26, 2022

Comments

  • Manius
    Manius over 1 year

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

  • amphetamachine
    amphetamachine over 13 years
    Or, to answer the question in the OP's title: "Windows isn't developer friendly; just look at COM."
  • Vishy
    Vishy over 13 years
    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.
  • Manius
    Manius over 13 years
    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.)
  • Denis Tulskiy
    Denis Tulskiy over 13 years
    @Crusader: I guess sometimes you need to develop in the exact environment that your program will work in.
  • dash-tom-bang
    dash-tom-bang over 13 years
    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.
  • Manius
    Manius over 13 years
    @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
    Manius over 13 years
    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
    Manius over 13 years
    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
    Manius over 13 years
    What specifically (features) do you need to do that can't be done in an IDE?
  • Manius
    Manius over 13 years
    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)
  • idbrii
    idbrii over 13 years
    @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
    idbrii over 13 years
    @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
    idbrii over 13 years
  • SyntaxT3rr0r
    SyntaxT3rr0r over 13 years
    @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.
  • Manius
    Manius over 13 years
    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.
  • SyntaxT3rr0r
    SyntaxT3rr0r over 13 years
    @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 ;)
  • theoden8
    theoden8 over 8 years
    This post is a bit old, but this might be a kind of solution. Not sure. github.com/liangxianzhe/oh-my-vim
  • mellow-yellow
    mellow-yellow about 6 years
    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.
  • Zack Macomber
    Zack Macomber over 5 years
    "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.
  • theprogrammer
    theprogrammer almost 4 years
    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.