5 ms·
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 ma
by AYBABTME 14y ago
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?
- praxulus 14y agoIf 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.
- e12e 14y agoThanks 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.
- revscat 14y agoWhen 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.
- jamesbritt 14y agoNetbeans support for (J)Ruby was pretty good last I used it.
- bstar77 14y agoI 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.
- thiderman 14y agoDo 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 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.
- slurgfest 14y agoI have ropevim installed, it works great. but I honestly never use it...
- bcrescimanno 14y agoThese 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).
- kingmanaz 14y ago>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/ 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.
- slurgfest 14y agoRenaming 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.
- dfbrown 14y agoVim 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. For your specific complaint of autocompletion, clang complete (https://github.com/Rip-Rip/clang_complete/ https://github.com/Rip-Rip/clang_complete/) is excellent, but can be slow on large projects. Some other useful plugins are syntastic (https://github.com/scrooloose/syntastic/ https://github.com/scrooloose/syntastic/) for syntax checking of many file formats, tagbar (http://www.vim.org/scripts/script.php?script_id=3465 http://www.vim.org/scripts/script.php?script_id=3465) for convenient code navigation, and UltiSnips (http://www.vim.org/scripts/script.php?script_id=2715 http://www.vim.org/scripts/script.php?script_id=2715) for the best snippet plugin out there. The only thing I find I'm really lacking is good debugger integration (Pyclewn is ok, but not great: http://pyclewn.sourceforge.net/ http://pyclewn.sourceforge.net/) and good refactoring tools. I've heard good things about eclim, but never tried it.
- AYBABTME 14y agoWow I just tried clang_complete and... I'm in awe. Thanks!