Tim's Web Log #3
Thoughts and opinions of an opinionated person

Mon, 06 Mar 2006

Vim Tricks
Being a command-line dinosaur, I use gvim for all of my editing, both on Windows and Linux. I handle projects for a number of different clients, and each of those clients has their own standards for tabbing, indentation, line length, and so on. One of the things I have missed in vim is the ability to have project-specific settings that cover an entire directory tree.

Well, with a few minutes of searching today, I discovered a way to do this. Vim has the ability to have certain commands executed based on the file name pattern; that's how it does syntax coloring, for instance. It turns out that this pattern matching is flexible enough to handle my case. I added this to my global _vimrc:

autocmd BufRead,BufNewFile c:/dev/client1/* so /dev/client1/_vimrc
autocmd BufRead,BufNewFile c:/dev/client2/* so /dev/client2/_vimrc
autocmd BufRead,BufNewFile c:/dev/client3/* so /dev/client3/_vimrc

Works as pretty as you please.



Name:


E-mail:


URL:


Comment:


Please enter "blog" here (without the quotes) so I know you are human and not a spam script:


About Me
E-mail Tim
Work info
Personal info
My big dog!
My little dog!
RSS feed

Archives
2010-Jan
2008-Nov
2008-Feb
2007-Oct
2007-Sep
2007-Jul
2007-May
2007-Feb
2006-Oct
2006-Sep
2006-Aug
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Jan
2004-Dec
2004-Nov
2004-Aug
2004-Jul
2004-Jun
2004-Apr
2004-Feb
2004-Jan
2003-Dec
2003-Nov
2003-Oct
2003-Sep
2003-Aug
2003-Jul
2003-Jun
2003-May
2003-Mar
2003-Feb
2003-Jan
2002-Dec

Categories


Web Sites
P&B company site
Python language site