How to Install Vimtutor?
How to Install Vimtutor?
There are many Vim tutorials and Vim tips on the Web.
However, I find the vimtutor provides the best tutorial among those so far as I found on the Web while the vimtutor seems usually reachable from a terminal which is not known to Vim beginners who are usually Linux beginners too. This page shows the content of the Vim tutorial from the command vimtutor in a web page which is especially easier for Vim beginners to get and learn.
- Install Cygwin with vim, open a Cygwin Terminal and type vimtutor.
At first:
- Start typing something by pressing
i
. - Exit Vim by pressing
Esc
then writing:q
and pressingEnter
- Save your file similarly but using
:w myfile.txt
Getting help:
:help :help
- how to use help:help :helpgrep
- how to use the searchable help- Learn to use the
:help
. Know the difference between:help foo
,:help 'foo
and:help c_foo
. - Try
Ctrl-D
completion on help topics - Refer to the Vimdoc website for HTML versions of the Vim docs and electronic copy of the New riders Vimdoc. Also has lots of other how-tos and useful documents.
Other tips:
- If you find yourself trying to do some major text munging on a file, and digging through the
:
help for esoteric regex tricks, consider using Perl if you know it better. Otherwise, take a look atCategory:Searching
andCategory:Advanced_Regex
. - Start with Vimtutor or the IRC Style Tutorial on the #vim IRC channel site.
- Don't worry about trying to know everything about Vim, just learn features that are useful for what you are currently doing – as time goes on, your personal feature set will grow.
- Use
:make
and:grep
instead of:!make
or:!grep
. Then use:cwin
or:copen
to view the results of either make or grep in a colored list. You can jump to the corresponding line/file with eitherReturn
or when click on it, if 'mouse' is set to a (:set mouse=a
). - touch
$HOME/.vimrc
- Find and read lots of example vimrc files. You can find a few on the VimRcExamples page.
- Learn how to use visual and block wise-visual modes. Type
:help visual-use
to get started. - Learn how to avoid using the arrow keys. I cut out a piece of cardboard and put them over my arrow keys to force myself to learn how to navigate using the keys on the home row almost exclusively. Once you learn how efficient vi key bindings can be, you'll never want to go back.
- Learn how to use
Ctrl-P
andCtrl-N
to tell Vim to complete the word you are currently typing. This saves me a LOT of time when I am coding.