I've been trying to switch my programming to vim, I don't know why (in fact I know, because everybody everywhere promises it's the single greatest thing ever made). I got to learn a couple of commands, enough to feel quite comfortable with it. But my major problem, what refrains me from using it for everything, is its lack of support for refactoring. In fact, if I could find a plugin that can properly handle 'renaming' in a couple of common languages, I'd be sold. But I searched, many times, and didn't find. Same for 'intellisense', which is somewhat emulated with 'omnicompletion' that I have all set up, but it's not context-sensitive...
I'm honestly wondering how people do to use vim for their projects. Are they giving up on refactoring althogether, or they are doing them the slow-way, step by step. Same for intellisense, I find it's so convenient to have documentation and in-context pop-up right in the middle of my thoughts; it makes me doubt of the productivity advantages that vim-evangelist claims.
I really try hard to learn more, to tweak vim more, to tame it more, hoping to reach the top of that learning-curve and to see just how ignorant I was before. But I'm in doubt. Is it real, or is it just some cultural dogma that vim is the ultimate tool?
These are honestly the two biggest criticisms I hear about Vim; and, if they're features you really do use often, I don't really have any good response in store.
Regarding refactoring; I don't really miss it at all. For renaming, I simply use vim-ack and find where a rename would need to take place. In most cases (for the projects I work on) we're talking about the difference of maybe 30-45 seconds.
Intellisense is cool; there's no doubt about it and there's not really anything that comes close in Vim (omnicompletion really does pale in comparison). That said, the only type of projects that I've ever felt I really used Intellisense were sprawling Java applications. I've never missed it while working on JavaScript or Ruby projects (and, anecdotally, I've heard many C and Python developers also talk about not needing this feature).
Ultimately, Vim benefits me with overall productivity (for example, it takes Vim an order of magnitude less time to start up than Eclipse on my Macbook Pro--and then proceeds to lock up every few minutes while it does GC or whatever the hell else it does to just randomly stop from time-to-time). While I'm in the mode of writing and editing code, it's also significantly faster and easier on my hands and arms to be totally keyboard focused.
All that said, it's a really text-centric form of programming that is somewhat different from the hand-holding (not meant as derogatory; just a statement of fact) and all-in-one approach that an IDE can give you. There are some contexts (Java) that just aren't well suited to editing in Vim (but they're probably not suited for Sublime or TextMate either, honestly).
>That said, the only type of projects that I've ever felt I really used Intellisense were sprawling Java applications.
Exactly. I've recently been using omnicompletion with Go (gocode) and while it's neat, it is not essential as completion is when writing Java/C#/ActionScript. I believe it has to do with the former language's reliance on multiple-inheritance as opposed to Go's duck typing. With multiple-inheritance one seems "farther" away from atomic data structures; to understand the objects one must learn an entire tree of taxonomy.
Personally I find Go's approach refreshing; with one page of documentation one can "see" how an entire collection of types (structs) relate. Here's an example: http://golang.org/pkg/database/sql/
>Ultimately, Vim benefits me with overall productivity
...and it's not just coding where vim increases productivity. I can't count the number nights I've spent writing essays or final papers in college with nothing more than vim, ispell, and the book I'm reporting on. When editing text becomes reflexive it is so much easier to express oneself.
I spend all day in vim writing python, and I've got to agree that refactoring and completion are two of vim's weakest points(I have heard that ropevim is pretty good but I never got into it).
I've had very poor luck getting omnicompletion to work to my satisfaction, but one thing that works very well for me is opening buffers for several files related to what I'm working on and just using <C-n> / <C-p> for basic completion. I always have a bpython console open to test bits of code and make sure I'm calling functions correctly. The one thing that I miss is being able to complete a function name and have a small window pop up with its arguments and documentation. I've tried writing some simple plugins for this but have never managed more than a hack of a solution.
My system works incredibly well for me and I wouldn't use anything else, but many of my coworkers use totally different methods and I don't blame them.
Do you refactor so often that this actually becomes one of your main issues? Simple refactoring can be done with :argdo or :bufdo in combination with :%s. For more advanced cases, I know there are plugins for at least some languages. I use ropevim (http://rope.sourceforge.net/ropevim.html) for Python, and its refactoring tools are very good. I suspect there are similar tools for other languages, but I've never used any.
Vim is not the ultimate tool. It is a very efficient and powerful text editor but I would say it is not a replacement for an IDE. However to me the problem with most IDES is the I part. You're stuck with their text editor, their build system, and their tools. I'm certainly not against integrating related tools together, I just would like the ability to access those tools by themselves as well. My ideal IDE would be one that has an integrated environment with all its tools, but with each tool being able to work independently. So if I prefer editing in vim, but I'd like to use the IDE's refactoring, I can set up a script or perhaps a vim plugin that will use the refactoring program provided by the IDE.
This is a fairly viable ecosystem on unix systems for C and C++ at least. You use whatever text editor you prefer, your chosen compiler and build system, gdb for debugging, and more recently clang for intellisense (though I do not know of a good standalone refactoring tool). For most text editors there are plugins to integrate the things that should be available in your text editor like debugging and autocompletion.
When I was doing Java I used Eclipse for Java and vim for everything else. You are correct: Eclipse is better for Java mainly for the refactoring support. Now, I am mainly working with Ruby and use vim exclusively. I have not found any IDE that works well with dynamic languages.
If Eclipse can handle your language, then the eclim plugin will provide renaming, real autocomplete, etc. within vim. It just runs eclipse in the background and exposes functionality to vim.
Thanks for this! This should help out when I finally start hacking something for Android. I've been using vim for simple java projects before, and while NERDTree helps a bit with the forced split over too many files -- it always felt a bit painful.
I did try a few literate programming variants -- but it required a lot of discipline to keep the abstractions in the right place -- literate programming makes procedual/classical programming really efficient and easy -- but all that magic "transclusion" makes it easy to write something that is readable and structured in it's "natural" literate source form, but is pretty bad object oriented code.
I use a combination of Ack (to search for the instances of the code I want to refactor), and Vim's search and replace feature.
I primarily do TTD style development, so it's very obvious where things break when I refactor something. I know a lot of Java devs rely on refactoring tools, but I never really had the need for my Ruby and JS work.
Renaming things doesn't take me a significant amount of time in vim and it certainly doesn't account for a significant share of my total time on a project.
It's not cultural dogma that vim is an ultimate tool, but that doesn't mean you have to learn it if you don't want to or don't understand the use cases. (Or you prefer emacs, which is equally capable). I felt the same way for years.
I'm honestly wondering how people do to use vim for their projects. Are they giving up on refactoring althogether, or they are doing them the slow-way, step by step. Same for intellisense, I find it's so convenient to have documentation and in-context pop-up right in the middle of my thoughts; it makes me doubt of the productivity advantages that vim-evangelist claims.
I really try hard to learn more, to tweak vim more, to tame it more, hoping to reach the top of that learning-curve and to see just how ignorant I was before. But I'm in doubt. Is it real, or is it just some cultural dogma that vim is the ultimate tool?