tags:

views:

944

answers:

12

I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old.

All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graham is a Vi dude.

A: 

The lovely built in regular expression evaluator.

Alex Fort
+1  A: 

Why are you looking to be convinced to start using a different editor? If you're happy with what you have now, stick. If not, perhaps ask about editors with features that you lack.

Blair Conrad
+5  A: 

The asterisk.

*

Its effect: Immediately search for the next instance of the word under the cursor.

Max
Excellent tip. I didn't know about that one.
Mark Biek
This VIM quick reference guide (nice and printable) was very handy for learning useful commands: http://tnerual.eriogerg.free.fr/vim.html
Kris Kumler
Also worth mentioning #, it does the same, except searchs backwards.
SpoonMeiser
+10  A: 

. (dot) - repeats the last editing action. Really handy when you need to perform a few similar edits.

Linulin
I agree. The dot command is awesome.
J D OConal
+2  A: 

the numbers.

in command mode type a number ( any number of digits ) type a command.

that command will be executed $number times

ie:

99dd

erases the next 99 lines.

Kent Fredric
or 78a/<ESC> to write 78 times the character '/' (useful for comment adornments)
Leonardo Constantino
+11  A: 

Recording macros

CMS
Thanks, I vote you up if a had any votes left.
Flinkman
+8  A: 

:help usr_12.txt

That'll bring up a section in the help system that discusses "Clever Tricks". If those don't get you excited I don't know what will!

whitney
A: 
  1. The fast startup time.

  2. The sharp distinction between editing and viewing. (you know when you edit)

  3. The only way you ever find what you are looking for is with search "/" and that is good, since it much faster than your eyes.

But the best command(s) are:

/ - search string

ZZ - quit

. - repeat last insert (I think)

%! - insert unix command

Flinkman
A: 

I don't know where to begin. I think that it is not one single thing but the whole environment. One thing that stuck out for me recently is substitution by regular expression in arbitrary parts of the file.

+6  A: 

The best thing is the efficiency with which you can edit code (which is done a lot in programming). The commands such as

  • cw to change a word
  • dw to delete a word
  • ct, to change all text until the next comma
  • ci( to change the contents of the parentheses you're currently in
  • xp to correct spelling mistakes ("spleling" -> cursor on l -> xp -> "spelling")
  • o to insert a new line below and start editing
  • O to insert a new line above

Then there is the possibility to work with named registers very quickly. To move a block, just select it, press d, then move to it's new location and press p. Much faster than Ctrl-C and Ctrl-V. Use "ud to delete text and move it to register u (I use this one for the commenting template).

And also Vim has all the scripting support you need (either using it's native scripting language or using Python, Ruby, ...)

Roman Plášil
A: 

I love the speed of Vim but I find it lacks the features of a modern IDE for C++ development. Eclipse CDT with the viPlugin is a good compromise.

You get the power and source overview provided by Eclipse CDT with the speed and flexibility of Vim for coding.

Michael Harding
+1  A: 

Handling multi line regexps in search strings with "\_.". While checking over 4GB text files of various formats, it had saved my life several times.

Zsolt Botykai