(Please excuse the terrible way that I have to post this - normally the comments are above the command, but slashdot was freaking out...)
Here is my
.vimrc file:
:com Openvimrc :tabnew ~/.vimrc " custom command to edit the _vimrc file from anywhere
:nnoremap <C-J> 5j " custom key mapping: CTRL-J -> move down 5 lines
:nnoremap <C-K> 5k " custom key mapping: CTRL-K -> move up 5 lines
:nmap <C-t> :tabnew<cr> " custom key mapping: CTRL-T -> open new tab
:nmap <C-tab> :tabnext<cr> " custom key mapping: CTRL-TAB -> move to next tab
:nmap <C-S-tab> :tabprevious<cr> " custom key mapping: CTRL-SHIFT-TAB -> move to previous tab
:autocmd BufEnter * lcd %:p:h " auto set the current working directory to be the same as the buffer's
:filetype on " toggle filetype detection
:filetype plugin on " toggle filetype plugins
:set number " turn on line numbering
:set tabstop=4 " indentation level
:set expandtab " convert tab key to spaces
:set shiftwidth=4 " indent/outdent
:set shiftround " always indent/outdent to nearest tabstop
:syntax on " turn on syntax highlighting
:au BufWinEnter * let w:m1=matchadd('ErrorMsg','\%81v.*',-1) " lines that are > 80 characters are error highlighted by default
:com SetLengthWarning :let w:m1=matchadd('ErrorMsg','\%81v.*',-1) " custom command to set > 80 character highlighting
:com UnsetLengthWarning :call matchdelete(w:m1) " custom command to unset > 80 character highlighting
:set backspace=indent,eol,start " allow backspace over everything
:set noerrorbells visualbell t_vb= " kill the bells
if has("gui_running") " gui specific properties
:set guioptions-=T " hide the GUI toolbar
:set guioptions-=m " hide the GUI menu
:colorscheme inkpot " set the color scheme
:set guifont=Anonymous:h13 " set the GUI font
:set lines=46 columns=100 " set the window size
else " cterm specific properties
:colorscheme default " set the color scheme
:hi LineNr ctermfg=red " set line numbering color to red
endif
(END)
There are some things to note. There are some commands in my
.vimrc which will highlight text that has crossed the 80 character threshold. In order for those commands to work, vim7.2 or greater must be installed. Also, tab support was not added until vim7.0 I think. My gvim font is from
http://www.ms-studio.com/FontSales/anonymous.html>. If you want some excellent colorschemes, check out
http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/>. Finally, I just discovered this a couple of days ago
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/>: an awesome vim trick to use with irb.