Donal wrote:


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 :(

Here's an example of a .vim/filetype.vim file, used to select a syntax (in this case, asave.vim).

====================================================
" filetype.vim:
" Author: Charles E. Campbell, Jr.
" Date:   September 25, 2000

if exists("did_load_myfiletypes")
finish
endif
let did_load_myfiletypes= 1

augroup filetypedetect
 au BufNewFile,BufReadPost asav*.txt                    setf asave
augroup END
====================================================

If you have a file that needs a bit of snooping to determine what type it is, you may also have a .vim/scripts.vim file. Again, here's an example:

====================================================
" DrChip's scripts -- ie. those files which are ambiguously named
" so I have to do further testing to see if they qualify for specific
" syntax stuff
if !has("syntax_items")

 " handles my tmp[0-9]* debugging files
 if expand("<afile>") =~ '^tmp'
  if getline(2) =~ "^|" || getline(3) =~ "^|"
   setf dbg
  endif
 endif
endif
====================================================

If you're using Windows, then instead of ~/.vim/ you'll need to use --wherever--\vimfiles\ ...

Furthermore, if you want a personal syntax file, put it into
.vim/syntax

And, if you merely wish to extend syntax, put a same-name-as-the-filetype.vim file with the extensions in
.vim/after/syntax

Regards,
Chip Campbell

Reply via email to