| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim support file to detect file types | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | " Maintainer:	Bram Moolenaar <Bram@vim.org> | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | " Last Change:	2008 Aug 03 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Listen very carefully, I will say this only once | 
					
						
							|  |  |  | if exists("did_load_filetypes") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | let did_load_filetypes = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Line continuation is used here, remove 'C' from 'cpoptions' | 
					
						
							|  |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | augroup filetypedetect | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Ignored extensions | 
					
						
							| 
									
										
										
										
											2008-05-28 14:49:58 +00:00
										 |  |  | if exists("*fnameescape") | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.rpmsave,?\+.rpmnew | 
					
						
							| 
									
										
										
										
											2008-05-28 14:49:58 +00:00
										 |  |  | 	\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *~ | 
					
						
							|  |  |  | 	\ let s:name = expand("<afile>") | | 
					
						
							|  |  |  | 	\ let s:short = substitute(s:name, '\~$', '', '') | | 
					
						
							|  |  |  | 	\ if s:name != s:short && s:short != "" | | 
					
						
							| 
									
										
										
										
											2008-05-28 14:49:58 +00:00
										 |  |  | 	\   exe "doau filetypedetect BufRead " . fnameescape(s:short) | | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\ endif | | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | 	\ unlet! s:name s:short | 
					
						
							| 
									
										
										
										
											2005-09-25 22:16:38 +00:00
										 |  |  | au BufNewFile,BufRead ?\+.in | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\ if expand("<afile>:t") != "configure.in" | | 
					
						
							| 
									
										
										
										
											2008-05-28 14:49:58 +00:00
										 |  |  | 	\   exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) | | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\ endif | 
					
						
							| 
									
										
										
										
											2008-05-28 14:49:58 +00:00
										 |  |  | elseif &verbose > 0 | 
					
						
							|  |  |  |   echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()" | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Pattern used to match file names which should not be inspected. | 
					
						
							|  |  |  | " Currently finds compressed files. | 
					
						
							|  |  |  | if !exists("g:ft_ignore_pat") | 
					
						
							|  |  |  |   let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | " Function used for patterns that end in a star: don't set the filetype if the | 
					
						
							|  |  |  | " file name matches ft_ignore_pat. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:StarSetf(ft) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |   if expand("<amatch>") !~ g:ft_ignore_pat | 
					
						
							|  |  |  |     exe 'setf ' . a:ft | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Abaqus or Trasys | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.inp			call s:Check_inp() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:Check_inp() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if getline(1) =~ '^\*' | 
					
						
							|  |  |  |     setf abaqus | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     let n = 1 | 
					
						
							|  |  |  |     if line("$") > 500 | 
					
						
							|  |  |  |       let nmax = 500 | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |       let nmax = line("$") | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     while n <= nmax | 
					
						
							|  |  |  |       if getline(n) =~? "^header surface data" | 
					
						
							|  |  |  | 	setf trasys | 
					
						
							|  |  |  | 	break | 
					
						
							|  |  |  |       endif | 
					
						
							|  |  |  |       let n = n + 1 | 
					
						
							|  |  |  |     endwhile | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " A-A-P recipe | 
					
						
							|  |  |  | au BufNewFile,BufRead *.aap			setf aap | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " A2ps printing utility | 
					
						
							|  |  |  | au BufNewFile,BufRead etc/a2ps.cfg,etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-02 19:12:26 +00:00
										 |  |  | " ABAB/4 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.abap			setf abap | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " ABC music notation | 
					
						
							|  |  |  | au BufNewFile,BufRead *.abc			setf abc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " ABEL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.abl			setf abel | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " AceDB | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wrm			setf acedb | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Ada (83, 9X, 95) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.adb,*.ads,*.ada		setf ada | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | if has("vms") | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  |   au BufNewFile,BufRead *.gpr,*.ada_m,*.adc	setf ada | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  |   au BufNewFile,BufRead *.gpr			setf ada | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " AHDL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tdf			setf ahdl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " AMPL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.run			setf ampl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Ant | 
					
						
							|  |  |  | au BufNewFile,BufRead build.xml			setf ant | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Apache style config file | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead proftpd.conf*		call s:StarSetf('apachestyle') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Apache config file | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead .htaccess			 setf apache | 
					
						
							|  |  |  | au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf* call s:StarSetf('apache') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " XA65 MOS6510 cross assembler | 
					
						
							|  |  |  | au BufNewFile,BufRead *.a65			setf a65 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Applix ELF | 
					
						
							|  |  |  | au BufNewFile,BufRead *.am | 
					
						
							|  |  |  | 	\ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-13 20:26:32 +00:00
										 |  |  | " ALSA configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead ~/.asoundrc,/usr/share/alsa/alsa.conf,/etc/asound.conf	setf alsaconf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Arc Macro Language | 
					
						
							|  |  |  | au BufNewFile,BufRead *.aml			setf aml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Arch Inventory file | 
					
						
							|  |  |  | au BufNewFile,BufRead .arch-inventory,=tagging-method	setf arch | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " ART*Enterprise (formerly ART-IM) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.art			setf art | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " ASN.1 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.asn,*.asn1		setf asn | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Active Server Pages (with Visual Basic Script) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.asa | 
					
						
							|  |  |  | 	\ if exists("g:filetype_asa") | | 
					
						
							|  |  |  | 	\   exe "setf " . g:filetype_asa | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf aspvbs | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Active Server Pages (with Perl or Visual Basic Script) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.asp | 
					
						
							|  |  |  | 	\ if exists("g:filetype_asp") | | 
					
						
							|  |  |  | 	\   exe "setf " . g:filetype_asp | | 
					
						
							|  |  |  | 	\ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" | | 
					
						
							|  |  |  | 	\   setf aspperl | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf aspvbs | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Grub (must be before catch *.lst) | 
					
						
							| 
									
										
										
										
											2006-04-05 20:41:53 +00:00
										 |  |  | au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf,/etc/grub.conf	setf grub | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Assembly (all kinds) | 
					
						
							|  |  |  | " *.lst is not pure assembly, it has two extra columns (address, byte codes) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst	call s:FTasm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " This function checks for the kind of assembly that is wanted by the user, or | 
					
						
							|  |  |  | " can be detected from the first five lines of the file. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTasm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   " make sure b:asmsyntax exists | 
					
						
							|  |  |  |   if !exists("b:asmsyntax") | 
					
						
							|  |  |  |     let b:asmsyntax = "" | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if b:asmsyntax == "" | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |     call s:FTasmsyntax() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " if b:asmsyntax still isn't set, default to asmsyntax or GNU | 
					
						
							|  |  |  |   if b:asmsyntax == "" | 
					
						
							|  |  |  |     if exists("g:asmsyntax") | 
					
						
							|  |  |  |       let b:asmsyntax = g:asmsyntax | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |       let b:asmsyntax = "asm" | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   exe "setf " . fnameescape(b:asmsyntax) | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTasmsyntax() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   " see if file contains any asmsyntax=foo overrides. If so, change | 
					
						
							|  |  |  |   " b:asmsyntax appropriately | 
					
						
							|  |  |  |   let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). | 
					
						
							|  |  |  | 	\" ".getline(5)." " | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  |   let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') | 
					
						
							|  |  |  |   if match != '' | 
					
						
							|  |  |  |     let b:asmsyntax = match | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) | 
					
						
							|  |  |  |     let b:asmsyntax = "vmasm" | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Macro (VAX) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mar			setf vmasm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Atlas | 
					
						
							|  |  |  | au BufNewFile,BufRead *.atl,*.as		setf atlas | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Autoit v3 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.au3			setf autoit | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " Autohotkey | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ahk			setf autohotkey | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Automake | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am	setf automake | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Autotest .at files are actually m4 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.at			setf m4 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Avenue | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ave			setf ave | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Awk | 
					
						
							|  |  |  | au BufNewFile,BufRead *.awk			setf awk | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " B | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mch,*.ref,*.imp		setf b | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " BASIC or Visual Basic | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.bas			call s:FTVB("basic") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Check if one of the first five lines contains "VB_Name".  In that case it is | 
					
						
							|  |  |  | " probably a Visual Basic file.  Otherwise it's assumed to be "alt" filetype. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTVB(alt) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' | 
					
						
							|  |  |  |     setf vb | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     exe "setf " . a:alt | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Visual Basic Script (close to Visual Basic) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.vbs,*.dsm,*.ctl		setf vb | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " IBasic file (similar to QBasic) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.iba,*.ibi		setf ibasic | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " FreeBasic file (similar to QBasic) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.fb,*.bi			setf freebasic | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Batch file for MSDOS. | 
					
						
							| 
									
										
										
										
											2004-07-10 09:47:34 +00:00
										 |  |  | au BufNewFile,BufRead *.bat,*.sys		setf dosbatch | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd. | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cmd | 
					
						
							|  |  |  | 	\ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Batch file for 4DOS | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.btm			call s:FTbtm() | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTbtm() | 
					
						
							| 
									
										
										
										
											2004-07-10 09:47:34 +00:00
										 |  |  |   if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm | 
					
						
							|  |  |  |     setf dosbatch | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf btm | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " BC calculator | 
					
						
							|  |  |  | au BufNewFile,BufRead *.bc			setf bc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " BDF font | 
					
						
							|  |  |  | au BufNewFile,BufRead *.bdf			setf bdf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " BibTeX bibliography database file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.bib			setf bib | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-27 21:47:44 +00:00
										 |  |  | " BibTeX Bibliography Style | 
					
						
							|  |  |  | au BufNewFile,BufRead *.bst			setf bst | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " BIND configuration | 
					
						
							| 
									
										
										
										
											2004-12-31 20:58:58 +00:00
										 |  |  | au BufNewFile,BufRead named.conf,rndc.conf	setf named | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " BIND zone | 
					
						
							|  |  |  | au BufNewFile,BufRead named.root		setf bindzone | 
					
						
							| 
									
										
										
										
											2006-03-25 21:59:56 +00:00
										 |  |  | au BufNewFile,BufRead *.db			call s:BindzoneCheck('') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func! s:BindzoneCheck(default) | 
					
						
							|  |  |  |   if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' | 
					
						
							|  |  |  |     setf bindzone | 
					
						
							|  |  |  |   elseif a:default != '' | 
					
						
							|  |  |  |     exe 'setf ' . a:default | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Blank | 
					
						
							|  |  |  | au BufNewFile,BufRead *.bl			setf blank | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | " Blkid cache file | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/blkid.tab,/etc/blkid.tab.old   setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " C or lpc | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.c			call s:FTlpc() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTlpc() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:lpc_syntax_for_c") | 
					
						
							|  |  |  |     let lnum = 1 | 
					
						
							|  |  |  |     while lnum <= 12 | 
					
						
							|  |  |  |       if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)' | 
					
						
							|  |  |  | 	setf lpc | 
					
						
							|  |  |  | 	return | 
					
						
							|  |  |  |       endif | 
					
						
							|  |  |  |       let lnum = lnum + 1 | 
					
						
							|  |  |  |     endwhile | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   setf c | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Calendar | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead calendar			setf calendar | 
					
						
							|  |  |  | au BufNewFile,BufRead */.calendar/*, | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\*/share/calendar/*/calendar.*,*/share/calendar/calendar.* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\					call s:StarSetf('calendar') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " C# | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cs			setf cs | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " Cdrdao TOC | 
					
						
							|  |  |  | au BufNewFile,BufRead *.toc			setf cdrtoc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Cdrdao config | 
					
						
							|  |  |  | au BufNewFile,BufRead etc/cdrdao.conf,etc/defaults/cdrdao,etc/default/cdrdao,~/.cdrdao						setf cdrdaoconf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-12 20:58:49 +00:00
										 |  |  | " Cfengine | 
					
						
							|  |  |  | au BufNewFile,BufRead cfengine.conf		setf cfengine | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Comshare Dimension Definition Language | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cdl			setf cdl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Conary Recipe | 
					
						
							|  |  |  | au BufNewFile,BufRead *.recipe			setf conaryrecipe | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Controllable Regex Mutilator | 
					
						
							|  |  |  | au BufNewFile,BufRead *.crm			setf crm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Cyn++ | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cyn			setf cynpp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Cynlib | 
					
						
							|  |  |  | " .cc and .cpp files can be C++ or Cynlib. | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cc | 
					
						
							|  |  |  | 	\ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cpp | 
					
						
							|  |  |  | 	\ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " C++ | 
					
						
							|  |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " .h files can be C, Ch C++, ObjC or ObjC++. | 
					
						
							|  |  |  | " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is | 
					
						
							|  |  |  | " detected automatically. | 
					
						
							|  |  |  | au BufNewFile,BufRead *.h			call s:FTheader() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func! s:FTheader() | 
					
						
							|  |  |  |   if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 | 
					
						
							|  |  |  |     setf objc | 
					
						
							|  |  |  |   elseif exists("c_syntax_for_h") | 
					
						
							|  |  |  |     setf c | 
					
						
							|  |  |  |   elseif exists("ch_syntax_for_h") | 
					
						
							|  |  |  |     setf ch | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf cpp | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Ch (CHscript) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.chf			setf ch | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TLH files are C++ headers generated by Visual C++'s #import from typelibs | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tlh			setf cpp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Cascading Style Sheets | 
					
						
							|  |  |  | au BufNewFile,BufRead *.css			setf css | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Century Term Command Scripts (*.cmd too) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.con			setf cterm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Changelog | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch | 
					
						
							|  |  |  | 					\	setf debchangelog | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | au BufNewFile,BufRead [cC]hange[lL]og | 
					
						
							|  |  |  | 	\  if getline(1) =~ '; urgency=' | 
					
						
							|  |  |  | 	\|   setf debchangelog | 
					
						
							|  |  |  | 	\| else | 
					
						
							|  |  |  | 	\|   setf changelog | 
					
						
							|  |  |  | 	\| endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | au BufNewFile,BufRead NEWS | 
					
						
							|  |  |  | 	\  if getline(1) =~ '; urgency=' | 
					
						
							|  |  |  | 	\|   setf debchangelog | 
					
						
							|  |  |  | 	\| endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " CHILL | 
					
						
							|  |  |  | au BufNewFile,BufRead *..ch			setf chill | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Changes for WEB and CWEB or CHILL | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.ch			call s:FTchange() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " This function checks if one of the first ten lines start with a '@'.  In | 
					
						
							|  |  |  | " that case it is probably a change file. | 
					
						
							|  |  |  | " If the first line starts with # or ! it's probably a ch file. | 
					
						
							|  |  |  | " If a line has "main", "include", "//" ir "/*" it's probably ch. | 
					
						
							|  |  |  | " Otherwise CHILL is assumed. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTchange() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let lnum = 1 | 
					
						
							|  |  |  |   while lnum <= 10 | 
					
						
							|  |  |  |     if getline(lnum)[0] == '@' | 
					
						
							|  |  |  |       setf change | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!') | 
					
						
							|  |  |  |       setf ch | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if getline(lnum) =~ "MODULE" | 
					
						
							|  |  |  |       setf chill | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if getline(lnum) =~ 'main\s*(\|#\s*include\|//' | 
					
						
							|  |  |  |       setf ch | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let lnum = lnum + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf chill | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-21 22:12:41 +00:00
										 |  |  | " ChordPro | 
					
						
							|  |  |  | au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro	setf chordpro | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Clean | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dcl,*.icl		setf clean | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Clever | 
					
						
							|  |  |  | au BufNewFile,BufRead *.eni			setf cl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Clever or dtd | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.ent			call s:FTent() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTent() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   " This function checks for valid cl syntax in the first five lines. | 
					
						
							|  |  |  |   " Look for either an opening comment, '#', or a block start, '{". | 
					
						
							|  |  |  |   " If not found, assume SGML. | 
					
						
							|  |  |  |   let lnum = 1 | 
					
						
							|  |  |  |   while lnum < 6 | 
					
						
							|  |  |  |     let line = getline(lnum) | 
					
						
							|  |  |  |     if line =~ '^\s*[#{]' | 
					
						
							|  |  |  |       setf cl | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     elseif line !~ '^\s*$' | 
					
						
							|  |  |  |       " Not a blank line, not a comment, and not a block start, | 
					
						
							|  |  |  |       " so doesn't look like valid cl code. | 
					
						
							|  |  |  |       break | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let lnum = lnum + 1 | 
					
						
							|  |  |  |   endw | 
					
						
							|  |  |  |   setf dtd | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-12 23:22:24 +00:00
										 |  |  | " Clipper (or FoxPro; could also be eviews) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *.prg | 
					
						
							|  |  |  | 	\ if exists("g:filetype_prg") | | 
					
						
							|  |  |  | 	\   exe "setf " . g:filetype_prg | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf clipper | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-18 21:55:01 +00:00
										 |  |  | " Cmake | 
					
						
							|  |  |  | au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in		setf cmake | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Cmusrc | 
					
						
							|  |  |  | au BufNewFile,BufRead ~/.cmus/{autosave,rc,command-history,*.theme} setf cmusrc | 
					
						
							|  |  |  | au BufNewFile,BufRead */cmus/{rc,*.theme}			setf cmusrc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Cobol | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | au BufNewFile,BufRead *.cbl,*.cob,*.lib	setf cobol | 
					
						
							|  |  |  | "   cobol or zope form controller python script? (heuristic) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cpy | 
					
						
							|  |  |  | 	\ if getline(1) =~ '^##' | | 
					
						
							|  |  |  | 	\   setf python | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf cobol | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Coco/R | 
					
						
							|  |  |  | au BufNewFile,BufRead *.atg			setf coco | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Cold Fusion | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cfm,*.cfi,*.cfc		setf cf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Configure scripts | 
					
						
							|  |  |  | au BufNewFile,BufRead configure.in,configure.ac setf config | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " CUDA  Cumpute Unified Device Architecture | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cu			setf cuda | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " WildPackets EtherPeek Decoder | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dcd			setf dcd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Enlightenment configuration files | 
					
						
							|  |  |  | au BufNewFile,BufRead *enlightenment/*.cfg	setf c | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Eterm | 
					
						
							|  |  |  | au BufNewFile,BufRead *Eterm/*.cfg		setf eterm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Lynx config files | 
					
						
							|  |  |  | au BufNewFile,BufRead lynx.cfg			setf lynx | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Quake | 
					
						
							|  |  |  | au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg	setf quake | 
					
						
							|  |  |  | au BufNewFile,BufRead *quake[1-3]/*.cfg			setf quake | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Quake C | 
					
						
							|  |  |  | au BufNewFile,BufRead *.qc			setf c | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Configure files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cfg			setf cfg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Communicating Sequential Processes | 
					
						
							|  |  |  | au BufNewFile,BufRead *.csp,*.fdr		setf csp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " CUPL logic description and simulation | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pld			setf cupl | 
					
						
							|  |  |  | au BufNewFile,BufRead *.si			setf cuplsim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Debian Control | 
					
						
							|  |  |  | au BufNewFile,BufRead */debian/control		setf debcontrol | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead control | 
					
						
							|  |  |  | 	\  if getline(1) =~ '^Source:' | 
					
						
							|  |  |  | 	\|   setf debcontrol | 
					
						
							|  |  |  | 	\| endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 21:08:56 +00:00
										 |  |  | " Debian Sources.list | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/apt/sources.list	setf debsources | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Deny hosts | 
					
						
							|  |  |  | au BufNewFile,BufRead denyhosts.conf		setf denyhosts | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " ROCKLinux package description | 
					
						
							|  |  |  | au BufNewFile,BufRead *.desc			setf desc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " the D language or dtrace | 
					
						
							|  |  |  | au BufNewFile,BufRead *.d			call s:DtraceCheck() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func! s:DtraceCheck() | 
					
						
							|  |  |  |   let lines = getline(1, min([line("$"), 100])) | 
					
						
							|  |  |  |   if match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 | 
					
						
							|  |  |  |     setf dtrace | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf d | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Desktop files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.desktop,.directory	setf desktop | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Dict config | 
					
						
							|  |  |  | au BufNewFile,BufRead dict.conf,.dictrc		setf dictconf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dictd config | 
					
						
							|  |  |  | au BufNewFile,BufRead dictd.conf		setf dictdconf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Diff files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.diff,*.rej,*.patch	setf diff | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dircolors | 
					
						
							|  |  |  | au BufNewFile,BufRead .dir_colors,/etc/DIR_COLORS	setf dircolors | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Diva (with Skill) or InstallShield | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rul | 
					
						
							|  |  |  | 	\ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' | | 
					
						
							|  |  |  | 	\   setf ishd | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf diva | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " DCL (Digital Command Language - vms) or DNS zone file | 
					
						
							| 
									
										
										
										
											2006-03-25 21:59:56 +00:00
										 |  |  | au BufNewFile,BufRead *.com			call s:BindzoneCheck('dcl') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " DOT | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dot			setf dot | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dylan - lid files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lid			setf dylanlid | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dylan - intr files (melange) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.intr			setf dylanintr | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dylan | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dylan			setf dylan | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Microsoft Module Definition | 
					
						
							|  |  |  | au BufNewFile,BufRead *.def			setf def | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Dracula | 
					
						
							|  |  |  | au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe	setf dracula | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " dsl | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dsl			setf dsl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " DTD (Document Type Definition for XML) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dtd			setf dtd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " EDIF (*.edf,*.edif,*.edn,*.edo) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ed\(f\|if\|n\|o\)	setf edif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Embedix Component Description | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ecd			setf ecd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Eiffel or Specman | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.e,*.E			call s:FTe() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Elinks configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf	setf elinks | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTe() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 100 && n < line("$") | 
					
						
							|  |  |  |     if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" | 
					
						
							|  |  |  |       setf specman | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf eiffel | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " ERicsson LANGuage; Yaws is erlang too | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | au BufNewFile,BufRead *.erl,*.hrl,*.yaws	setf erlang | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Elm Filter Rules file | 
					
						
							|  |  |  | au BufNewFile,BufRead filter-rules		setf elmfilt | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-02-22 08:49:11 +00:00
										 |  |  | " ESMTP rc file | 
					
						
							|  |  |  | au BufNewFile,BufRead *esmtprc			setf esmtprc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " ESQL-C | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ec,*.EC			setf esqlc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-20 21:27:20 +00:00
										 |  |  | " Esterel | 
					
						
							|  |  |  | au BufNewFile,BufRead *.strl			setf esterel | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Essbase script | 
					
						
							|  |  |  | au BufNewFile,BufRead *.csc			setf csc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Exim | 
					
						
							|  |  |  | au BufNewFile,BufRead exim.conf			setf exim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Expect | 
					
						
							|  |  |  | au BufNewFile,BufRead *.exp			setf expect | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Exports | 
					
						
							|  |  |  | au BufNewFile,BufRead exports			setf exports | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-16 21:59:56 +00:00
										 |  |  | " Factor | 
					
						
							|  |  |  | au BufNewFile,BufRead *.factor			setf factor | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Fetchmail RC file | 
					
						
							|  |  |  | au BufNewFile,BufRead .fetchmailrc		setf fetchmail | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-27 21:47:44 +00:00
										 |  |  | " FlexWiki | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wiki			setf flexwiki | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Focus Executable | 
					
						
							|  |  |  | au BufNewFile,BufRead *.fex,*.focexec		setf focexec | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Focus Master file (but not for auto.master) | 
					
						
							|  |  |  | au BufNewFile,BufRead auto.master		setf conf | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mas,*.master		setf master | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Forth | 
					
						
							|  |  |  | au BufNewFile,BufRead *.fs,*.ft			setf forth | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Reva Forth | 
					
						
							|  |  |  | au BufNewFile,BufRead *.frt			setf reva | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Fortran | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95	 setf fortran | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead   *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95  setf fortran | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | " Framescript | 
					
						
							|  |  |  | au BufNewFile,BufRead *.fsl			setf framescript | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " FStab | 
					
						
							| 
									
										
										
										
											2006-04-05 20:41:53 +00:00
										 |  |  | au BufNewFile,BufRead fstab,mtab		setf fstab | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " GDB command files | 
					
						
							|  |  |  | au BufNewFile,BufRead .gdbinit			setf gdb | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " GDMO | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mo,*.gdmo		setf gdmo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Gedcom | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ged			setf gedcom | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Git | 
					
						
							|  |  |  | autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit | 
					
						
							|  |  |  | autocmd BufNewFile,BufRead *.git/config,.gitconfig setf gitconfig | 
					
						
							|  |  |  | autocmd BufNewFile,BufRead git-rebase-todo         setf gitrebase | 
					
						
							|  |  |  | autocmd BufNewFile,BufRead .msg.[0-9]* | 
					
						
							|  |  |  |       \ if getline(1) =~ '^From.*# This line is ignored.$' | | 
					
						
							|  |  |  |       \   setf gitsendemail | | 
					
						
							|  |  |  |       \ endif | 
					
						
							|  |  |  | autocmd BufNewFile,BufRead *.git/** | 
					
						
							|  |  |  |       \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | | 
					
						
							|  |  |  |       \   setf git | | 
					
						
							|  |  |  |       \ endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Gkrellmrc | 
					
						
							|  |  |  | au BufNewFile,BufRead gkrellmrc,gkrellmrc_?	setf gkrellmrc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " GP scripts (2.0 and onward) | 
					
						
							| 
									
										
										
										
											2006-04-12 21:52:12 +00:00
										 |  |  | au BufNewFile,BufRead *.gp,.gprc		setf gp | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " GPG | 
					
						
							|  |  |  | au BufNewFile,BufRead */.gnupg/options		setf gpg | 
					
						
							|  |  |  | au BufNewFile,BufRead */.gnupg/gpg.conf		setf gpg | 
					
						
							|  |  |  | au BufNewFile,BufRead /usr/**/gnupg/options.skel setf gpg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Gnuplot scripts | 
					
						
							|  |  |  | au BufNewFile,BufRead *.gpi			setf gnuplot | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " GrADS scripts | 
					
						
							|  |  |  | au BufNewFile,BufRead *.gs			setf grads | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-12 23:22:24 +00:00
										 |  |  | " Gretl | 
					
						
							|  |  |  | au BufNewFile,BufRead *.gretl			setf gretl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Groovy | 
					
						
							|  |  |  | au BufNewFile,BufRead *.groovy			setf groovy | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " GNU Server Pages | 
					
						
							|  |  |  | au BufNewFile,BufRead *.gsp			setf gsp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Group file | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | au BufNewFile,BufRead /etc/group,/etc/group-,/etc/group.edit,/etc/gshadow,/etc/gshadow-,/etc/gshadow.edit,/var/backups/group.bak,/var/backups/gshadow.bak  setf group | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " GTK RC | 
					
						
							|  |  |  | au BufNewFile,BufRead .gtkrc,gtkrc		setf gtkrc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " Haml | 
					
						
							|  |  |  | au BufNewFile,BufRead *.haml			setf haml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Hamster Classic | Playground files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.hsc,*.hsm		setf hamster | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Haskell | 
					
						
							|  |  |  | au BufNewFile,BufRead *.hs			setf haskell | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lhs			setf lhaskell | 
					
						
							|  |  |  | au BufNewFile,BufRead *.chs			setf chaskell | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Haste | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ht			setf haste | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | au BufNewFile,BufRead *.htpp			setf hastepreproc | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Hercules | 
					
						
							|  |  |  | au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum	setf hercules | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " HEX (Intel) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.hex,*.h32		setf hex | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Tilde (must be before HTML) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.t.html			setf tilde | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-08-24 22:16:11 +00:00
										 |  |  | " HTML (.shtml and .stm for server side) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm  call s:FThtml() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-23 22:59:57 +00:00
										 |  |  | " Distinguish between HTML, XHTML and Django | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FThtml() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 10 && n < line("$") | 
					
						
							|  |  |  |     if getline(n) =~ '\<DTD\s\+XHTML\s' | 
					
						
							|  |  |  |       setf xhtml | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							| 
									
										
										
										
											2006-03-23 22:59:57 +00:00
										 |  |  |     if getline(n) =~ '{%\s*\(extends\|block\)\>' | 
					
						
							|  |  |  |       setf htmldjango | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf html | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-08-24 22:16:11 +00:00
										 |  |  | " HTML with Ruby - eRuby | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | au BufNewFile,BufRead *.erb,*.rhtml		setf eruby | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " HTML with M4 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.html.m4			setf htmlm4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " HTML Cheetah template | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tmpl			setf htmlcheetah | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Host config | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/host.conf		setf hostconf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | " Hosts access | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/hosts.allow,/etc/hosts.deny  setf hostsaccess | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Hyper Builder | 
					
						
							|  |  |  | au BufNewFile,BufRead *.hb			setf hb | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Icon | 
					
						
							|  |  |  | au BufNewFile,BufRead *.icn			setf icon | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " IDL (Interface Description Language) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.idl			call s:FTidl() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Distinguish between standard IDL and MS-IDL | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTidl() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 50 && n < line("$") | 
					
						
							|  |  |  |     if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"' | 
					
						
							|  |  |  |       setf msidl | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf idl | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Microsoft IDL (Interface Description Language)  Also *.idl | 
					
						
							|  |  |  | " MOF = WMI (Windows Management Instrumentation) Managed Object Format | 
					
						
							|  |  |  | au BufNewFile,BufRead *.odl,*.mof		setf msidl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Icewm menu | 
					
						
							|  |  |  | au BufNewFile,BufRead */.icewm/menu		setf icemenu | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " Indent profile (must come before IDL *.pro!) | 
					
						
							|  |  |  | au BufNewFile,BufRead .indent.pro		setf indent | 
					
						
							|  |  |  | au BufNewFile,BufRead indent.pro		call s:ProtoCheck('indent') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " IDL (Interactive Data Language) | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | au BufNewFile,BufRead *.pro			call s:ProtoCheck('idlang') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Distinguish between "default" and Cproto prototype file. */ | 
					
						
							|  |  |  | func! s:ProtoCheck(default) | 
					
						
							|  |  |  |   " Cproto files have a comment in the first line and a function prototype in | 
					
						
							|  |  |  |   " the second line, it always ends in ";".  Indent files may also have | 
					
						
							|  |  |  |   " comments, thus we can't match comments to see the difference. | 
					
						
							|  |  |  |   if getline(2) =~ ';$' | 
					
						
							|  |  |  |     setf cpp | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     exe 'setf ' . a:default | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endfunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Indent RC | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | au BufNewFile,BufRead indentrc			setf indent | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Inform | 
					
						
							|  |  |  | au BufNewFile,BufRead *.inf,*.INF		setf inform | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Initng | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/initng/**/*.i,*.ii	setf initng | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-31 19:19:04 +00:00
										 |  |  | " Ipfilter | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules	setf ipfilter | 
					
						
							| 
									
										
										
										
											2005-01-31 19:19:04 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Informix 4GL (source - canonical, include file, I4GL+M4 preproc.) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl	setf fgl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " .INI file for MSDOS | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ini			setf dosini | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SysV Inittab | 
					
						
							|  |  |  | au BufNewFile,BufRead inittab			setf inittab | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Inno Setup | 
					
						
							|  |  |  | au BufNewFile,BufRead *.iss			setf iss | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " JAL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.jal,*.JAL		setf jal | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Jam | 
					
						
							|  |  |  | au BufNewFile,BufRead *.jpl,*.jpr		setf jam | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Java | 
					
						
							|  |  |  | au BufNewFile,BufRead *.java,*.jav		setf java | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " JavaCC | 
					
						
							|  |  |  | au BufNewFile,BufRead *.jj,*.jjt		setf javacc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " JavaScript, ECMAScript | 
					
						
							|  |  |  | au BufNewFile,BufRead *.js,*.javascript,*.es	setf javascript | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Java Server Pages | 
					
						
							|  |  |  | au BufNewFile,BufRead *.jsp			setf jsp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Java Properties resource file (note: doesn't catch font.properties.pl) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_??	setf jproperties | 
					
						
							|  |  |  | au BufNewFile,BufRead *.properties_??_??_*	call s:StarSetf('jproperties') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Jess | 
					
						
							|  |  |  | au BufNewFile,BufRead *.clp			setf jess | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Jgraph | 
					
						
							|  |  |  | au BufNewFile,BufRead *.jgr			setf jgraph | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Kixtart | 
					
						
							|  |  |  | au BufNewFile,BufRead *.kix			setf kix | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Kimwitu[++] | 
					
						
							|  |  |  | au BufNewFile,BufRead *.k			setf kwt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " KDE script | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ks			setf kscript | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  | " Kconfig | 
					
						
							|  |  |  | au BufNewFile,BufRead Kconfig,Kconfig.debug	setf kconfig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Lace (ISE) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ace,*.ACE		setf lace | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Latte | 
					
						
							|  |  |  | au BufNewFile,BufRead *.latte,*.lte		setf latte | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Limits | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/limits		setf limits | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " LambdaProlog (*.mod too, see Modsim) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sig			setf lprolog | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " LDAP LDIF | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ldif			setf ldif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Ld loader | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ld			setf ld | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Lex | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lex,*.l			setf lex | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Libao | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/libao.conf,*/.libao	setf libao | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Libsensors | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/sensors.conf		setf sensors | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " LFTP | 
					
						
							|  |  |  | au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc	setf lftp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Lifelines (or Lex for C++!) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ll			setf lifelines | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Lilo: Linux loader | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead lilo.conf*		call s:StarSetf('lilo') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp) | 
					
						
							|  |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " SBCL implementation of Common Lisp | 
					
						
							|  |  |  | au BufNewFile,BufRead sbclrc,.sbclrc		setf lisp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Lite | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lite,*.lt		setf lite | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " LiteStep RC files | 
					
						
							|  |  |  | au BufNewFile,BufRead */LiteStep/*/*.rc		setf litestep | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Login access | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/login.access		setf loginaccess | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Login defs | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/login.defs		setf logindefs | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Logtalk | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lgt			setf logtalk | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " LOTOS | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lot,*.lotos		setf lotos | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Lout (also: *.lt) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lou,*.lout		setf lout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Lua | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lua			setf lua | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Linden Scripting Language (Second Life) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lsl			setf lsl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Lynx style file (or LotusScript!) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.lss			setf lss | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " M4 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.m4 | 
					
						
							|  |  |  | 	\ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " MaGic Point | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mgp			setf mgp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Mail (for Elm, trn, mutt, muttng, rn, slrn) | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | " Mail aliases | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/mail/aliases,/etc/aliases	setf mailaliases | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Mailcap configuration file | 
					
						
							|  |  |  | au BufNewFile,BufRead .mailcap,mailcap		setf mailcap | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Makefile | 
					
						
							|  |  |  | au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " MakeIndex | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ist,*.mst		setf ist | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Manpage | 
					
						
							|  |  |  | au BufNewFile,BufRead *.man			setf man | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Man config | 
					
						
							| 
									
										
										
										
											2006-04-05 20:41:53 +00:00
										 |  |  | au BufNewFile,BufRead /etc/man.conf,man.config	setf manconf | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Maple V | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mv,*.mpl,*.mws		setf maple | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " Map (UMN mapserver config file) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.map			setf map | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Mason | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mason,*.mhtml		setf mason | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Matlab or Objective C | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.m			call s:FTm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 10 | 
					
						
							|  |  |  |     let line = getline(n) | 
					
						
							|  |  |  |     if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' | 
					
						
							|  |  |  |       setf objc | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if line =~ '^\s*%' | 
					
						
							|  |  |  |       setf matlab | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if line =~ '^\s*(\*' | 
					
						
							|  |  |  |       setf mma | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							| 
									
										
										
										
											2005-05-18 22:24:46 +00:00
										 |  |  |   if exists("g:filetype_m") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_m | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf matlab | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Mathematica notebook | 
					
						
							|  |  |  | au BufNewFile,BufRead *.nb			setf mma | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Maya Extension Language | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mel			setf mel | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Messages | 
					
						
							|  |  |  | au BufNewFile,BufRead /var/log/messages,/var/log/messages.*[0-9]  setf messages | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Metafont | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mf			setf mf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " MetaPost | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mp			setf mp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-23 21:32:16 +00:00
										 |  |  | " MGL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mgl			setf mgl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " MMIX or VMS makefile | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.mms			call s:FTmms() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Symbian meta-makefile definition (MMP) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mmp			setf mmp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTmms() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 10 | 
					
						
							|  |  |  |     let line = getline(n) | 
					
						
							|  |  |  |     if line =~ '^\s*\(%\|//\)' || line =~ '^\*' | 
					
						
							|  |  |  |       setf mmix | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if line =~ '^\s*#' | 
					
						
							|  |  |  |       setf make | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf mmix | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Modsim III (or LambdaProlog) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mod | 
					
						
							|  |  |  | 	\ if getline(1) =~ '\<module\>' | | 
					
						
							|  |  |  | 	\   setf lprolog | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf modsim3 | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Modula 2 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Modula 3 (.m3, .i3, .mg, .ig) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.[mi][3g]		setf modula3 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Monk | 
					
						
							|  |  |  | au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc	setf monk | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " MOO | 
					
						
							|  |  |  | au BufNewFile,BufRead *.moo			setf moo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Modconf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/modules.conf,/etc/conf.modules	setf modconf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/modutils/* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if executable(expand("<afile>")) != 1 | 
					
						
							|  |  |  | 	\|  call s:StarSetf('modconf') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Mplayer config | 
					
						
							|  |  |  | au BufNewFile,BufRead mplayer.conf,*/.mplayer/config	setf mplayerconf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Moterola S record | 
					
						
							|  |  |  | au BufNewFile,BufRead *.s19,*.s28,*.s37		setf srec | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-27 21:47:44 +00:00
										 |  |  | " Mrxvtrc | 
					
						
							|  |  |  | au BufNewFile,BufRead mrxvtrc,.mrxvtrc		setf mrxvtrc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Msql | 
					
						
							|  |  |  | au BufNewFile,BufRead *.msql			setf msql | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Mysql | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mysql			setf mysql | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " M$ Resource files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rc			setf rc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-02 15:38:35 +00:00
										 |  |  | " MuPAD source | 
					
						
							|  |  |  | au BufRead,BufNewFile *.mu			setf mupad | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Mush | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mush			setf mush | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Mutt setup file (also for Muttng) | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead Mutt{ng,}rc		setf muttrc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Nano | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/nanorc,.nanorc	setf nanorc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Nastran input/DMAP | 
					
						
							|  |  |  | "au BufNewFile,BufRead *.dat			setf nastran | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Natural | 
					
						
							|  |  |  | au BufNewFile,BufRead *.NS[ACGLMNPS]		setf natural | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-12-19 22:46:22 +00:00
										 |  |  | " Netrc | 
					
						
							|  |  |  | au BufNewFile,BufRead .netrc			setf netrc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Novell netware batch files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ncf			setf ncf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Nroff/Troff (*.ms and *.t are checked below) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.me | 
					
						
							|  |  |  | 	\ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" | | 
					
						
							|  |  |  | 	\   setf nroff | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom	setf nroff | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.[1-9]			call s:FTnroff() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " This function checks if one of the first five lines start with a dot.  In | 
					
						
							|  |  |  | " that case it is probably an nroff file: 'filetype' is set and 1 is returned. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTnroff() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' | 
					
						
							|  |  |  |     setf nroff | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   return 0 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Nroff or Objective C++ | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.mm			call s:FTmm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTmm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 10 | 
					
						
							|  |  |  |     let line = getline(n) | 
					
						
							|  |  |  |     if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' | 
					
						
							|  |  |  |       setf objcpp | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf nroff | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Not Quite C | 
					
						
							|  |  |  | au BufNewFile,BufRead *.nqc			setf nqc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " NSIS | 
					
						
							|  |  |  | au BufNewFile,BufRead *.nsi			setf nsis | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " OCAML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly	setf ocaml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Occam | 
					
						
							|  |  |  | au BufNewFile,BufRead *.occ			setf occam | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Omnimark | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xom,*.xin		setf omnimark | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " OpenROAD | 
					
						
							|  |  |  | au BufNewFile,BufRead *.or			setf openroad | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " OPL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.[Oo][Pp][Ll]		setf opl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Oracle config file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ora			setf ora | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Packet filter conf | 
					
						
							|  |  |  | au BufNewFile,BufRead pf.conf			setf pf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Pam conf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/pam.conf		setf pamconf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " PApp | 
					
						
							|  |  |  | au BufNewFile,BufRead *.papp,*.pxml,*.pxsl	setf papp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Password file | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | au BufNewFile,BufRead /etc/passwd,/etc/passwd-,/etc/passwd.edit,/etc/shadow,/etc/shadow-,/var/backups/passwd.bak,/var/backups/shadow.bak setf passwd | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Pascal (also *.p) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pas			setf pascal | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Delphi project file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.dpr			setf pascal | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " PDF | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pdf			setf pdf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Perl | 
					
						
							|  |  |  | if has("fname_case") | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |   au BufNewFile,BufRead *.pl,*.PL		call s:FTpl() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | else | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |   au BufNewFile,BufRead *.pl			call s:FTpl() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-30 16:16:41 +00:00
										 |  |  | au BufNewFile,BufRead *.plx			setf perl | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTpl() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_pl") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_pl | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     " recognize Prolog by specific text in the first non-empty line | 
					
						
							|  |  |  |     " require a blank after the '%' because Perl uses "%list" and "%translate" | 
					
						
							|  |  |  |     let l = getline(nextnonblank(1)) | 
					
						
							|  |  |  |     if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' | 
					
						
							|  |  |  |       setf prolog | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |       setf perl | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Perl, XPM or XPM2 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pm | 
					
						
							|  |  |  | 	\ if getline(1) =~ "XPM2" | | 
					
						
							|  |  |  | 	\   setf xpm2 | | 
					
						
							|  |  |  | 	\ elseif getline(1) =~ "XPM" | | 
					
						
							|  |  |  | 	\   setf xpm | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf perl | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Perl POD | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pod			setf pod | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-28 22:39:47 +00:00
										 |  |  | " Php, php3, php4, etc. | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Also Phtml (was used for PHP 2 in the past) | 
					
						
							|  |  |  | " Also .ctp for Cake template file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp	setf php | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Pike | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Pinfo config | 
					
						
							|  |  |  | au BufNewFile,BufRead */etc/pinforc,*/.pinforc	setf pinfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Palm Resource compiler | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rcp			setf pilrc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Pine config | 
					
						
							|  |  |  | au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex		setf pine | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PL/M (also: *.inp) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.plm,*.p36,*.pac		setf plm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PL/SQL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pls,*.plsql		setf plsql | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PLP | 
					
						
							|  |  |  | au BufNewFile,BufRead *.plp			setf plp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PO and PO template (GNU gettext) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.po,*.pot		setf po | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Postfix main config | 
					
						
							|  |  |  | au BufNewFile,BufRead main.cf			setf pfmain | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PostScript (+ font files, encapsulated PostScript, Adobe Illustrator) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai	  setf postscr | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PostScript Printer Description | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ppd			setf ppd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Povray | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pov			setf pov | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Povray configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead .povrayrc			setf povini | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Povray, PHP or assembly | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.inc			call s:FTinc() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTinc() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_inc") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_inc | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     let lines = getline(1).getline(2).getline(3) | 
					
						
							|  |  |  |     if lines =~? "perlscript" | 
					
						
							|  |  |  |       setf aspperl | 
					
						
							|  |  |  |     elseif lines =~ "<%" | 
					
						
							|  |  |  |       setf aspvbs | 
					
						
							|  |  |  |     elseif lines =~ "<?" | 
					
						
							|  |  |  |       setf php | 
					
						
							|  |  |  |     else | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |       call s:FTasmsyntax() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |       if exists("b:asmsyntax") | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | 	exe "setf " . fnameescape(b:asmsyntax) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |       else | 
					
						
							|  |  |  | 	setf pov | 
					
						
							|  |  |  |       endif | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Printcap and Termcap | 
					
						
							|  |  |  | au BufNewFile,BufRead *printcap | 
					
						
							|  |  |  | 	\ let b:ptcap_type = "print" | setf ptcap | 
					
						
							|  |  |  | au BufNewFile,BufRead *termcap | 
					
						
							|  |  |  | 	\ let b:ptcap_type = "term" | setf ptcap | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PCCTS / ANTRL | 
					
						
							|  |  |  | "au BufNewFile,BufRead *.g			setf antrl | 
					
						
							|  |  |  | au BufNewFile,BufRead *.g			setf pccts | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " PPWizard | 
					
						
							|  |  |  | au BufNewFile,BufRead *.it,*.ih			setf ppwiz | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Oracle Pro*C/C++ | 
					
						
							| 
									
										
										
										
											2007-05-15 07:12:25 +00:00
										 |  |  | au BufNewFile,BufRead *.pc			setf proc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Privoxy actions file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.action			setf privoxy | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Procmail | 
					
						
							|  |  |  | au BufNewFile,BufRead .procmail,.procmailrc	setf procmail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Progress or CWEB | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.w			call s:FTprogress_cweb() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTprogress_cweb() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_w") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_w | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE' | 
					
						
							|  |  |  |     setf progress | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf cweb | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Progress or assembly | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.i			call s:FTprogress_asm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTprogress_asm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_i") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_i | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   " This function checks for an assembly comment the first ten lines. | 
					
						
							|  |  |  |   " If not found, assume Progress. | 
					
						
							|  |  |  |   let lnum = 1 | 
					
						
							| 
									
										
										
										
											2005-08-29 22:25:38 +00:00
										 |  |  |   while lnum <= 10 && lnum < line('$') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     let line = getline(lnum) | 
					
						
							|  |  |  |     if line =~ '^\s*;' || line =~ '^\*' | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |       call s:FTasm() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |       return | 
					
						
							|  |  |  |     elseif line !~ '^\s*$' || line =~ '^/\*' | 
					
						
							|  |  |  |       " Not an empty line: Doesn't look like valid assembly code. | 
					
						
							|  |  |  |       " Or it looks like a Progress /* comment | 
					
						
							|  |  |  |       break | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let lnum = lnum + 1 | 
					
						
							|  |  |  |   endw | 
					
						
							|  |  |  |   setf progress | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Progress or Pascal | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.p			call s:FTprogress_pascal() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTprogress_pascal() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_p") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_p | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   " This function checks for valid Pascal syntax in the first ten lines. | 
					
						
							|  |  |  |   " Look for either an opening comment or a program start. | 
					
						
							|  |  |  |   " If not found, assume Progress. | 
					
						
							|  |  |  |   let lnum = 1 | 
					
						
							| 
									
										
										
										
											2005-08-29 22:25:38 +00:00
										 |  |  |   while lnum <= 10 && lnum < line('$') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     let line = getline(lnum) | 
					
						
							| 
									
										
										
										
											2005-08-29 22:25:38 +00:00
										 |  |  |     if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\ || line =~ '^\s*{' || line =~ '^\s*(\*' | 
					
						
							|  |  |  |       setf pascal | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     elseif line !~ '^\s*$' || line =~ '^/\*' | 
					
						
							|  |  |  |       " Not an empty line: Doesn't look like valid Pascal code. | 
					
						
							|  |  |  |       " Or it looks like a Progress /* comment | 
					
						
							|  |  |  |       break | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let lnum = lnum + 1 | 
					
						
							|  |  |  |   endw | 
					
						
							|  |  |  |   setf progress | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Software Distributor Product Specification File (POSIX 1387.2-1995) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.psf			setf psf | 
					
						
							|  |  |  | au BufNewFile,BufRead INDEX,INFO | 
					
						
							|  |  |  | 	\ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' | | 
					
						
							|  |  |  | 	\   setf psf | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Prolog | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pdb			setf prolog | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Promela | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pml			setf promela | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Protocols | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/protocols		setf protocols | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Pyrex | 
					
						
							|  |  |  | au BufNewFile,BufRead *.pyx,*.pxd		setf pyrex | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Python | 
					
						
							|  |  |  | au BufNewFile,BufRead *.py,*.pyw		setf python | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | " Quixote (Python-based web framework) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ptl			setf python | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Radiance | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rad,*.mat		setf radiance | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Ratpoison config/command files | 
					
						
							|  |  |  | au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc	setf ratpoison | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " RCS file | 
					
						
							|  |  |  | au BufNewFile,BufRead *\,v			setf rcs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Readline | 
					
						
							| 
									
										
										
										
											2005-04-15 21:13:42 +00:00
										 |  |  | au BufNewFile,BufRead .inputrc,inputrc		setf readline | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Registry for MS-Windows | 
					
						
							|  |  |  | au BufNewFile,BufRead *.reg | 
					
						
							|  |  |  | 	\ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Renderman Interface Bytestream | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rib			setf rib | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Rexx | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead *.rexx,*.rex,*.jrexx,*.rxj,*.orx	setf rexx | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " R (Splus) | 
					
						
							| 
									
										
										
										
											2006-04-18 21:55:01 +00:00
										 |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.s,*.S			setf r | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.s			setf r | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-01 22:09:21 +00:00
										 |  |  | " R Help file | 
					
						
							| 
									
										
										
										
											2006-04-18 21:55:01 +00:00
										 |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.rd,*.Rd		setf rhelp | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.rd			setf rhelp | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " R noweb file | 
					
						
							|  |  |  | if has("fname_case") | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw		setf rnoweb | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   au BufNewFile,BufRead *.rnw,*.snw			setf rnoweb | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2006-03-01 22:09:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Rexx, Rebol or R | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.r,*.R			call s:FTr() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTr() | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |   let max = line("$") > 50 ? 50 : line("$") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   for n in range(1, max) | 
					
						
							|  |  |  |     " Rebol is easy to recognize, check for that first | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  |     if getline(n) =~? '\<REBOL\>' | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |       setf rebol | 
					
						
							|  |  |  |       return | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     endif | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |   endfor | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   for n in range(1, max) | 
					
						
							|  |  |  |     " R has # comments | 
					
						
							|  |  |  |     if getline(n) =~ '^\s*#' | 
					
						
							|  |  |  |       setf r | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     " Rexx has /* comments */ | 
					
						
							|  |  |  |     if getline(n) =~ '^\s*/\*' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |       setf rexx | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |       return | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     endif | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  |   endfor | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Nothing recognized, assume Rexx | 
					
						
							|  |  |  |   setf rexx | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Remind | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead .reminders*		call s:StarSetf('remind') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Resolv.conf | 
					
						
							|  |  |  | au BufNewFile,BufRead resolv.conf		setf resolv | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Relax NG Compact | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rnc			setf rnc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " RPL/2 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rpl			setf rpl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Robots.txt | 
					
						
							|  |  |  | au BufNewFile,BufRead robots.txt		setf robots | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Rpcgen | 
					
						
							|  |  |  | au BufNewFile,BufRead *.x			setf rpcgen | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " reStructuredText Documentation Format | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rst			setf rst | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " RTF | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rtf			setf rtf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-18 10:54:50 +00:00
										 |  |  | " Interactive Ruby shell | 
					
						
							|  |  |  | au BufNewFile,BufRead .irbrc,irbrc		setf ruby | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Ruby | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec	setf ruby | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " Ruby on Rails | 
					
						
							|  |  |  | au BufNewFile,BufRead *.builder,*.rxml,*.rjs	setf ruby | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Rantfile and Rakefile is like Ruby | 
					
						
							|  |  |  | au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake	setf ruby | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " S-lang (or shader language!) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sl			setf slang | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Samba config | 
					
						
							|  |  |  | au BufNewFile,BufRead smb.conf			setf samba | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SAS script | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sas			setf sas | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " Sass | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sass			setf sass | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Sather | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sa			setf sather | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Scilab | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | au BufNewFile,BufRead *.sci,*.sce		setf scilab | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " SD: Streaming Descriptors | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sd			setf sd | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " SDL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sdl,*.pr		setf sdl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " sed | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sed			setf sed | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-12-09 21:34:53 +00:00
										 |  |  | " Sieve (RFC 3028) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.siv			setf sieve | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Sendmail | 
					
						
							|  |  |  | au BufNewFile,BufRead sendmail.cf		setf sm | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Sendmail .mc files are actually m4.  Could also be MS Message text file. | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mc			call s:McSetf() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func! s:McSetf() | 
					
						
							|  |  |  |   " Rely on the file to start with a comment. | 
					
						
							|  |  |  |   " MS message text files use ';', Sendmail files use '#' or 'dnl' | 
					
						
							|  |  |  |   for lnum in range(1, min([line("$"), 20])) | 
					
						
							|  |  |  |     let line = getline(lnum) | 
					
						
							|  |  |  |     if line =~ '^\s*\(#\|dnl\)' | 
					
						
							|  |  |  |       setf m4  " Sendmail .mc file | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     elseif line =~ '^\s*;' | 
					
						
							|  |  |  |       setf msmessages  " MS Message text file | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endfor | 
					
						
							|  |  |  |   setf m4  " Default: Sendmail .mc file | 
					
						
							|  |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Services | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/services		setf services | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Service Location config | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/slp.conf		setf slpconf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Service Location registration | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/slp.reg		setf slpreg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Service Location SPI | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/slp.spi		setf slpspi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Setserial config | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/serial.conf		setf setserial | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " SGML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sgm,*.sgml | 
					
						
							|  |  |  | 	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' | | 
					
						
							|  |  |  | 	\   setf sgmllnx | | 
					
						
							|  |  |  | 	\ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' | | 
					
						
							|  |  |  | 	\   let b:docbk_type="sgml" | | 
					
						
							|  |  |  | 	\   setf docbk | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf sgml | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SGMLDECL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.decl,*.dcl,*.dec | 
					
						
							|  |  |  | 	\ if getline(1).getline(2).getline(3) =~? '^<!SGML' | | 
					
						
							|  |  |  | 	\    setf sgmldecl | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SGML catalog file | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead catalog			setf catalog | 
					
						
							|  |  |  | au BufNewFile,BufRead sgml.catalog*		call s:StarSetf('catalog') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. | 
					
						
							|  |  |  | " Gentoo ebuilds are actually bash scripts | 
					
						
							|  |  |  | au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,*.bash,*.ebuild call SetFileTypeSH("bash") | 
					
						
							|  |  |  | au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | " Also called from scripts.vim. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! SetFileTypeSH(name) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |   if expand("<amatch>") =~ g:ft_ignore_pat | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if a:name =~ '\<ksh\>' | 
					
						
							|  |  |  |     let b:is_kornshell = 1 | 
					
						
							|  |  |  |     if exists("b:is_bash") | 
					
						
							|  |  |  |       unlet b:is_bash | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if exists("b:is_sh") | 
					
						
							|  |  |  |       unlet b:is_sh | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>' | 
					
						
							|  |  |  |     let b:is_bash = 1 | 
					
						
							|  |  |  |     if exists("b:is_kornshell") | 
					
						
							|  |  |  |       unlet b:is_kornshell | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if exists("b:is_sh") | 
					
						
							|  |  |  |       unlet b:is_sh | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   elseif a:name =~ '\<sh\>' | 
					
						
							|  |  |  |     let b:is_sh = 1 | 
					
						
							|  |  |  |     if exists("b:is_kornshell") | 
					
						
							|  |  |  |       unlet b:is_kornshell | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if exists("b:is_bash") | 
					
						
							|  |  |  |       unlet b:is_bash | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |   call SetFileTypeShell("sh") | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " For shell-like file types, check for an "exec" command hidden in a comment, | 
					
						
							|  |  |  | " as used for Tcl. | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | " Also called from scripts.vim, thus can't be local to this script. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! SetFileTypeShell(name) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  |   if expand("<amatch>") =~ g:ft_ignore_pat | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |   let l = 2 | 
					
						
							|  |  |  |   while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' | 
					
						
							|  |  |  |     " Skip empty and comment lines. | 
					
						
							|  |  |  |     let l = l + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' | 
					
						
							|  |  |  |     " Found an "exec" line after a comment with continuation | 
					
						
							|  |  |  |     let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') | 
					
						
							|  |  |  |     if n =~ '\<tclsh\|\<wish' | 
					
						
							|  |  |  |       setf tcl | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |   exe "setf " . a:name | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " tcsh scripts | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  | au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login	call SetFileTypeShell("tcsh") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh) | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call s:CSH() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:CSH() | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   if exists("g:filetype_csh") | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |     call SetFileTypeShell(g:filetype_csh) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   elseif &shell =~ "tcsh" | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |     call SetFileTypeShell("tcsh") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   else | 
					
						
							| 
									
										
										
										
											2004-10-07 21:02:47 +00:00
										 |  |  |     call SetFileTypeShell("csh") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Z-Shell script | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead .zprofile,/etc/zprofile,.zfbfmarks  setf zsh | 
					
						
							|  |  |  | au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh') | 
					
						
							| 
									
										
										
										
											2008-08-06 17:06:04 +00:00
										 |  |  | au BufNewFile,BufRead *.zsh 			setf zsh | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Scheme | 
					
						
							|  |  |  | au BufNewFile,BufRead *.scm,*.ss		setf scheme | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Screen RC | 
					
						
							|  |  |  | au BufNewFile,BufRead .screenrc,screenrc	setf screen | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Simula | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sim			setf simula | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SINDA | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sin,*.s85		setf sinda | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-05 20:41:53 +00:00
										 |  |  | " SiSU | 
					
						
							| 
									
										
										
										
											2006-05-02 22:08:30 +00:00
										 |  |  | au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu | 
					
						
							| 
									
										
										
										
											2006-04-05 20:41:53 +00:00
										 |  |  | au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " SKILL | 
					
						
							| 
									
										
										
										
											2005-06-17 22:00:15 +00:00
										 |  |  | au BufNewFile,BufRead *.il,*.ils,*.cdf		setf skill | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " SLRN | 
					
						
							|  |  |  | au BufNewFile,BufRead .slrnrc			setf slrnrc | 
					
						
							|  |  |  | au BufNewFile,BufRead *.score			setf slrnsc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-18 22:24:46 +00:00
										 |  |  | " Smalltalk (and TeX) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.st			setf st | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cls | 
					
						
							|  |  |  | 	\ if getline(1) =~ '^%' | | 
					
						
							|  |  |  | 	\  setf tex | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\  setf st | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Smarty templates | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tpl			setf smarty | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SMIL or XML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.smil | 
					
						
							|  |  |  | 	\ if getline(1) =~ '<?\s*xml.*?>' | | 
					
						
							|  |  |  | 	\   setf xml | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf smil | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SMIL or SNMP MIB file | 
					
						
							|  |  |  | au BufNewFile,BufRead *.smi | 
					
						
							|  |  |  | 	\ if getline(1) =~ '\<smil\>' | | 
					
						
							|  |  |  | 	\   setf smil | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf mib | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SMITH | 
					
						
							|  |  |  | au BufNewFile,BufRead *.smt,*.smith		setf smith | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-02 22:08:30 +00:00
										 |  |  | " Snobol4 and spitbol | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sno,*.spt		setf snobol4 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " SNMP MIB files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.mib,*.my		setf mib | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Snort Configuration | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | au BufNewFile,BufRead *.hog,snort.conf,vision.conf	setf hog | 
					
						
							|  |  |  | au BufNewFile,BufRead *.rules			call s:FTRules() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' | 
					
						
							|  |  |  | func! s:FTRules() | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  |   if expand('<amatch>:p') =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$' | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  |     setf udevrules | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  |   try | 
					
						
							|  |  |  |     let config_lines = readfile('/etc/udev/udev.conf') | 
					
						
							|  |  |  |   catch /^Vim\%((\a\+)\)\=:E484/ | 
					
						
							|  |  |  |     setf hog | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   endtry | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  |   let dir = expand('<amatch>:p:h') | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  |   for line in config_lines | 
					
						
							|  |  |  |     if line =~ s:ft_rules_udev_rules_pattern | 
					
						
							|  |  |  |       let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  |       if dir == udev_rules | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  |         setf udevrules | 
					
						
							|  |  |  |       endif | 
					
						
							|  |  |  |       break | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |   endfor | 
					
						
							|  |  |  |   setf hog | 
					
						
							|  |  |  | endfunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Spec (Linux RPM) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.spec			setf spec | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Speedup (AspenTech plant simulator) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.speedup,*.spdata,*.spd	setf spup | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Slice | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ice			setf slice | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Spice | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sp,*.spice		setf spice | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Spyce | 
					
						
							|  |  |  | au BufNewFile,BufRead *.spy,*.spi		setf spyce | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Squid | 
					
						
							|  |  |  | au BufNewFile,BufRead squid.conf		setf squid | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-02 19:12:26 +00:00
										 |  |  | " SQL for Oracle Designer | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks	setf sql | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SQL | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.sql			call s:SQL() | 
					
						
							| 
									
										
										
										
											2004-09-02 19:12:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:SQL() | 
					
						
							| 
									
										
										
										
											2004-09-02 19:12:26 +00:00
										 |  |  |   if exists("g:filetype_sql") | 
					
						
							|  |  |  |     exe "setf " . g:filetype_sql | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setf sql | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " SQLJ | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sqlj			setf sqlj | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SQR | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sqr,*.sqi		setf sqr | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " OpenSSH configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead ssh_config,*/.ssh/config	setf sshconfig | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " OpenSSH server configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead sshd_config		setf sshdconfig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-15 20:25:09 +00:00
										 |  |  | " Stata | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata   setf stata | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " SMCL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl	setf smcl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Stored Procedures | 
					
						
							|  |  |  | au BufNewFile,BufRead *.stp			setf stp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Standard ML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sml			setf sml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Sratus VOS command macro | 
					
						
							|  |  |  | au BufNewFile,BufRead *.cm			setf voscm | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Sysctl | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/sysctl.conf		setf sysctl | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-12-19 22:46:22 +00:00
										 |  |  | " Sudoers | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/sudoers,sudoers.tmp	setf sudoers | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  | " If the file has an extension of 't' and is in a directory 't' then it is | 
					
						
							|  |  |  | " almost certainly a Perl test file. | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  | " If the first line starts with '#' and contains 'perl' it's probably a Perl | 
					
						
							|  |  |  | " file. | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  | " (Slow test) If a file contains a 'use' statement then it is almost certainly | 
					
						
							|  |  |  | " a Perl file. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTperl() | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  |   if expand("%:e") == 't' && expand("%:p:h:t") == 't' | 
					
						
							|  |  |  |     setf perl | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  |   if getline(1)[0] == '#' && getline(1) =~ 'perl' | 
					
						
							|  |  |  |     setf perl | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  |   if search('^use\s\s*\k', 'nc', 30) | 
					
						
							|  |  |  |     setf perl | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  |   return 0 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Tads (or Nroff or Perl test file) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *.t | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  | 	\ if !s:FTnroff() && !s:FTperl() | setf tads | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Tags | 
					
						
							|  |  |  | au BufNewFile,BufRead tags			setf tags | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TAK | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tak			setf tak | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-23 21:25:05 +00:00
										 |  |  | " Tcl (JACL too) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl	setf tcl | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " TealInfo | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tli			setf tli | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Telix Salt | 
					
						
							|  |  |  | au BufNewFile,BufRead *.slt			setf tsalt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Terminfo | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ti			setf terminfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TeX | 
					
						
							| 
									
										
										
										
											2005-06-30 22:04:15 +00:00
										 |  |  | au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl	setf tex | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tex			call s:FTtex() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-24 22:46:53 +00:00
										 |  |  | " Choose context, plaintex, or tex (LaTeX) based on these rules: | 
					
						
							|  |  |  | " 1. Check the first line of the file for "%&<format>". | 
					
						
							|  |  |  | " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. | 
					
						
							|  |  |  | " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTtex() | 
					
						
							| 
									
										
										
										
											2006-03-24 22:46:53 +00:00
										 |  |  |   let firstline = getline(1) | 
					
						
							|  |  |  |   if firstline =~ '^%&\s*\a\+' | 
					
						
							|  |  |  |     let format = tolower(matchstr(firstline, '\a\+')) | 
					
						
							|  |  |  |     let format = substitute(format, 'pdf', '', '') | 
					
						
							|  |  |  |     if format == 'tex' | 
					
						
							|  |  |  |       let format = 'plain' | 
					
						
							| 
									
										
										
										
											2005-06-30 22:04:15 +00:00
										 |  |  |     endif | 
					
						
							| 
									
										
										
										
											2006-02-27 23:58:35 +00:00
										 |  |  |   else | 
					
						
							| 
									
										
										
										
											2006-03-24 22:46:53 +00:00
										 |  |  |     " Default value, may be changed later: | 
					
						
							|  |  |  |     let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' | 
					
						
							|  |  |  |     " Save position, go to the top of the file, find first non-comment line. | 
					
						
							|  |  |  |     let save_cursor = getpos('.') | 
					
						
							|  |  |  |     call cursor(1,1) | 
					
						
							|  |  |  |     let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) | 
					
						
							|  |  |  |     if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. | 
					
						
							|  |  |  |       let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' | 
					
						
							|  |  |  |       let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' | 
					
						
							|  |  |  |       let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', | 
					
						
							|  |  |  | 			      \ 'cnp', firstNC + 1000) | 
					
						
							|  |  |  |       if kwline == 1	" lpat matched | 
					
						
							|  |  |  | 	let format = 'latex' | 
					
						
							|  |  |  |       elseif kwline == 2	" cpat matched | 
					
						
							|  |  |  | 	let format = 'context' | 
					
						
							|  |  |  |       endif		" If neither matched, keep default set above. | 
					
						
							|  |  |  |       " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) | 
					
						
							|  |  |  |       " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) | 
					
						
							|  |  |  |       " if cline > 0 | 
					
						
							|  |  |  |       "   let format = 'context' | 
					
						
							|  |  |  |       " endif | 
					
						
							|  |  |  |       " if lline > 0 && (cline == 0 || cline > lline) | 
					
						
							|  |  |  |       "   let format = 'tex' | 
					
						
							|  |  |  |       " endif | 
					
						
							|  |  |  |     endif " firstNC | 
					
						
							|  |  |  |     call setpos('.', save_cursor) | 
					
						
							|  |  |  |   endif " firstline =~ '^%&\s*\a\+' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Translation from formats to file types.  TODO:  add AMSTeX, RevTex, others? | 
					
						
							|  |  |  |   if format == 'plain' | 
					
						
							|  |  |  |     setf plaintex | 
					
						
							|  |  |  |   elseif format == 'context' | 
					
						
							|  |  |  |     setf context | 
					
						
							|  |  |  |   else " probably LaTeX | 
					
						
							| 
									
										
										
										
											2006-02-27 23:58:35 +00:00
										 |  |  |     setf tex | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2006-03-24 22:46:53 +00:00
										 |  |  |   return | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2005-06-30 22:04:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " ConTeXt | 
					
						
							|  |  |  | au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv   setf context | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Texinfo | 
					
						
							|  |  |  | au BufNewFile,BufRead *.texinfo,*.texi,*.txi	setf texinfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TeX configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead texmf.cnf			setf texmf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Tidy config | 
					
						
							|  |  |  | au BufNewFile,BufRead .tidyrc,tidyrc		setf tidy | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TF mud client | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tf,.tfrc,tfrc		setf tf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-10-24 19:18:58 +00:00
										 |  |  | " TPP - Text Presentation Program | 
					
						
							|  |  |  | au BufNewFile,BufReadPost *.tpp			setf tpp | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-12 20:58:49 +00:00
										 |  |  | " Trustees | 
					
						
							|  |  |  | au BufNewFile,BufRead trustees.conf		setf trustees | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " TSS - Geometry | 
					
						
							|  |  |  | au BufNewFile,BufReadPost *.tssgm		setf tssgm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TSS - Optics | 
					
						
							|  |  |  | au BufNewFile,BufReadPost *.tssop		setf tssop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " TSS - Command Line (temporary) | 
					
						
							|  |  |  | au BufNewFile,BufReadPost *.tsscl		setf tsscl | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Motif UIT/UIL files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.uit,*.uil		setf uil | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Udev conf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/udev/udev.conf	setf udevconf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Udev permissions | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/udev/permissions.d/*.permissions setf udevperm | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | " Udev symlinks config | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/udev/cdsymlinks.conf	setf sh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " UnrealScript | 
					
						
							|  |  |  | au BufNewFile,BufRead *.uc			setf uc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Updatedb | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/updatedb.conf	setf updatedb | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-18 21:55:01 +00:00
										 |  |  | " Vera | 
					
						
							|  |  |  | au BufNewFile,BufRead *.vr,*.vri,*.vrh		setf vera | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Verilog HDL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.v			setf verilog | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-08-15 21:41:48 +00:00
										 |  |  | " Verilog-AMS HDL | 
					
						
							|  |  |  | au BufNewFile,BufRead *.va,*.vams		setf verilogams | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " VHDL | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst  setf vhdl | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | au BufNewFile,BufRead *.vhdl_[0-9]*		call s:StarSetf('vhdl') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Vim script | 
					
						
							| 
									
										
										
										
											2006-03-21 21:29:36 +00:00
										 |  |  | au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc	setf vim | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Viminfo file | 
					
						
							|  |  |  | au BufNewFile,BufRead .viminfo,_viminfo		setf viminfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Virata Config Script File | 
					
						
							|  |  |  | au BufRead,BufNewFile *.hw,*.module,*.pkg	setf virata | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Visual Basic (also uses *.bas) or FORM | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *.frm			call s:FTVB("form") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " SaxBasic is close to Visual Basic | 
					
						
							|  |  |  | au BufNewFile,BufRead *.sba			setf vb | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Vgrindefs file | 
					
						
							|  |  |  | au BufNewFile,BufRead vgrindefs			setf vgrindefs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " VRML V1.0c | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wrl			setf vrml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Webmacro | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wm			setf webmacro | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Wget config | 
					
						
							|  |  |  | au BufNewFile,BufRead .wgetrc,wgetrc		setf wget | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Website MetaLanguage | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wml			setf wml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Winbatch | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wbt			setf winbatch | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-13 22:15:53 +00:00
										 |  |  | " WSML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.wsml			setf wsml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " WvDial | 
					
						
							|  |  |  | au BufNewFile,BufRead wvdial.conf,.wvdialrc	setf wvdial | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " CVS RC file | 
					
						
							|  |  |  | au BufNewFile,BufRead .cvsrc			setf cvsrc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " CVS commit file | 
					
						
							|  |  |  | au BufNewFile,BufRead cvs\d\+			setf cvs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment | 
					
						
							|  |  |  | " lines in a WEB file). | 
					
						
							|  |  |  | au BufNewFile,BufRead *.web | 
					
						
							|  |  |  | 	\ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" | | 
					
						
							|  |  |  | 	\   setf web | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf winbatch | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Windows Scripting Host and Windows Script Component | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ws[fc]			setf wsh | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " XHTML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xhtml,*.xht		setf xhtml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " X Pixmap (dynamically sets colors, use BufEnter to make it work better) | 
					
						
							|  |  |  | au BufEnter *.xpm | 
					
						
							|  |  |  | 	\ if getline(1) =~ "XPM2" | | 
					
						
							|  |  |  | 	\   setf xpm2 | | 
					
						
							|  |  |  | 	\ else | | 
					
						
							|  |  |  | 	\   setf xpm | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | au BufEnter *.xpm2				setf xpm2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " XFree86 config | 
					
						
							|  |  |  | au BufNewFile,BufRead XF86Config | 
					
						
							|  |  |  | 	\ if getline(1) =~ '\<XConfigurator\>' | | 
					
						
							|  |  |  | 	\   let b:xf86c_xfree86_version = 3 | | 
					
						
							|  |  |  | 	\ endif | | 
					
						
							|  |  |  | 	\ setf xf86conf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Xorg config | 
					
						
							|  |  |  | au BufNewFile,BufRead xorg.conf,xorg.conf-4	let b:xf86c_xfree86_version = 4 | setf xf86conf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Xinetd conf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/xinetd.conf		setf xinetd | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " XS Perl extension interface language | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xs			setf xs | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " X resources file | 
					
						
							|  |  |  | au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Xmath | 
					
						
							|  |  |  | au BufNewFile,BufRead *.msc,*.msf		setf xmath | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ms | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if !s:FTnroff() | setf xmath | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " XML  specific variants: docbk and xbl | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xml			call s:FTxml() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func! s:FTxml() | 
					
						
							|  |  |  |   let n = 1 | 
					
						
							|  |  |  |   while n < 100 && n < line("$") | 
					
						
							|  |  |  |     let line = getline(n) | 
					
						
							|  |  |  |     if line =~ '<!DOCTYPE.*DocBook' | 
					
						
							|  |  |  |       let b:docbk_type = "xml" | 
					
						
							|  |  |  |       setf docbk | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     if line =~ 'xmlns:xbl="http://www.mozilla.org/xbl"' | 
					
						
							|  |  |  |       setf xbl | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n += 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf xml | 
					
						
							|  |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " XMI (holding UML models) is also XML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xmi			setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " CSPROJ files are Visual Studio.NET's XML-based project config files | 
					
						
							|  |  |  | au BufNewFile,BufRead *.csproj,*.csproj.user	setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Qt Linguist translation source and Qt User Interface Files are XML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.ts,*.ui			setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.tpm			setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-04 22:49:24 +00:00
										 |  |  | " Xdg menus | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/xdg/menus/*.menu	setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " ATI graphics driver configuration | 
					
						
							|  |  |  | au BufNewFile,BufRead fglrxrc			setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " XLIFF (XML Localisation Interchange File Format) is also XML | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xlf			setf xml | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xliff			setf xml | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " X11 xmodmap (also see below) | 
					
						
							|  |  |  | au BufNewFile,BufRead *Xmodmap			setf xmodmap | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-07-18 21:58:11 +00:00
										 |  |  | " Xquery | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy	setf xquery | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " XSD | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xsd			setf xsd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Xslt | 
					
						
							|  |  |  | au BufNewFile,BufRead *.xsl,*.xslt		setf xslt | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Yacc | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | au BufNewFile,BufRead *.yy			setf yacc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Yacc or racc | 
					
						
							|  |  |  | au BufNewFile,BufRead *.y			call s:FTy() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | func! s:FTy() | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  |   let n = 1 | 
					
						
							| 
									
										
										
										
											2005-08-19 20:40:30 +00:00
										 |  |  |   while n < 100 && n < line("$") | 
					
						
							|  |  |  |     let line = getline(n) | 
					
						
							|  |  |  |     if line =~ '^\s*%' | 
					
						
							|  |  |  |       setf yacc | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							| 
									
										
										
										
											2005-08-16 23:01:50 +00:00
										 |  |  |     if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include' | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  |       setf racc | 
					
						
							|  |  |  |       return | 
					
						
							|  |  |  |     endif | 
					
						
							|  |  |  |     let n = n + 1 | 
					
						
							|  |  |  |   endwhile | 
					
						
							|  |  |  |   setf yacc | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | endfunc | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Yaml | 
					
						
							|  |  |  | au BufNewFile,BufRead *.yaml,*.yml		setf yaml | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | " Zope | 
					
						
							|  |  |  | "   dtml (zope dynamic template markup language), pt (zope page template), | 
					
						
							|  |  |  | "   cpt (zope form controller page template) | 
					
						
							| 
									
										
										
										
											2006-04-11 21:38:50 +00:00
										 |  |  | au BufNewFile,BufRead *.dtml,*.pt,*.cpt		call s:FThtml() | 
					
						
							| 
									
										
										
										
											2006-03-26 21:06:50 +00:00
										 |  |  | "   zsql (zope sql method) | 
					
						
							|  |  |  | au BufNewFile,BufRead *.zsql			call s:SQL() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Z80 assembler asz80 | 
					
						
							|  |  |  | au BufNewFile,BufRead *.z8a			setf z8a | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Source the user-specified filetype file, for backwards compatibility with | 
					
						
							|  |  |  | " Vim 5.x. | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | if exists("myfiletypefile") && filereadable(expand(myfiletypefile)) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   execute "source " . myfiletypefile | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Check for "*" after loading myfiletypefile, so that scripts.vim is only used | 
					
						
							|  |  |  | " when there are no matching file name extensions. | 
					
						
							|  |  |  | " Don't do this for compressed files. | 
					
						
							|  |  |  | augroup filetypedetect | 
					
						
							|  |  |  | au BufNewFile,BufRead * | 
					
						
							|  |  |  | 	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat | 
					
						
							|  |  |  | 	\ | runtime! scripts.vim | endif | 
					
						
							|  |  |  | au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Extra checks for when no filetype has been detected now.  Mostly used for | 
					
						
							|  |  |  | " patterns that end in "*".  E.g., "zsh*" matches "zsh.vim", but that's a Vim | 
					
						
							|  |  |  | " script file. | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | " Most of these should call s:StarSetf() to avoid names ending in .gz and the | 
					
						
							|  |  |  | " like are used. | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | " More Apache files. | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/apache2/conf.*/*,/etc/apache2/sites-*/*,/etc/apache2/mods-*/*		call s:StarSetf('apache') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-20 23:22:24 +00:00
										 |  |  | " Asterisk config file | 
					
						
							| 
									
										
										
										
											2006-04-30 18:54:39 +00:00
										 |  |  | au BufNewFile,BufRead *asterisk/*.conf*		call s:StarSetf('asterisk') | 
					
						
							| 
									
										
										
										
											2006-03-21 21:29:36 +00:00
										 |  |  | au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm') | 
					
						
							| 
									
										
										
										
											2005-09-20 23:22:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | " Bazaar version control | 
					
						
							|  |  |  | au BufNewFile,BufRead bzr_log.*			setf bzr | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " BIND zone | 
					
						
							| 
									
										
										
										
											2006-03-25 21:59:56 +00:00
										 |  |  | au BufNewFile,BufRead */named/db.*,*/bind/db.*	call s:StarSetf('bindzone') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Changelog | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead [cC]hange[lL]og* | 
					
						
							|  |  |  | 	\ if getline(1) =~ '; urgency=' | 
					
						
							|  |  |  | 	\|  call s:StarSetf('debchangelog') | 
					
						
							|  |  |  | 	\|else | 
					
						
							|  |  |  | 	\|  call s:StarSetf('changelog') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Crontab | 
					
						
							| 
									
										
										
										
											2008-07-13 17:41:49 +00:00
										 |  |  | au BufNewFile,BufRead crontab,crontab.*,/etc/cron.d/*		call s:StarSetf('crontab') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 21:08:56 +00:00
										 |  |  | " Debian Sources.list | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/apt/sources.list.d/*	call s:StarSetf('debsources') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Dracula | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead drac.*			call s:StarSetf('dracula') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Fvwm | 
					
						
							| 
									
										
										
										
											2007-05-05 18:24:42 +00:00
										 |  |  | au BufNewFile,BufRead */.fvwm/*			call s:StarSetf('fvwm') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ let b:fvwm_version = 1 | call s:StarSetf('fvwm') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *fvwm2rc* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if expand("<afile>:e") == "m4" | 
					
						
							|  |  |  | 	\|  call s:StarSetf('fvwm2m4') | 
					
						
							|  |  |  | 	\|else | 
					
						
							|  |  |  | 	\|  let b:fvwm_version = 2 | call s:StarSetf('fvwm') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " GTK RC | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead .gtkrc*,gtkrc*		call s:StarSetf('gtkrc') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Jam | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead Prl*.*,JAM*.*		call s:StarSetf('jam') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Jargon | 
					
						
							|  |  |  | au! BufNewFile,BufRead *jarg* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE' | 
					
						
							|  |  |  | 	\|  call s:StarSetf('jargon') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-19 21:23:36 +00:00
										 |  |  | " Kconfig | 
					
						
							|  |  |  | au BufNewFile,BufRead Kconfig.*			call s:StarSetf('kconfig') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Makefile | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead [mM]akefile*		call s:StarSetf('make') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Ruby Makefile | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead [rR]akefile*		call s:StarSetf('ruby') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | " Mail (also matches muttrc.vim, so this is below the other checks) | 
					
						
							|  |  |  | au BufNewFile,BufRead mutt[[:alnum:]._-]\{6\}	setf mail | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Modconf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/modprobe.*		call s:StarSetf('modconf') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Mutt setup file | 
					
						
							| 
									
										
										
										
											2008-06-25 20:13:35 +00:00
										 |  |  | au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc*	call s:StarSetf('muttrc') | 
					
						
							| 
									
										
										
										
											2005-08-19 20:40:30 +00:00
										 |  |  | au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc*		call s:StarSetf('muttrc') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Nroff macros | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead tmac.*			call s:StarSetf('nroff') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Pam conf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/pam.d/*		call s:StarSetf('pamconf') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Printcap and Termcap | 
					
						
							|  |  |  | au BufNewFile,BufRead *printcap* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if !did_filetype() | 
					
						
							|  |  |  | 	\|  let b:ptcap_type = "print" | call s:StarSetf('ptcap') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead *termcap* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if !did_filetype() | 
					
						
							|  |  |  | 	\|  let b:ptcap_type = "term" | call s:StarSetf('ptcap') | 
					
						
							|  |  |  | 	\|endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Vim script | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *vimrc*			call s:StarSetf('vim') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Subversion commit file | 
					
						
							| 
									
										
										
										
											2004-12-31 20:58:58 +00:00
										 |  |  | au BufNewFile,BufRead svn-commit*.tmp		setf svn | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " X resources file | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " XFree86 config | 
					
						
							|  |  |  | au BufNewFile,BufRead XF86Config-4* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ let b:xf86c_xfree86_version = 4 | call s:StarSetf('xf86conf') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | au BufNewFile,BufRead XF86Config* | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | 	\ if getline(1) =~ '\<XConfigurator\>' | 
					
						
							|  |  |  | 	\|  let b:xf86c_xfree86_version = 3 | 
					
						
							|  |  |  | 	\|endif | 
					
						
							|  |  |  | 	\|call s:StarSetf('xf86conf') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " X11 xmodmap | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead *xmodmap*			call s:StarSetf('xmodmap') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-29 22:40:58 +00:00
										 |  |  | " Xinetd conf | 
					
						
							|  |  |  | au BufNewFile,BufRead /etc/xinetd.d/*		call s:StarSetf('xinetd') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Z-Shell script | 
					
						
							| 
									
										
										
										
											2005-03-18 20:25:31 +00:00
										 |  |  | au BufNewFile,BufRead zsh*,zlog*		call s:StarSetf('zsh') | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Generic configuration file (check this last, it's just guessing!) | 
					
						
							|  |  |  | au BufNewFile,BufRead,StdinReadPost * | 
					
						
							|  |  |  | 	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat | 
					
						
							|  |  |  | 	\    && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' | 
					
						
							|  |  |  | 	\	|| getline(4) =~ '^#' || getline(5) =~ '^#') | | 
					
						
							|  |  |  | 	\   setf conf | | 
					
						
							|  |  |  | 	\ endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Use the plugin-filetype checks last, they may overrule any of the previously | 
					
						
							|  |  |  | " detected filetypes. | 
					
						
							|  |  |  | runtime! ftdetect/*.vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " If the GUI is already running, may still need to install the Syntax menu. | 
					
						
							|  |  |  | " Don't do it when the 'M' flag is included in 'guioptions'. | 
					
						
							|  |  |  | if has("menu") && has("gui_running") | 
					
						
							|  |  |  |       \ && !exists("did_install_syntax_menu") && &guioptions !~# "M" | 
					
						
							|  |  |  |   source <sfile>:p:h/menu.vim | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-10 18:44:18 +00:00
										 |  |  | " Function called for testing all functions defined here.  These are | 
					
						
							|  |  |  | " script-local, thus need to be executed here. | 
					
						
							|  |  |  | " Returns a string with error messages (hopefully empty). | 
					
						
							|  |  |  | func! TestFiletypeFuncs(testlist) | 
					
						
							|  |  |  |   let output = '' | 
					
						
							|  |  |  |   for f in a:testlist | 
					
						
							|  |  |  |     try | 
					
						
							|  |  |  |       exe f | 
					
						
							|  |  |  |     catch | 
					
						
							|  |  |  |       let output = output . "\n" . f . ": " . v:exception | 
					
						
							|  |  |  |     endtry | 
					
						
							|  |  |  |   endfor | 
					
						
							|  |  |  |   return output | 
					
						
							|  |  |  | endfunc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Restore 'cpoptions' | 
					
						
							|  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save |