I'm considering whether I should start using VIM again instead of an IDE. What are the most useful features of VIM that aren't standard in an IDE?
closed as not constructive by Yannis Rizos♦ Oct 17 '12 at 13:10
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
I don't think its necessarily the advanced features of VIM that make it so powerful. Its the fact that you never have to take your hands off the keyboard to do anything. Finding something in a huge file is as simple as a couple of keystrokes. Opening and closing multiple files in the same window is incredibly fast as well. While it may not seem intuitive at first, its well worth your time. Even if you don't use it as your standard IDE (I generally use Visual Studio or Eclipse, for example), you'll find your self using VIM to quickly open and edit files because it becomes way faster than waiting for the IDE to load. Invest the time to learn how to use VIM well and you'll never regret it. I'd say its comparable to learning to touch-type. |
|||||||||
|
|
For me the Here are some examples: The default behaviour is to list out every line that matches, so:
will list every line that contains the text "TODO:" change 'Mickey' to 'Minnie' on any line that also contains the word 'Mouse'
The commands can have their own range, so this will delete from every line with "TODO:" to the next blank line: :g/TODO:/ .,/^$/ d Use :g! to execute on every line that does NOT match the regex, e.g. to replace "emacs" with "vim" except on lines that contain the word "sucks":
|
||||
|
|
|
I find the ability to delete everything in between a set of paired symbols incredibly useful. For example, quite often, I'll find myself wanting to replace a string in the code. So, |
|||||
|
|
'Insertion mode keyword completion'. Ctrl-P and Ctrl-N in insert mode to search through the text to try and complete whatever variable name you are typing. I've never seen this in any other IDE and I really miss it. Code completion in IDE's just isn't the same. |
|||||||||
|
|
Another feature I find incredibly useful is the ability to change indentation. |
||||
|
|
|
the command dd (delete current line). I use this one so much. Also, being able to type something like 3dd and delete the next 3 lines is wonderful. I've never seen this in another editor =D |
|||||
|
|
The |
||||
|
|
|
The |
||||
|
|
|
|
||||
|
|
|
Rapid access to the command-line. CTRL+Z or :wqa will get me a command line in less than 1sec without my hand leaving the keyboard. |
|||||
|
|
That I can use |
||||
|
|
|
This is rather hard to answer, due somewhat to the vagueness of the question, and somewhat to the fact that IDE's differ, and many provide features that other don't (and the fact that I've just a few of them). However, what I believe distincts Vim from other editors (yes, even Emacs, on this one) is that it is really a great editor. I've in the passing of time, used many editors, and can honestly say that very few come with such a complete set of features for manipulating text, like Vim does. My style of manipulating text for example, includes very often use of (line/selection of several lines) duplication, and moving (line/selection of several lines) up and down, for which I've long ago defined quick shortcuts. I miss those features in most IDE's (although I've heard ReSharper for VS has something similar). |
||||
|
|
|
Did you know that there is a vi plugin for eclipse? It costs 15 euro (20ish US$) but it is so worth. No more Perhaps a bit off topic but I thought it was worth pointing out. |
||||
|
|
|
Depending on what you language you are programming, stick with the ide, or get the ide that offers the most refactorings that you can find, get resharper for visual studio if you are doing c#, intellij for java, or visual assist for visual studio, max out the refactorings in eclipse or netbeans. We should be moving from manipulating text to manipulate code, refactoring tools give you that ability. If vim does give you all the features fine, I for one don't really want to deal with a text editor anymore |
|||||
|
|
Table Column Select This doesn't seem to be in the popular IDEs, and if it is they keep it well hidden. This is really handy for testing regex against a column in CSV data file. |
||||
|
|
|
Most IDEs don't allow you to split the screen. I love that feature in VIM. |
|||||||||
|
emacsinstead. ;-) – Orbling Dec 22 '10 at 13:41