On Tue, May 16, 2006 at 11:22:00AM -0500, Donal wrote: > At 10:30 PM 5/15/2006, you wrote: > >On Mon, May 15, 2006 at 12:01:35PM -0500, Donal wrote: > >> > >> Here is my vim\myfiletypes.vim > >> > >> " myfiletypes.vim > >> augroup filetype > >> " FoxPro > >> au! BufRead,BufNewFile *.prg,*.mpr,*.spr set filetype=foxpro > >> " Cold Fusion > >> au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf > >> au! BufRead,BufNewFile *.cfml,*.cfm set filetype=cf > >> augroup END > >> > >> What am I doing wrong? > > > > My first guess is that > > > >:au filetype BufRead > > > >will give you the hint you need. > > This is from vim70\filetype.vim: > > " Clipper (or FoxPro; could also be eviews) > au BufNewFile,BufRead *.prg > \ if exists("g:filetype_prg") | > \ exe "setf " . g:filetype_prg | > \ else | > \ setf clipper | > \ endif > > And I have confirmed that clipper.vim IS the script being used. Here > is a question... is myfiletypes.vim still being used, or has it been > deprecated? I started using vim way back in 3.x... all I can find in > the help files refers to filetypedetect and the ftdetect directory... > > By searching on filetype I found a reference to myfiletypefile that > mentions that myfiletypes.vim is for backward support for vim 5.x > only... so it looks like it may have been recently removed. This > would explain alot... I guess I better read up on using the ftdetect > directory :(
I am sticking with my first guess for now. As I hinted, and another post said explicitly, your :au! command is clearing out the autocommand you defined for *.prg . I do not recall the order in which these things are :source'd, but you can check with :scriptnames whether vim is reading your myfiletypes.vim file, and if so whether it is being read before or after the default one. Depending on which comes first, it may make a difference whether you use :setf or :set ft , since the former has no effect if 'filetype' is already set. HTH --Benji Fisher