Me and Vim

By markhop

After reading this post by Jamis Buck and this follow up I decided I too would “Go Home to VIM”, or at least give it a go.

I have been using various text editors on various platforms for the last couple of years, Crimson Editor on Windows and various Gnome editors on Ubuntu Linux, but my background in COBOL programming on Unix means I am comfortable with VI.

The first job was to install VIM and this was simply a case of downloading the latest release, 7.2, and running the installer. Having read certain other blogs and the like that indicate path names with spaces are bad for VIM I always install into either c:\opt\vim or c:\programs\vim (on Vista).

Once installed, run it up and we have VIM in a GUI in all its glory. Now on to settings. Following Jamis’ lead I have the following .vimrc file.

" Turn on line numbering by default
set number
" Show ruler line - to display line and column position of cursor
set ruler
" Syntax highlighting and file type stuff
syntax on
filetype on
" Allow buffer switching without the need to save
set hidden

I then look at editing certain different files to see if syntax highlighting is truely working. The only one where I found an issue was with a Pro*COBOL source file with a .pco extension so a few googles later and I ended up creating myself a filetype.vim file in my %USERPRIFILE%\vimfiles directory which contained this.

augroup filetypedetect
au BufNewFile,BufRead *.pco setf cobol
augroup END

I’ve not gone through all of Jamis’ settings yet to see if I want to use any of them but my usage of VIM has only just started. Stay tuned and I may let you in on how it goes…

Tags:

One Response to “Me and Vim”

  1. Steven Oliver Says:

    Not trying to gloat, but in the spirit of open sourceiness, I’ve got a pretty nice (by that I mean well commented) vimrc. I’ve also got links to another vimrc which more or less inspired mine.

    http://steveno.wordpress.com/vimrc/

    There is so much stuff you can do with vim it’s scary really.

Leave a Reply