Vim Tips Wiki
Advertisement

At first:

  • Start typing something by pressing i.
  • Exit vim by pressing Esc then writing :q and pressing Enter
  • 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 Newriders Vimdoc. Also has lots of other howtos 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.
  • Start with VimTutor or the IRC Style Tutorial on this 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 featureset 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 coloured list. You can jump to the corresponding line/file with either Return or when click on it, if `mouse' is set to a (:set mouse=a).
  • touch $HOME/.vimrc
  • Read the BestTips page.
  • Find and read lots of example vimrc files. You can find a few on the VimRcExamples page.
  • Learn how to use visual and blockwise-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 keybindings can be, you'll never want to go back.
  • Learn how to use Ctrl-P and Ctrl-N to tell vim to complete the word you are currently typing. This saves me a LOT of time when I am coding.
Advertisement