NL Smith's Vim Page


Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a “programmer's editor,” and so useful for programming that many consider it an entire Integrated Development Environment. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.


Configuration Files

The config file I use is based on John Lam's .vimrc file I found somewhere. It has options specific for Ruby and JavaScript, but is great for anything. The color scheme is based on the Vibrant Ink theme for TextMate.

Add Ons


Enhanced JavaScript Indentation

Vim's default indentation settings treat the JavaScript syntax like C, which can be a pain if you're trying to type JSON or object literals. Put this in the indent folder of your Vim installation for friendly behavior:

js.asp Syntax Highlighting

I like to name my ASP JScript files with a '.js.asp' extension, but Vim doesn't treat them like Javascripts after that. To get the javascript syntax highligting to work change your filetype.vim like this:

" Active Server Pages (with Perl or Visual Basic Script [or Javascript
" {js.asp}])
au BufNewFile,BufRead *.asp
  \ if exists("g:filetype_asp") |
  \   exe "setf " . g:filetype_asp |
  \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
  \   setf aspperl |
  \ elseif getline(1) =~? "^\<%.*%\>" |
  \   setf aspvbs |
  \ else |
  \   setf javascript |
  \ endif