Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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

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

The asterisk.

*

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

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.

  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

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.

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

Even if you are using Visual Studio there is the wonderful vsvim.

The lovely built in regular expression evaluator.

You should map Caps Lock to Esc. It will make getting out of insert mode feel natural as opposed to the awkward move you must make to press the ESC key. Besides, who uses Caps Lock anyway?

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.

Maybe reading "Come home to vim" by Steve Losh article is a good start, or a series of videos about interesting plugins. And be sure to see some articles on the site vimcasts.org

\v

Make your regular expressions mostly Perl compatible.

See very magic section here for more information.

To be truly inspired, you must see a vim guru in action. If you do not have a local guru, here is a video to inspire you.

http://www.youtube.com/watch?v=jDWBJOXs_iI&feature=related

If you don't already know vim, the speed at which code is navigated, sliced, and diced will be indistinguishable from magic. After a few months of studying vim, the same editing speed will seem commonplace.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top