VIM—at last

I’m so tired of using a lame editor.

For a while I’ve been using the Eclipse editor which is a little better than Notepad, but not all that much. And it takes a ton of time to load it up. Then I picked up Jedit, which is better, but I’ve never really learned to use it. On Linux I’ve used Gedit, which is about the same. I’ve made a couple of half-hearted runs at emacs. Finally, I decided to take the plunge.

Emacs or vim? Emacs of vim? I read a couple of comparisons, and finally decided vim. Why? Emacs was rated best overall for text, vim for programming. My need is programming. That was that.

I downloaded and installed VIM, and then started looking for resources to help me learn. This is not random S&#* I learned today, but over the last week or so. Here are some things that I found—as much for my own reference as anything else.

  • Vim Introduction and Tutorial.  A simple intro by a guy, who like me, made the emacs/vim decision for vim
  • If you want a much more complete tutorial, there’s VIM the tutorial, a 500+ page opus, with much more detail than the rather dense Vim Introduction.
  • If you want to SEE how to use advanced VIM, then VimCasts.org is where you want to go. Here is the archive of episodes. Of note, I set up my VIM plugins with git and pathogen according to the ideas in this webcast.
  • Tammer Saleh is a Rails programmer and Guru who uses pathogen to manage a whole bunch of his Vim/Ruby extensions. His recipe, along with a Ruby script for managing the extensions is here. After a great deal of agonizing, I ended up modifying my .vimrc, vimrc, and Saleh’s script. Here are my versions.
 

~/.vimrc
source ~/.vim/vimrc  #all it does is load vimrc, I can keep .vim under version control.

~/.vim/vimrc
set rtp+=~/.vim #Make sure that VIM looks here, which it does not do on Windows. Why? Who knows?
source ~/.vim/autoload/pathogen.vim #autoload pathogen so the rest works. May be redundant.
call pathogen#runtime_append_all_bundles() #pathogen initialization
call pathogen#helptags()
set number #I like to always have line numbers
filetype plugin indent on #now make sure that all the right things are turned on
syntax on #syntax sensitivity, also

To learn how to use vim I went through the tutorial provided with vim, called vimtutor. On Windows there’s a batch file in the installation directory that will run it. It walks you through features and gives you a short exercise to do for each. Even better is this at github. As explained here by its author, It has a set of drills based on vimtutor, vimtutor gives you knowledge, this one has practice and leads to mastery. Here’s a nice cheat sheet and graphical tutorial.
  • On the subject of mastery, and harking back to my desire to actually learn how to type more skillfully, I found TTCoach, a vim package to teach typing. It provides exercises and also gives you statistics on typing speed and error rate (including error rate by finger!)
  • I may try VIM plugin this, too: AsNeeded. As the number of plugins grows, VIM start time slows. This is a solution to the problem.
  • I’ve also got taglist, for letting you navigate through a set of files using ctags info. The documentation is here. CTags goes from reference to definition. CScope goes the other way. It provides a way to find where-used lists for functions. A tutorial for using the two in combination is here. The Win32 version of CScope is here.

More as I learn more.

Comments

Popular Posts