Dilawar
unread,Jun 30, 2013, 12:14:20 AM6/30/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wncc...@googlegroups.com
Like guitar, vim editor can be very intimidating for newcomers. It takes
time for fingers to remember basic commands in vim, like basic chords
in guitar. Once basic commands (and basic cords in guitar) are mastered,
rest does not take much time. Some over-enthusiastic vim-lover compares
vim to Jedi Knight's light-saber. The moral of these comparison it that
it takes time and persistence to master both vim and light-saber. And
it makes a statement about its wielder.
If you want to learn vim
and need no propaganda in its support, download, install, and open vim;
type ':help' (without quotes) and read the first 12 tutorials . These
tutorials are great. You don't have to browse books and Internet. Give
some time to vim during weekends and within few weeks, you should be
able to use it with some competence.
The vim distinguish itself
from many other editors by its ability to do everything by just
keystrokes. Experienced vim user loves it and newcomer often hates it
for this reason only.
A programmer spends his time editing,
searching and moving around in code, and typing new code once in a
while. Vim has great facility to accomplish all these fundamental
operations. A piece of advice: avoid using arrow keys when moving while
learning it. Vim's speed depends on its ability to move around very
quickly (and lightening fast speed if you install appropriate tools and
plugins such at ctags). Sticking to arrow keys will handicap you from
exploiting this power (Trust me, you don't want to commit this mistake
as I have done when I was learning it). The official tutorial on 'moving
around' has most of keystrokes well summarized.
Programming
requires repetitive typing: a keyword appears at many places. If you
have typed it once, should to type it again fully? Vim, like most modern
editors, allows auto-completion. Auto-completion allows fast coding and
also reduces the chances significantly of spelling mistakes when you
type a word again. Check out 'omni-complete' and 'super-tab' plugins.
Searching stack-overflow for "vim + auto-complete" should be more than
enough.
Syntax high-lightening is enabled by default in full
installation of vim (vim-athena, vim-gtk etc). Indentation of code
requires some work. Its a good practice to replace tab with spaces and
set the indentation level to 3-4.
Searching a fragment of code
can be very time-consuming when there is more than one files. For many
languages 'ctags' is great for searching keywords. But how about
fraction of code? You have to learn to use another very powerful
facility: regular expressions (They are essentially finite state
machines). How to search files containing a regular expression in a
directory? Command 'find' and 'grep' can be used with great effect. The
whole shell is at your disposal which in itself is a very versatile
tool.
There is virtually no limit on how effective and efficient
one can get with vim, or with any other skill. Learning is a gift of
life; merit or education has little to do with it. Vim does its basic
operations in the spirit of Linux (do one operation at a time and do it
well). Vim lets it's user to personalize itself to their taste, to an
extent that each vim can behave like a new type of text-editor. People
not only distinguish between vim and other editors, they also
discriminate between this vim and that vim. Vim, like tex, is one of the
finest and productive piece of software created by mankind.
And you should always pass-around vim tips/tricks like gossips to
other vim-ers, even if they don't ask for it. Many have benefited from
it, and no one has ever got beaten to death for doing it.
For
the budding programmers, all I can say, 'May the (vim's) force be with
you'.
--
Dilawar
EE, IITB