Speed up your work in Vim

If you don’t know what’s , then:

  1. You’re Windows IDE’s fan
  2. You’ve never used

An option “you’re using Emacs” is not included - you would have definetely known . You’d hate it for the sake of “holly wars”.

I’m not an Emacs lover, neither those huge IDE’s with bunch of boxes, bookmarks, you name it. Most of these things are useless when you need to code something fast, so I just stuck with : simple, light, fast, and have a lot of functionality. Here are just few of speeding up coding process I’ve been using lately:

If you got some repetitive function calls or anything you’re not bothered to print just fire up:

Comments:
:ab #cb /********************************
:ab #ce /*******************************/

Printing

#cb

or

#ce

will paste initial comment pattern.

:ab #r require_once();
:ab #i  include_once();

Minus another dozen of lines to be typed.

Text search:

You can

:set incsearch

which will enable incremental search for you, or use regexp, like:

:/\<agent\>/

will find you “agent” in current file.

Using ftp:

cmap ,r :Nread ftp://ftpdomain/public_html/index.html
cmap ,w :Nwrite ftp://ftpdomain/public_html/index.html

These are just basics, Bram Moolenaar, the developer of , got a good article on how to optimize your work with Vim, and David Rayner with his page of Vim tips. Compulsory to learn for beginners!

Tags: , ,

Leave a Reply