xref: /vim-8.2.3635/runtime/filetype.vim (revision 95bafa29)
1" Vim support file to detect file types
2"
3" Maintainer:	Bram Moolenaar <[email protected]>
4" Last Change:	2018 May 04
5
6" Listen very carefully, I will say this only once
7if exists("did_load_filetypes")
8  finish
9endif
10let did_load_filetypes = 1
11
12" Line continuation is used here, remove 'C' from 'cpoptions'
13let s:cpo_save = &cpo
14set cpo&vim
15
16augroup filetypedetect
17
18" Ignored extensions
19if exists("*fnameescape")
20au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew,?\+.pacsave,?\+.pacnew
21	\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
22au BufNewFile,BufRead *~
23	\ let s:name = expand("<afile>") |
24	\ let s:short = substitute(s:name, '\~$', '', '') |
25	\ if s:name != s:short && s:short != "" |
26	\   exe "doau filetypedetect BufRead " . fnameescape(s:short) |
27	\ endif |
28	\ unlet! s:name s:short
29au BufNewFile,BufRead ?\+.in
30	\ if expand("<afile>:t") != "configure.in" |
31	\   exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) |
32	\ endif
33elseif &verbose > 0
34  echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()"
35endif
36
37" Pattern used to match file names which should not be inspected.
38" Currently finds compressed files.
39if !exists("g:ft_ignore_pat")
40  let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
41endif
42
43" Function used for patterns that end in a star: don't set the filetype if the
44" file name matches ft_ignore_pat.
45func! s:StarSetf(ft)
46  if expand("<amatch>") !~ g:ft_ignore_pat
47    exe 'setf ' . a:ft
48  endif
49endfunc
50
51" Vim help file
52au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt	setf help
53
54" Abaqus or Trasys
55au BufNewFile,BufRead *.inp			call dist#ft#Check_inp()
56
57" A-A-P recipe
58au BufNewFile,BufRead *.aap			setf aap
59
60" A2ps printing utility
61au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps
62
63" ABAB/4
64au BufNewFile,BufRead *.abap			setf abap
65
66" ABC music notation
67au BufNewFile,BufRead *.abc			setf abc
68
69" ABEL
70au BufNewFile,BufRead *.abl			setf abel
71
72" AceDB
73au BufNewFile,BufRead *.wrm			setf acedb
74
75" Ada (83, 9X, 95)
76au BufNewFile,BufRead *.adb,*.ads,*.ada		setf ada
77if has("vms")
78  au BufNewFile,BufRead *.gpr,*.ada_m,*.adc	setf ada
79else
80  au BufNewFile,BufRead *.gpr			setf ada
81endif
82
83" AHDL
84au BufNewFile,BufRead *.tdf			setf ahdl
85
86" AMPL
87au BufNewFile,BufRead *.run			setf ampl
88
89" Ant
90au BufNewFile,BufRead build.xml			setf ant
91
92" Arduino
93au BufNewFile,BufRead *.ino,*.pde		setf arduino
94
95" Apache style config file
96au BufNewFile,BufRead proftpd.conf*		call s:StarSetf('apachestyle')
97
98" Apache config file
99au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf		setf apache
100
101" XA65 MOS6510 cross assembler
102au BufNewFile,BufRead *.a65			setf a65
103
104" Applescript
105au BufNewFile,BufRead *.scpt			setf applescript
106
107" Applix ELF
108au BufNewFile,BufRead *.am
109	\ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
110
111" ALSA configuration
112au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf
113
114" Arc Macro Language
115au BufNewFile,BufRead *.aml			setf aml
116
117" APT config file
118au BufNewFile,BufRead apt.conf		       setf aptconf
119au BufNewFile,BufRead */.aptitude/config       setf aptconf
120au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf
121
122" Arch Inventory file
123au BufNewFile,BufRead .arch-inventory,=tagging-method	setf arch
124
125" ART*Enterprise (formerly ART-IM)
126au BufNewFile,BufRead *.art			setf art
127
128" AsciiDoc
129au BufNewFile,BufRead *.asciidoc,*.adoc		setf asciidoc
130
131" ASN.1
132au BufNewFile,BufRead *.asn,*.asn1		setf asn
133
134" Active Server Pages (with Visual Basic Script)
135au BufNewFile,BufRead *.asa
136	\ if exists("g:filetype_asa") |
137	\   exe "setf " . g:filetype_asa |
138	\ else |
139	\   setf aspvbs |
140	\ endif
141
142" Active Server Pages (with Perl or Visual Basic Script)
143au BufNewFile,BufRead *.asp
144	\ if exists("g:filetype_asp") |
145	\   exe "setf " . g:filetype_asp |
146	\ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
147	\   setf aspperl |
148	\ else |
149	\   setf aspvbs |
150	\ endif
151
152" Grub (must be before catch *.lst)
153au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub
154
155" Assembly (all kinds)
156" *.lst is not pure assembly, it has two extra columns (address, byte codes)
157au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst	call dist#ft#FTasm()
158
159" Macro (VAX)
160au BufNewFile,BufRead *.mar			setf vmasm
161
162" Atlas
163au BufNewFile,BufRead *.atl,*.as		setf atlas
164
165" Autoit v3
166au BufNewFile,BufRead *.au3			setf autoit
167
168" Autohotkey
169au BufNewFile,BufRead *.ahk			setf autohotkey
170
171" Automake
172au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am	setf automake
173
174" Autotest .at files are actually m4
175au BufNewFile,BufRead *.at			setf m4
176
177" Avenue
178au BufNewFile,BufRead *.ave			setf ave
179
180" Awk
181au BufNewFile,BufRead *.awk			setf awk
182
183" B
184au BufNewFile,BufRead *.mch,*.ref,*.imp		setf b
185
186" BASIC or Visual Basic
187au BufNewFile,BufRead *.bas			call dist#ft#FTVB("basic")
188
189" Visual Basic Script (close to Visual Basic) or Visual Basic .NET
190au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl	setf vb
191
192" IBasic file (similar to QBasic)
193au BufNewFile,BufRead *.iba,*.ibi		setf ibasic
194
195" FreeBasic file (similar to QBasic)
196au BufNewFile,BufRead *.fb,*.bi			setf freebasic
197
198" Batch file for MSDOS.
199au BufNewFile,BufRead *.bat,*.sys		setf dosbatch
200" *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd.
201au BufNewFile,BufRead *.cmd
202	\ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
203
204" Batch file for 4DOS
205au BufNewFile,BufRead *.btm			call dist#ft#FTbtm()
206
207" BC calculator
208au BufNewFile,BufRead *.bc			setf bc
209
210" BDF font
211au BufNewFile,BufRead *.bdf			setf bdf
212
213" BibTeX bibliography database file
214au BufNewFile,BufRead *.bib			setf bib
215
216" BibTeX Bibliography Style
217au BufNewFile,BufRead *.bst			setf bst
218
219" BIND configuration
220" sudoedit uses namedXXXX.conf
221au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key	setf named
222
223" BIND zone
224au BufNewFile,BufRead named.root		setf bindzone
225au BufNewFile,BufRead *.db			call dist#ft#BindzoneCheck('')
226
227" Blank
228au BufNewFile,BufRead *.bl			setf blank
229
230" Blkid cache file
231au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old   setf xml
232
233" Bazel (http://bazel.io)
234autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel 	setf bzl
235if has("fname_case")
236  " There is another check for BUILD further below.
237  autocmd BufRead,BufNewFile BUILD			setf bzl
238endif
239
240" C or lpc
241au BufNewFile,BufRead *.c			call dist#ft#FTlpc()
242au BufNewFile,BufRead *.lpc,*.ulpc		setf lpc
243
244" Calendar
245au BufNewFile,BufRead calendar			setf calendar
246
247" C#
248au BufNewFile,BufRead *.cs			setf cs
249
250" CSDL
251au BufNewFile,BufRead *.csdl			setf csdl
252
253" Cabal
254au BufNewFile,BufRead *.cabal			setf cabal
255
256" Cdrdao TOC
257au BufNewFile,BufRead *.toc			setf cdrtoc
258
259" Cdrdao config
260au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao	setf cdrdaoconf
261
262" Cfengine
263au BufNewFile,BufRead cfengine.conf		setf cfengine
264
265" ChaiScript
266au BufRead,BufNewFile *.chai			setf chaiscript
267
268" Comshare Dimension Definition Language
269au BufNewFile,BufRead *.cdl			setf cdl
270
271" Conary Recipe
272au BufNewFile,BufRead *.recipe			setf conaryrecipe
273
274" Controllable Regex Mutilator
275au BufNewFile,BufRead *.crm			setf crm
276
277" Cyn++
278au BufNewFile,BufRead *.cyn			setf cynpp
279
280" Cynlib
281" .cc and .cpp files can be C++ or Cynlib.
282au BufNewFile,BufRead *.cc
283	\ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif
284au BufNewFile,BufRead *.cpp
285	\ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
286
287" C++
288au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp
289if has("fname_case")
290  au BufNewFile,BufRead *.C,*.H setf cpp
291endif
292
293" .h files can be C, Ch C++, ObjC or ObjC++.
294" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is
295" detected automatically.
296au BufNewFile,BufRead *.h			call dist#ft#FTheader()
297
298" Ch (CHscript)
299au BufNewFile,BufRead *.chf			setf ch
300
301" TLH files are C++ headers generated by Visual C++'s #import from typelibs
302au BufNewFile,BufRead *.tlh			setf cpp
303
304" Cascading Style Sheets
305au BufNewFile,BufRead *.css			setf css
306
307" Century Term Command Scripts (*.cmd too)
308au BufNewFile,BufRead *.con			setf cterm
309
310" Changelog
311au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch
312					\	setf debchangelog
313
314au BufNewFile,BufRead [cC]hange[lL]og
315	\  if getline(1) =~ '; urgency='
316	\|   setf debchangelog
317	\| else
318	\|   setf changelog
319	\| endif
320
321au BufNewFile,BufRead NEWS
322	\  if getline(1) =~ '; urgency='
323	\|   setf debchangelog
324	\| endif
325
326" CHILL
327au BufNewFile,BufRead *..ch			setf chill
328
329" Changes for WEB and CWEB or CHILL
330au BufNewFile,BufRead *.ch			call dist#ft#FTchange()
331
332" ChordPro
333au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro	setf chordpro
334
335" Clean
336au BufNewFile,BufRead *.dcl,*.icl		setf clean
337
338" Clever
339au BufNewFile,BufRead *.eni			setf cl
340
341" Clever or dtd
342au BufNewFile,BufRead *.ent			call dist#ft#FTent()
343
344" Clipper (or FoxPro; could also be eviews)
345au BufNewFile,BufRead *.prg
346	\ if exists("g:filetype_prg") |
347	\   exe "setf " . g:filetype_prg |
348	\ else |
349	\   setf clipper |
350	\ endif
351
352" Clojure
353au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc		setf clojure
354
355" Cmake
356au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in		setf cmake
357
358" Cmusrc
359au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc
360au BufNewFile,BufRead */cmus/{rc,*.theme}			setf cmusrc
361
362" Cobol
363au BufNewFile,BufRead *.cbl,*.cob,*.lib	setf cobol
364"   cobol or zope form controller python script? (heuristic)
365au BufNewFile,BufRead *.cpy
366	\ if getline(1) =~ '^##' |
367	\   setf python |
368	\ else |
369	\   setf cobol |
370	\ endif
371
372" Coco/R
373au BufNewFile,BufRead *.atg			setf coco
374
375" Cold Fusion
376au BufNewFile,BufRead *.cfm,*.cfi,*.cfc		setf cf
377
378" Configure scripts
379au BufNewFile,BufRead configure.in,configure.ac setf config
380
381" CUDA  Cumpute Unified Device Architecture
382au BufNewFile,BufRead *.cu,*.cuh		setf cuda
383
384" Dockerfile
385au BufNewFile,BufRead Dockerfile,*.Dockerfile	setf dockerfile
386
387" WildPackets EtherPeek Decoder
388au BufNewFile,BufRead *.dcd			setf dcd
389
390" Enlightenment configuration files
391au BufNewFile,BufRead *enlightenment/*.cfg	setf c
392
393" Eterm
394au BufNewFile,BufRead *Eterm/*.cfg		setf eterm
395
396" Euphoria 3 or 4
397au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw  call dist#ft#EuphoriaCheck()
398if has("fname_case")
399   au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW  call dist#ft#EuphoriaCheck()
400endif
401
402" Lynx config files
403au BufNewFile,BufRead lynx.cfg			setf lynx
404
405" Quake
406au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg	setf quake
407au BufNewFile,BufRead *quake[1-3]/*.cfg			setf quake
408
409" Quake C
410au BufNewFile,BufRead *.qc			setf c
411
412" Configure files
413au BufNewFile,BufRead *.cfg			setf cfg
414
415" Cucumber
416au BufNewFile,BufRead *.feature			setf cucumber
417
418" Communicating Sequential Processes
419au BufNewFile,BufRead *.csp,*.fdr		setf csp
420
421" CUPL logic description and simulation
422au BufNewFile,BufRead *.pld			setf cupl
423au BufNewFile,BufRead *.si			setf cuplsim
424
425" Debian Control
426au BufNewFile,BufRead */debian/control		setf debcontrol
427au BufNewFile,BufRead control
428	\  if getline(1) =~ '^Source:'
429	\|   setf debcontrol
430	\| endif
431
432" Debian Copyright
433au BufNewFile,BufRead */debian/copyright	setf debcopyright
434au BufNewFile,BufRead copyright
435	\  if getline(1) =~ '^Format:'
436	\|   setf debcopyright
437	\| endif
438
439" Debian Sources.list
440au BufNewFile,BufRead */etc/apt/sources.list		setf debsources
441au BufNewFile,BufRead */etc/apt/sources.list.d/*.list	setf debsources
442
443" Deny hosts
444au BufNewFile,BufRead denyhosts.conf		setf denyhosts
445
446" dnsmasq(8) configuration files
447au BufNewFile,BufRead */etc/dnsmasq.conf	setf dnsmasq
448
449" ROCKLinux package description
450au BufNewFile,BufRead *.desc			setf desc
451
452" the D language or dtrace
453au BufNewFile,BufRead *.d			call dist#ft#DtraceCheck()
454
455" Desktop files
456au BufNewFile,BufRead *.desktop,.directory	setf desktop
457
458" Dict config
459au BufNewFile,BufRead dict.conf,.dictrc		setf dictconf
460
461" Dictd config
462au BufNewFile,BufRead dictd.conf		setf dictdconf
463
464" Diff files
465au BufNewFile,BufRead *.diff,*.rej		setf diff
466au BufNewFile,BufRead *.patch
467	\ if getline(1) =~ '^From [0-9a-f]\{40\} Mon Sep 17 00:00:00 2001$' |
468	\   setf gitsendemail |
469	\ else |
470	\   setf diff |
471	\ endif
472
473" Dircolors
474au BufNewFile,BufRead .dir_colors,.dircolors,*/etc/DIR_COLORS	setf dircolors
475
476" Diva (with Skill) or InstallShield
477au BufNewFile,BufRead *.rul
478	\ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' |
479	\   setf ishd |
480	\ else |
481	\   setf diva |
482	\ endif
483
484" DCL (Digital Command Language - vms) or DNS zone file
485au BufNewFile,BufRead *.com			call dist#ft#BindzoneCheck('dcl')
486
487" DOT
488au BufNewFile,BufRead *.dot			setf dot
489
490" Dylan - lid files
491au BufNewFile,BufRead *.lid			setf dylanlid
492
493" Dylan - intr files (melange)
494au BufNewFile,BufRead *.intr			setf dylanintr
495
496" Dylan
497au BufNewFile,BufRead *.dylan			setf dylan
498
499" Microsoft Module Definition
500au BufNewFile,BufRead *.def			setf def
501
502" Dracula
503au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe	setf dracula
504
505" Datascript
506au BufNewFile,BufRead *.ds			setf datascript
507
508" dsl
509au BufNewFile,BufRead *.dsl			setf dsl
510
511" DTD (Document Type Definition for XML)
512au BufNewFile,BufRead *.dtd			setf dtd
513
514" DTS/DSTI (device tree files)
515au BufNewFile,BufRead *.dts,*.dtsi		setf dts
516
517" EDIF (*.edf,*.edif,*.edn,*.edo) or edn
518au BufNewFile,BufRead *.ed\(f\|if\|o\)		setf edif
519au BufNewFile,BufRead *.edn
520	\ if getline(1) =~ '^\s*(\s*edif\>' |
521	\   setf edif |
522	\ else |
523	\   setf clojure |
524	\ endif
525
526" EditorConfig (close enough to dosini)
527au BufNewFile,BufRead .editorconfig		setf dosini
528
529" Embedix Component Description
530au BufNewFile,BufRead *.ecd			setf ecd
531
532" Eiffel or Specman or Euphoria
533au BufNewFile,BufRead *.e,*.E			call dist#ft#FTe()
534
535" Elinks configuration
536au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf	setf elinks
537
538" ERicsson LANGuage; Yaws is erlang too
539au BufNewFile,BufRead *.erl,*.hrl,*.yaws	setf erlang
540
541" Elm Filter Rules file
542au BufNewFile,BufRead filter-rules		setf elmfilt
543
544" ESMTP rc file
545au BufNewFile,BufRead *esmtprc			setf esmtprc
546
547" ESQL-C
548au BufNewFile,BufRead *.ec,*.EC			setf esqlc
549
550" Esterel
551au BufNewFile,BufRead *.strl			setf esterel
552
553" Essbase script
554au BufNewFile,BufRead *.csc			setf csc
555
556" Exim
557au BufNewFile,BufRead exim.conf			setf exim
558
559" Expect
560au BufNewFile,BufRead *.exp			setf expect
561
562" Exports
563au BufNewFile,BufRead exports			setf exports
564
565" Falcon
566au BufNewFile,BufRead *.fal			setf falcon
567
568" Fantom
569au BufNewFile,BufRead *.fan,*.fwt		setf fan
570
571" Factor
572au BufNewFile,BufRead *.factor			setf factor
573
574" Fetchmail RC file
575au BufNewFile,BufRead .fetchmailrc		setf fetchmail
576
577" FlexWiki - disabled, because it has side effects when a .wiki file
578" is not actually FlexWiki
579"au BufNewFile,BufRead *.wiki			setf flexwiki
580
581" Focus Executable
582au BufNewFile,BufRead *.fex,*.focexec		setf focexec
583
584" Focus Master file (but not for auto.master)
585au BufNewFile,BufRead auto.master		setf conf
586au BufNewFile,BufRead *.mas,*.master		setf master
587
588" Forth
589au BufNewFile,BufRead *.fs,*.ft,*.fth		setf forth
590
591" Reva Forth
592au BufNewFile,BufRead *.frt			setf reva
593
594" Fortran
595if has("fname_case")
596  au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95,*.F03,*.F08	 setf fortran
597endif
598au BufNewFile,BufRead   *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95,*.f03,*.f08  setf fortran
599
600" Framescript
601au BufNewFile,BufRead *.fsl			setf framescript
602
603" FStab
604au BufNewFile,BufRead fstab,mtab		setf fstab
605
606" GDB command files
607au BufNewFile,BufRead .gdbinit			setf gdb
608
609" GDMO
610au BufNewFile,BufRead *.mo,*.gdmo		setf gdmo
611
612" Gedcom
613au BufNewFile,BufRead *.ged,lltxxxxx.txt	setf gedcom
614
615" Git
616au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
617au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
618au BufNewFile,BufRead *.git/modules/*/config	setf gitconfig
619au BufNewFile,BufRead */.config/git/config	setf gitconfig
620if !empty($XDG_CONFIG_HOME)
621  au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config	setf gitconfig
622endif
623au BufNewFile,BufRead git-rebase-todo		setf gitrebase
624au BufRead,BufNewFile .gitsendemail.msg.??????	setf gitsendemail
625au BufNewFile,BufRead .msg.[0-9]*
626      \ if getline(1) =~ '^From.*# This line is ignored.$' |
627      \   setf gitsendemail |
628      \ endif
629au BufNewFile,BufRead *.git/*
630      \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
631      \   setf git |
632      \ endif
633
634" Gkrellmrc
635au BufNewFile,BufRead gkrellmrc,gkrellmrc_?	setf gkrellmrc
636
637" GP scripts (2.0 and onward)
638au BufNewFile,BufRead *.gp,.gprc		setf gp
639
640" GPG
641au BufNewFile,BufRead */.gnupg/options		setf gpg
642au BufNewFile,BufRead */.gnupg/gpg.conf		setf gpg
643au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg
644if !empty($GNUPGHOME)
645  au BufNewFile,BufRead $GNUPGHOME/options	setf gpg
646  au BufNewFile,BufRead $GNUPGHOME/gpg.conf	setf gpg
647endif
648
649" gnash(1) configuration files
650au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash
651
652" Gitolite
653au BufNewFile,BufRead gitolite.conf		setf gitolite
654au BufNewFile,BufRead */gitolite-admin/conf/*	call s:StarSetf('gitolite')
655au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc	setf perl
656
657" Gnuplot scripts
658au BufNewFile,BufRead *.gpi			setf gnuplot
659
660" Go (Google)
661au BufNewFile,BufRead *.go			setf go
662
663" GrADS scripts
664au BufNewFile,BufRead *.gs			setf grads
665
666" Gretl
667au BufNewFile,BufRead *.gretl			setf gretl
668
669" Groovy
670au BufNewFile,BufRead *.gradle,*.groovy		setf groovy
671
672" GNU Server Pages
673au BufNewFile,BufRead *.gsp			setf gsp
674
675" Group file
676au 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
677
678" GTK RC
679au BufNewFile,BufRead .gtkrc,gtkrc		setf gtkrc
680
681" Haml
682au BufNewFile,BufRead *.haml			setf haml
683
684" Hamster Classic | Playground files
685au BufNewFile,BufRead *.hsc,*.hsm		setf hamster
686
687" Haskell
688au BufNewFile,BufRead *.hs,*.hs-boot		setf haskell
689au BufNewFile,BufRead *.lhs			setf lhaskell
690au BufNewFile,BufRead *.chs			setf chaskell
691
692" Haste
693au BufNewFile,BufRead *.ht			setf haste
694au BufNewFile,BufRead *.htpp			setf hastepreproc
695
696" Hercules
697au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum	setf hercules
698
699" HEX (Intel)
700au BufNewFile,BufRead *.hex,*.h32		setf hex
701
702" Tilde (must be before HTML)
703au BufNewFile,BufRead *.t.html			setf tilde
704
705" HTML (.shtml and .stm for server side)
706au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm  call dist#ft#FThtml()
707
708" HTML with Ruby - eRuby
709au BufNewFile,BufRead *.erb,*.rhtml		setf eruby
710
711" HTML with M4
712au BufNewFile,BufRead *.html.m4			setf htmlm4
713
714" HTML Cheetah template
715au BufNewFile,BufRead *.tmpl			setf htmlcheetah
716
717" Host config
718au BufNewFile,BufRead */etc/host.conf		setf hostconf
719
720" Hosts access
721au BufNewFile,BufRead */etc/hosts.allow,*/etc/hosts.deny  setf hostsaccess
722
723" Hyper Builder
724au BufNewFile,BufRead *.hb			setf hb
725
726" Httest
727au BufNewFile,BufRead *.htt,*.htb		setf httest
728
729" Icon
730au BufNewFile,BufRead *.icn			setf icon
731
732" IDL (Interface Description Language)
733au BufNewFile,BufRead *.idl			call dist#ft#FTidl()
734
735" Microsoft IDL (Interface Description Language)  Also *.idl
736" MOF = WMI (Windows Management Instrumentation) Managed Object Format
737au BufNewFile,BufRead *.odl,*.mof		setf msidl
738
739" Icewm menu
740au BufNewFile,BufRead */.icewm/menu		setf icemenu
741
742" Indent profile (must come before IDL *.pro!)
743au BufNewFile,BufRead .indent.pro		setf indent
744au BufNewFile,BufRead indent.pro		call dist#ft#ProtoCheck('indent')
745
746" IDL (Interactive Data Language)
747au BufNewFile,BufRead *.pro			call dist#ft#ProtoCheck('idlang')
748
749" Indent RC
750au BufNewFile,BufRead indentrc			setf indent
751
752" Inform
753au BufNewFile,BufRead *.inf,*.INF		setf inform
754
755" Initng
756au BufNewFile,BufRead */etc/initng/*/*.i,*.ii	setf initng
757
758" Innovation Data Processing
759au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c 	setf upstreamdat
760au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c 	setf upstreamlog
761au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
762au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c 	setf usserverlog
763au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c 	setf usw2kagtlog
764
765" Ipfilter
766au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules	setf ipfilter
767
768" Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
769au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl	setf fgl
770
771" .INI file for MSDOS
772au BufNewFile,BufRead *.ini			setf dosini
773
774" SysV Inittab
775au BufNewFile,BufRead inittab			setf inittab
776
777" Inno Setup
778au BufNewFile,BufRead *.iss			setf iss
779
780" J
781au BufNewFile,BufRead *.ijs			setf j
782
783" JAL
784au BufNewFile,BufRead *.jal,*.JAL		setf jal
785
786" Jam
787au BufNewFile,BufRead *.jpl,*.jpr		setf jam
788
789" Java
790au BufNewFile,BufRead *.java,*.jav		setf java
791
792" JavaCC
793au BufNewFile,BufRead *.jj,*.jjt		setf javacc
794
795" JavaScript, ECMAScript
796au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs   setf javascript
797
798" Java Server Pages
799au BufNewFile,BufRead *.jsp			setf jsp
800
801" Java Properties resource file (note: doesn't catch font.properties.pl)
802au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_??	setf jproperties
803au BufNewFile,BufRead *.properties_??_??_*	call s:StarSetf('jproperties')
804
805" Jess
806au BufNewFile,BufRead *.clp			setf jess
807
808" Jgraph
809au BufNewFile,BufRead *.jgr			setf jgraph
810
811" Jovial
812au BufNewFile,BufRead *.jov,*.j73,*.jovial	setf jovial
813
814" JSON
815au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest	setf json
816
817" Kixtart
818au BufNewFile,BufRead *.kix			setf kix
819
820" Kimwitu[++]
821au BufNewFile,BufRead *.k			setf kwt
822
823" Kivy
824au BufNewFile,BufRead *.kv			setf kivy
825
826" KDE script
827au BufNewFile,BufRead *.ks			setf kscript
828
829" Kconfig
830au BufNewFile,BufRead Kconfig,Kconfig.debug	setf kconfig
831
832" Lace (ISE)
833au BufNewFile,BufRead *.ace,*.ACE		setf lace
834
835" Latte
836au BufNewFile,BufRead *.latte,*.lte		setf latte
837
838" Limits
839au BufNewFile,BufRead */etc/limits,*/etc/*limits.conf,*/etc/*limits.d/*.conf	setf limits
840
841" LambdaProlog (*.mod too, see Modsim)
842au BufNewFile,BufRead *.sig			setf lprolog
843
844" LDAP LDIF
845au BufNewFile,BufRead *.ldif			setf ldif
846
847" Ld loader
848au BufNewFile,BufRead *.ld			setf ld
849
850" Less
851au BufNewFile,BufRead *.less			setf less
852
853" Lex
854au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++	setf lex
855
856" Libao
857au BufNewFile,BufRead */etc/libao.conf,*/.libao	setf libao
858
859" Libsensors
860au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf	setf sensors
861
862" LFTP
863au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc	setf lftp
864
865" Lifelines (or Lex for C++!)
866au BufNewFile,BufRead *.ll			setf lifelines
867
868" Lilo: Linux loader
869au BufNewFile,BufRead lilo.conf			setf lilo
870
871" Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp)
872if has("fname_case")
873  au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp
874else
875  au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp
876endif
877
878" SBCL implementation of Common Lisp
879au BufNewFile,BufRead sbclrc,.sbclrc		setf lisp
880
881" Liquid
882au BufNewFile,BufRead *.liquid			setf liquid
883
884" Lite
885au BufNewFile,BufRead *.lite,*.lt		setf lite
886
887" LiteStep RC files
888au BufNewFile,BufRead */LiteStep/*/*.rc		setf litestep
889
890" Login access
891au BufNewFile,BufRead */etc/login.access	setf loginaccess
892
893" Login defs
894au BufNewFile,BufRead */etc/login.defs		setf logindefs
895
896" Logtalk
897au BufNewFile,BufRead *.lgt			setf logtalk
898
899" LOTOS
900au BufNewFile,BufRead *.lot,*.lotos		setf lotos
901
902" Lout (also: *.lt)
903au BufNewFile,BufRead *.lou,*.lout		setf lout
904
905" Lua
906au BufNewFile,BufRead *.lua			setf lua
907
908" Luarocks
909au BufNewFile,BufRead *.rockspec		setf lua
910
911" Linden Scripting Language (Second Life)
912au BufNewFile,BufRead *.lsl			setf lsl
913
914" Lynx style file (or LotusScript!)
915au BufNewFile,BufRead *.lss			setf lss
916
917" M4
918au BufNewFile,BufRead *.m4
919	\ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif
920
921" MaGic Point
922au BufNewFile,BufRead *.mgp			setf mgp
923
924" Mail (for Elm, trn, mutt, muttng, rn, slrn, neomutt)
925au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
926
927" Mail aliases
928au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases	setf mailaliases
929
930" Mailcap configuration file
931au BufNewFile,BufRead .mailcap,mailcap		setf mailcap
932
933" Makefile
934au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
935
936" MakeIndex
937au BufNewFile,BufRead *.ist,*.mst		setf ist
938
939" Mallard
940au BufNewFile,BufRead *.page			setf mallard
941
942" Manpage
943au BufNewFile,BufRead *.man			setf man
944
945" Man config
946au BufNewFile,BufRead */etc/man.conf,man.config	setf manconf
947
948" Maple V
949au BufNewFile,BufRead *.mv,*.mpl,*.mws		setf maple
950
951" Map (UMN mapserver config file)
952au BufNewFile,BufRead *.map			setf map
953
954" Markdown
955au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md  setf markdown
956
957" Mason
958au BufNewFile,BufRead *.mason,*.mhtml,*.comp	setf mason
959
960" Mathematica, Matlab, Murphi or Objective C
961au BufNewFile,BufRead *.m			call dist#ft#FTm()
962
963" Mathematica notebook
964au BufNewFile,BufRead *.nb			setf mma
965
966" Maya Extension Language
967au BufNewFile,BufRead *.mel			setf mel
968
969" Mercurial (hg) commit file
970au BufNewFile,BufRead hg-editor-*.txt		setf hgcommit
971
972" Mercurial config (looks like generic config file)
973au BufNewFile,BufRead *.hgrc,*hgrc		setf cfg
974
975" Messages (logs mostly)
976au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages
977
978" Metafont
979au BufNewFile,BufRead *.mf			setf mf
980
981" MetaPost
982au BufNewFile,BufRead *.mp			setf mp
983
984" MGL
985au BufNewFile,BufRead *.mgl			setf mgl
986
987" MIX - Knuth assembly
988au BufNewFile,BufRead *.mix,*.mixal		setf mix
989
990" MMIX or VMS makefile
991au BufNewFile,BufRead *.mms			call dist#ft#FTmms()
992
993" Symbian meta-makefile definition (MMP)
994au BufNewFile,BufRead *.mmp			setf mmp
995
996" Modsim III (or LambdaProlog)
997au BufNewFile,BufRead *.mod
998	\ if getline(1) =~ '\<module\>' |
999	\   setf lprolog |
1000	\ else |
1001	\   setf modsim3 |
1002	\ endif
1003
1004" Modula 2  (.md removed in favor of Markdown)
1005au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi	setf modula2
1006
1007" Modula 3 (.m3, .i3, .mg, .ig)
1008au BufNewFile,BufRead *.[mi][3g]		setf modula3
1009
1010" Monk
1011au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc	setf monk
1012
1013" MOO
1014au BufNewFile,BufRead *.moo			setf moo
1015
1016" Modconf
1017au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf
1018
1019" Mplayer config
1020au BufNewFile,BufRead mplayer.conf,*/.mplayer/config	setf mplayerconf
1021
1022" Motorola S record
1023au BufNewFile,BufRead *.s19,*.s28,*.s37,*.mot,*.srec	setf srec
1024
1025" Mrxvtrc
1026au BufNewFile,BufRead mrxvtrc,.mrxvtrc		setf mrxvtrc
1027
1028" Msql
1029au BufNewFile,BufRead *.msql			setf msql
1030
1031" Mysql
1032au BufNewFile,BufRead *.mysql			setf mysql
1033
1034" Mutt setup files (must be before catch *.rc)
1035au BufNewFile,BufRead */etc/Muttrc.d/*		call s:StarSetf('muttrc')
1036
1037" M$ Resource files
1038au BufNewFile,BufRead *.rc,*.rch		setf rc
1039
1040" MuPAD source
1041au BufRead,BufNewFile *.mu			setf mupad
1042
1043" Mush
1044au BufNewFile,BufRead *.mush			setf mush
1045
1046" Mutt setup file (also for Muttng)
1047au BufNewFile,BufRead Mutt{ng,}rc		setf muttrc
1048
1049" N1QL
1050au BufRead,BufNewfile *.n1ql,*.nql		setf n1ql
1051
1052" Nano
1053au BufNewFile,BufRead */etc/nanorc,*.nanorc  	setf nanorc
1054
1055" Nastran input/DMAP
1056"au BufNewFile,BufRead *.dat			setf nastran
1057
1058" Natural
1059au BufNewFile,BufRead *.NS[ACGLMNPS]		setf natural
1060
1061" Noemutt setup file
1062au BufNewFile,BufRead Neomuttrc			setf neomuttrc
1063
1064" Netrc
1065au BufNewFile,BufRead .netrc			setf netrc
1066
1067" Ninja file
1068au BufNewFile,BufRead *.ninja			setf ninja
1069
1070" Novell netware batch files
1071au BufNewFile,BufRead *.ncf			setf ncf
1072
1073" Nroff/Troff (*.ms and *.t are checked below)
1074au BufNewFile,BufRead *.me
1075	\ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" |
1076	\   setf nroff |
1077	\ endif
1078au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom	setf nroff
1079au BufNewFile,BufRead *.[1-9]			call dist#ft#FTnroff()
1080
1081" Nroff or Objective C++
1082au BufNewFile,BufRead *.mm			call dist#ft#FTmm()
1083
1084" Not Quite C
1085au BufNewFile,BufRead *.nqc			setf nqc
1086
1087" NSE - Nmap Script Engine - uses Lua syntax
1088au BufNewFile,BufRead *.nse			setf lua
1089
1090" NSIS
1091au BufNewFile,BufRead *.nsi,*.nsh		setf nsis
1092
1093" OCAML
1094au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit	setf ocaml
1095
1096" Occam
1097au BufNewFile,BufRead *.occ			setf occam
1098
1099" Omnimark
1100au BufNewFile,BufRead *.xom,*.xin		setf omnimark
1101
1102" OpenROAD
1103au BufNewFile,BufRead *.or			setf openroad
1104
1105" OPL
1106au BufNewFile,BufRead *.[Oo][Pp][Ll]		setf opl
1107
1108" Oracle config file
1109au BufNewFile,BufRead *.ora			setf ora
1110
1111" Packet filter conf
1112au BufNewFile,BufRead pf.conf			setf pf
1113
1114" Pam conf
1115au BufNewFile,BufRead */etc/pam.conf		setf pamconf
1116
1117" PApp
1118au BufNewFile,BufRead *.papp,*.pxml,*.pxsl	setf papp
1119
1120" Password file
1121au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd
1122
1123" Pascal (also *.p)
1124au BufNewFile,BufRead *.pas			setf pascal
1125
1126" Delphi project file
1127au BufNewFile,BufRead *.dpr			setf pascal
1128
1129" PDF
1130au BufNewFile,BufRead *.pdf			setf pdf
1131
1132" PCMK - HAE - crm configure edit
1133au BufNewFile,BufRead *.pcmk 			setf pcmk
1134
1135" Perl
1136if has("fname_case")
1137  au BufNewFile,BufRead *.pl,*.PL		call dist#ft#FTpl()
1138else
1139  au BufNewFile,BufRead *.pl			call dist#ft#FTpl()
1140endif
1141au BufNewFile,BufRead *.plx,*.al,*.psgi		setf perl
1142au BufNewFile,BufRead *.p6,*.pm6,*.pl6		setf perl6
1143
1144" Perl, XPM or XPM2
1145au BufNewFile,BufRead *.pm
1146	\ if getline(1) =~ "XPM2" |
1147	\   setf xpm2 |
1148	\ elseif getline(1) =~ "XPM" |
1149	\   setf xpm |
1150	\ else |
1151	\   setf perl |
1152	\ endif
1153
1154" Perl POD
1155au BufNewFile,BufRead *.pod			setf pod
1156au BufNewFile,BufRead *.pod6			setf pod6
1157
1158" Php, php3, php4, etc.
1159" Also Phtml (was used for PHP 2 in the past)
1160" Also .ctp for Cake template file
1161au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp	setf php
1162
1163" Pike and Cmod
1164au BufNewFile,BufRead *.pike,*.pmod		setf pike
1165au BufNewFile,BufRead *.cmod			setf cmod
1166
1167" Pinfo config
1168au BufNewFile,BufRead */etc/pinforc,*/.pinforc	setf pinfo
1169
1170" Palm Resource compiler
1171au BufNewFile,BufRead *.rcp			setf pilrc
1172
1173" Pine config
1174au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex		setf pine
1175
1176" PL/1, PL/I
1177au BufNewFile,BufRead *.pli,*.pl1		setf pli
1178
1179" PL/M (also: *.inp)
1180au BufNewFile,BufRead *.plm,*.p36,*.pac		setf plm
1181
1182" PL/SQL
1183au BufNewFile,BufRead *.pls,*.plsql		setf plsql
1184
1185" PLP
1186au BufNewFile,BufRead *.plp			setf plp
1187
1188" PO and PO template (GNU gettext)
1189au BufNewFile,BufRead *.po,*.pot		setf po
1190
1191" Postfix main config
1192au BufNewFile,BufRead main.cf			setf pfmain
1193
1194" PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
1195au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai	  setf postscr
1196
1197" PostScript Printer Description
1198au BufNewFile,BufRead *.ppd			setf ppd
1199
1200" Povray
1201au BufNewFile,BufRead *.pov			setf pov
1202
1203" Povray configuration
1204au BufNewFile,BufRead .povrayrc			setf povini
1205
1206" Povray, PHP or assembly
1207au BufNewFile,BufRead *.inc			call dist#ft#FTinc()
1208
1209" Printcap and Termcap
1210au BufNewFile,BufRead *printcap
1211	\ let b:ptcap_type = "print" | setf ptcap
1212au BufNewFile,BufRead *termcap
1213	\ let b:ptcap_type = "term" | setf ptcap
1214
1215" PCCTS / ANTRL
1216"au BufNewFile,BufRead *.g			setf antrl
1217au BufNewFile,BufRead *.g			setf pccts
1218
1219" PPWizard
1220au BufNewFile,BufRead *.it,*.ih			setf ppwiz
1221
1222" Obj 3D file format
1223" TODO: is there a way to avoid MS-Windows Object files?
1224au BufNewFile,BufRead *.obj			setf obj
1225
1226" Oracle Pro*C/C++
1227au BufNewFile,BufRead *.pc			setf proc
1228
1229" Privoxy actions file
1230au BufNewFile,BufRead *.action			setf privoxy
1231
1232" Procmail
1233au BufNewFile,BufRead .procmail,.procmailrc	setf procmail
1234
1235" Progress or CWEB
1236au BufNewFile,BufRead *.w			call dist#ft#FTprogress_cweb()
1237
1238" Progress or assembly
1239au BufNewFile,BufRead *.i			call dist#ft#FTprogress_asm()
1240
1241" Progress or Pascal
1242au BufNewFile,BufRead *.p			call dist#ft#FTprogress_pascal()
1243
1244" Software Distributor Product Specification File (POSIX 1387.2-1995)
1245au BufNewFile,BufRead *.psf			setf psf
1246au BufNewFile,BufRead INDEX,INFO
1247	\ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
1248	\   setf psf |
1249	\ endif
1250
1251" Prolog
1252au BufNewFile,BufRead *.pdb			setf prolog
1253
1254" Promela
1255au BufNewFile,BufRead *.pml			setf promela
1256
1257" Google protocol buffers
1258au BufNewFile,BufRead *.proto			setf proto
1259
1260" Protocols
1261au BufNewFile,BufRead */etc/protocols		setf protocols
1262
1263" Pyrex
1264au BufNewFile,BufRead *.pyx,*.pxd		setf pyrex
1265
1266" Python, Python Shell Startup Files
1267" Quixote (Python-based web framework)
1268au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,*.ptl  setf python
1269
1270" Radiance
1271au BufNewFile,BufRead *.rad,*.mat		setf radiance
1272
1273" Ratpoison config/command files
1274au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc	setf ratpoison
1275
1276" RCS file
1277au BufNewFile,BufRead *\,v			setf rcs
1278
1279" Readline
1280au BufNewFile,BufRead .inputrc,inputrc		setf readline
1281
1282" Registry for MS-Windows
1283au BufNewFile,BufRead *.reg
1284	\ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
1285
1286" Renderman Interface Bytestream
1287au BufNewFile,BufRead *.rib			setf rib
1288
1289" Rexx
1290au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit	setf rexx
1291
1292" R (Splus)
1293if has("fname_case")
1294  au BufNewFile,BufRead *.s,*.S			setf r
1295else
1296  au BufNewFile,BufRead *.s			setf r
1297endif
1298
1299" R Help file
1300if has("fname_case")
1301  au BufNewFile,BufRead *.rd,*.Rd		setf rhelp
1302else
1303  au BufNewFile,BufRead *.rd			setf rhelp
1304endif
1305
1306" R noweb file
1307if has("fname_case")
1308  au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw		setf rnoweb
1309else
1310  au BufNewFile,BufRead *.rnw,*.snw			setf rnoweb
1311endif
1312
1313" R Markdown file
1314if has("fname_case")
1315  au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd		setf rmd
1316else
1317  au BufNewFile,BufRead *.rmd,*.smd			setf rmd
1318endif
1319
1320" R reStructuredText file
1321if has("fname_case")
1322  au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst	setf rrst
1323else
1324  au BufNewFile,BufRead *.rrst,*.srst			setf rrst
1325endif
1326
1327" Rexx, Rebol or R
1328au BufNewFile,BufRead *.r,*.R				call dist#ft#FTr()
1329
1330" Remind
1331au BufNewFile,BufRead .reminders,*.remind,*.rem		setf remind
1332
1333" Resolv.conf
1334au BufNewFile,BufRead resolv.conf		setf resolv
1335
1336" Relax NG Compact
1337au BufNewFile,BufRead *.rnc			setf rnc
1338
1339" Relax NG XML
1340au BufNewFile,BufRead *.rng			setf rng
1341
1342" RPL/2
1343au BufNewFile,BufRead *.rpl			setf rpl
1344
1345" Robots.txt
1346au BufNewFile,BufRead robots.txt		setf robots
1347
1348" Rpcgen
1349au BufNewFile,BufRead *.x			setf rpcgen
1350
1351" reStructuredText Documentation Format
1352au BufNewFile,BufRead *.rst			setf rst
1353
1354" RTF
1355au BufNewFile,BufRead *.rtf			setf rtf
1356
1357" Interactive Ruby shell
1358au BufNewFile,BufRead .irbrc,irbrc		setf ruby
1359
1360" Ruby
1361au BufNewFile,BufRead *.rb,*.rbw		setf ruby
1362
1363" RubyGems
1364au BufNewFile,BufRead *.gemspec			setf ruby
1365
1366" Rust
1367au BufNewFile,BufRead *.rs			setf rust
1368
1369" Rackup
1370au BufNewFile,BufRead *.ru			setf ruby
1371
1372" Bundler
1373au BufNewFile,BufRead Gemfile			setf ruby
1374
1375" Ruby on Rails
1376au BufNewFile,BufRead *.builder,*.rxml,*.rjs	setf ruby
1377
1378" Rantfile and Rakefile is like Ruby
1379au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake	setf ruby
1380
1381" S-lang (or shader language, or SmallLisp)
1382au BufNewFile,BufRead *.sl			setf slang
1383
1384" Samba config
1385au BufNewFile,BufRead smb.conf			setf samba
1386
1387" SAS script
1388au BufNewFile,BufRead *.sas			setf sas
1389
1390" Sass
1391au BufNewFile,BufRead *.sass			setf sass
1392
1393" Sather
1394au BufNewFile,BufRead *.sa			setf sather
1395
1396" Scala
1397au BufNewFile,BufRead *.scala			setf scala
1398
1399" SBT - Scala Build Tool
1400au BufNewFile,BufRead *.sbt			setf sbt
1401
1402" Scilab
1403au BufNewFile,BufRead *.sci,*.sce		setf scilab
1404
1405" SCSS
1406au BufNewFile,BufRead *.scss			setf scss
1407
1408" SD: Streaming Descriptors
1409au BufNewFile,BufRead *.sd			setf sd
1410
1411" SDL
1412au BufNewFile,BufRead *.sdl,*.pr		setf sdl
1413
1414" sed
1415au BufNewFile,BufRead *.sed			setf sed
1416
1417" Sieve (RFC 3028)
1418au BufNewFile,BufRead *.siv			setf sieve
1419
1420" Sendmail
1421au BufNewFile,BufRead sendmail.cf		setf sm
1422
1423" Sendmail .mc files are actually m4.  Could also be MS Message text file.
1424au BufNewFile,BufRead *.mc			call dist#ft#McSetf()
1425
1426" Services
1427au BufNewFile,BufRead */etc/services		setf services
1428
1429" Service Location config
1430au BufNewFile,BufRead */etc/slp.conf		setf slpconf
1431
1432" Service Location registration
1433au BufNewFile,BufRead */etc/slp.reg		setf slpreg
1434
1435" Service Location SPI
1436au BufNewFile,BufRead */etc/slp.spi		setf slpspi
1437
1438" Setserial config
1439au BufNewFile,BufRead */etc/serial.conf		setf setserial
1440
1441" SGML
1442au BufNewFile,BufRead *.sgm,*.sgml
1443	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
1444	\   setf sgmllnx |
1445	\ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
1446	\   let b:docbk_type = "sgml" |
1447	\   let b:docbk_ver = 4 |
1448	\   setf docbk |
1449	\ else |
1450	\   setf sgml |
1451	\ endif
1452
1453" SGMLDECL
1454au BufNewFile,BufRead *.decl,*.dcl,*.dec
1455	\ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
1456	\    setf sgmldecl |
1457	\ endif
1458
1459" SGML catalog file
1460au BufNewFile,BufRead catalog			setf catalog
1461au BufNewFile,BufRead sgml.catalog*		call s:StarSetf('catalog')
1462
1463" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
1464" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
1465au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
1466au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh")
1467au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
1468
1469" Shell script (Arch Linux) or PHP file (Drupal)
1470au BufNewFile,BufRead *.install
1471	\ if getline(1) =~ '<?php' |
1472	\   setf php |
1473	\ else |
1474	\   call dist#ft#SetFileTypeSH("bash") |
1475	\ endif
1476
1477" tcsh scripts
1478au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login	call dist#ft#SetFileTypeShell("tcsh")
1479
1480" csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
1481au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call dist#ft#CSH()
1482
1483" Z-Shell script
1484au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks  setf zsh
1485au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh')
1486au BufNewFile,BufRead *.zsh			setf zsh
1487
1488" Scheme
1489au BufNewFile,BufRead *.scm,*.ss,*.rkt		setf scheme
1490
1491" Screen RC
1492au BufNewFile,BufRead .screenrc,screenrc	setf screen
1493
1494" Simula
1495au BufNewFile,BufRead *.sim			setf simula
1496
1497" SINDA
1498au BufNewFile,BufRead *.sin,*.s85		setf sinda
1499
1500" SiSU
1501au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu
1502au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
1503
1504" SKILL
1505au BufNewFile,BufRead *.il,*.ils,*.cdf		setf skill
1506
1507" SLRN
1508au BufNewFile,BufRead .slrnrc			setf slrnrc
1509au BufNewFile,BufRead *.score			setf slrnsc
1510
1511" Smalltalk (and TeX)
1512au BufNewFile,BufRead *.st			setf st
1513au BufNewFile,BufRead *.cls
1514	\ if getline(1) =~ '^%' |
1515	\  setf tex |
1516	\ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
1517	\  setf rexx |
1518	\ else |
1519	\  setf st |
1520	\ endif
1521
1522" Smarty templates
1523au BufNewFile,BufRead *.tpl			setf smarty
1524
1525" SMIL or XML
1526au BufNewFile,BufRead *.smil
1527	\ if getline(1) =~ '<?\s*xml.*?>' |
1528	\   setf xml |
1529	\ else |
1530	\   setf smil |
1531	\ endif
1532
1533" SMIL or SNMP MIB file
1534au BufNewFile,BufRead *.smi
1535	\ if getline(1) =~ '\<smil\>' |
1536	\   setf smil |
1537	\ else |
1538	\   setf mib |
1539	\ endif
1540
1541" SMITH
1542au BufNewFile,BufRead *.smt,*.smith		setf smith
1543
1544" Snobol4 and spitbol
1545au BufNewFile,BufRead *.sno,*.spt		setf snobol4
1546
1547" SNMP MIB files
1548au BufNewFile,BufRead *.mib,*.my		setf mib
1549
1550" Snort Configuration
1551au BufNewFile,BufRead *.hog,snort.conf,vision.conf	setf hog
1552au BufNewFile,BufRead *.rules			call dist#ft#FTRules()
1553
1554" Spec (Linux RPM)
1555au BufNewFile,BufRead *.spec			setf spec
1556
1557" Speedup (AspenTech plant simulator)
1558au BufNewFile,BufRead *.speedup,*.spdata,*.spd	setf spup
1559
1560" Slice
1561au BufNewFile,BufRead *.ice			setf slice
1562
1563" Spice
1564au BufNewFile,BufRead *.sp,*.spice		setf spice
1565
1566" Spyce
1567au BufNewFile,BufRead *.spy,*.spi		setf spyce
1568
1569" Squid
1570au BufNewFile,BufRead squid.conf		setf squid
1571
1572" SQL for Oracle Designer
1573au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks	setf sql
1574
1575" SQL
1576au BufNewFile,BufRead *.sql			call dist#ft#SQL()
1577
1578" SQLJ
1579au BufNewFile,BufRead *.sqlj			setf sqlj
1580
1581" SQR
1582au BufNewFile,BufRead *.sqr,*.sqi		setf sqr
1583
1584" OpenSSH configuration
1585au BufNewFile,BufRead ssh_config,*/.ssh/config	setf sshconfig
1586
1587" OpenSSH server configuration
1588au BufNewFile,BufRead sshd_config		setf sshdconfig
1589
1590" Stata
1591au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata	setf stata
1592" Also *.class, but not when it's a Java bytecode file
1593au BufNewFile,BufRead *.class
1594	\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
1595
1596" SMCL
1597au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl	setf smcl
1598
1599" Stored Procedures
1600au BufNewFile,BufRead *.stp			setf stp
1601
1602" Standard ML
1603au BufNewFile,BufRead *.sml			setf sml
1604
1605" Sratus VOS command macro
1606au BufNewFile,BufRead *.cm			setf voscm
1607
1608" Sysctl
1609au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf	setf sysctl
1610
1611" Systemd unit files
1612au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer}	setf systemd
1613
1614" Synopsys Design Constraints
1615au BufNewFile,BufRead *.sdc			setf sdc
1616
1617" Sudoers
1618au BufNewFile,BufRead */etc/sudoers,sudoers.tmp	setf sudoers
1619
1620" SVG (Scalable Vector Graphics)
1621au BufNewFile,BufRead *.svg			setf svg
1622
1623" Tads (or Nroff or Perl test file)
1624au BufNewFile,BufRead *.t
1625	\ if !dist#ft#FTnroff() && !dist#ft#FTperl() | setf tads | endif
1626
1627" Tags
1628au BufNewFile,BufRead tags			setf tags
1629
1630" TAK
1631au BufNewFile,BufRead *.tak			setf tak
1632
1633" Task
1634au BufRead,BufNewFile {pending,completed,undo}.data  setf taskdata
1635au BufRead,BufNewFile *.task			setf taskedit
1636
1637" Tcl (JACL too)
1638au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl	setf tcl
1639
1640" TealInfo
1641au BufNewFile,BufRead *.tli			setf tli
1642
1643" Telix Salt
1644au BufNewFile,BufRead *.slt			setf tsalt
1645
1646" Tera Term Language
1647au BufRead,BufNewFile *.ttl			setf teraterm
1648
1649" Terminfo
1650au BufNewFile,BufRead *.ti			setf terminfo
1651
1652" TeX
1653au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl	setf tex
1654au BufNewFile,BufRead *.tex			call dist#ft#FTtex()
1655
1656" ConTeXt
1657au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi   setf context
1658
1659" Texinfo
1660au BufNewFile,BufRead *.texinfo,*.texi,*.txi	setf texinfo
1661
1662" TeX configuration
1663au BufNewFile,BufRead texmf.cnf			setf texmf
1664
1665" Tidy config
1666au BufNewFile,BufRead .tidyrc,tidyrc		setf tidy
1667
1668" TF mud client
1669au BufNewFile,BufRead *.tf,.tfrc,tfrc		setf tf
1670
1671" tmux configuration
1672au BufNewFile,BufRead {.,}tmux*.conf		setf tmux
1673
1674" TPP - Text Presentation Program
1675au BufNewFile,BufReadPost *.tpp			setf tpp
1676
1677" Treetop
1678au BufRead,BufNewFile *.treetop			setf treetop
1679
1680" Trustees
1681au BufNewFile,BufRead trustees.conf		setf trustees
1682
1683" TSS - Geometry
1684au BufNewFile,BufReadPost *.tssgm		setf tssgm
1685
1686" TSS - Optics
1687au BufNewFile,BufReadPost *.tssop		setf tssop
1688
1689" TSS - Command Line (temporary)
1690au BufNewFile,BufReadPost *.tsscl		setf tsscl
1691
1692" TWIG files
1693au BufNewFile,BufReadPost *.twig		setf twig
1694
1695" Motif UIT/UIL files
1696au BufNewFile,BufRead *.uit,*.uil		setf uil
1697
1698" Udev conf
1699au BufNewFile,BufRead */etc/udev/udev.conf	setf udevconf
1700
1701" Udev permissions
1702au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
1703"
1704" Udev symlinks config
1705au BufNewFile,BufRead */etc/udev/cdsymlinks.conf	setf sh
1706
1707" UnrealScript
1708au BufNewFile,BufRead *.uc			setf uc
1709
1710" Updatedb
1711au BufNewFile,BufRead */etc/updatedb.conf	setf updatedb
1712
1713" Upstart (init(8)) config files
1714au BufNewFile,BufRead */usr/share/upstart/*.conf	       setf upstart
1715au BufNewFile,BufRead */usr/share/upstart/*.override	       setf upstart
1716au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override  setf upstart
1717au BufNewFile,BufRead */.init/*.conf,*/.init/*.override	       setf upstart
1718au BufNewFile,BufRead */.config/upstart/*.conf		       setf upstart
1719au BufNewFile,BufRead */.config/upstart/*.override	       setf upstart
1720
1721" Vera
1722au BufNewFile,BufRead *.vr,*.vri,*.vrh		setf vera
1723
1724" Verilog HDL
1725au BufNewFile,BufRead *.v			setf verilog
1726
1727" Verilog-AMS HDL
1728au BufNewFile,BufRead *.va,*.vams		setf verilogams
1729
1730" SystemVerilog
1731au BufNewFile,BufRead *.sv,*.svh		setf systemverilog
1732
1733" VHDL
1734au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst  setf vhdl
1735au BufNewFile,BufRead *.vhdl_[0-9]*		call s:StarSetf('vhdl')
1736
1737" Vim script
1738au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc	setf vim
1739
1740" Viminfo file
1741au BufNewFile,BufRead .viminfo,_viminfo		setf viminfo
1742
1743" Virata Config Script File or Drupal module
1744au BufRead,BufNewFile *.hw,*.module,*.pkg
1745	\ if getline(1) =~ '<?php' |
1746	\   setf php |
1747	\ else |
1748	\   setf virata |
1749	\ endif
1750
1751" Visual Basic (also uses *.bas) or FORM
1752au BufNewFile,BufRead *.frm			call dist#ft#FTVB("form")
1753
1754" SaxBasic is close to Visual Basic
1755au BufNewFile,BufRead *.sba			setf vb
1756
1757" Vgrindefs file
1758au BufNewFile,BufRead vgrindefs			setf vgrindefs
1759
1760" VRML V1.0c
1761au BufNewFile,BufRead *.wrl			setf vrml
1762
1763" Vroom (vim testing and executable documentation)
1764au BufNewFile,BufRead *.vroom			setf vroom
1765
1766" Webmacro
1767au BufNewFile,BufRead *.wm			setf webmacro
1768
1769" WebAssembly
1770au BufNewFile,BufRead *.wast,*.wat		setf wast
1771
1772" Wget config
1773au BufNewFile,BufRead .wgetrc,wgetrc		setf wget
1774
1775" Website MetaLanguage
1776au BufNewFile,BufRead *.wml			setf wml
1777
1778" Winbatch
1779au BufNewFile,BufRead *.wbt			setf winbatch
1780
1781" WSML
1782au BufNewFile,BufRead *.wsml			setf wsml
1783
1784" WPL
1785au BufNewFile,BufRead *.wpl			setf xml
1786
1787" WvDial
1788au BufNewFile,BufRead wvdial.conf,.wvdialrc	setf wvdial
1789
1790" CVS RC file
1791au BufNewFile,BufRead .cvsrc			setf cvsrc
1792
1793" CVS commit file
1794au BufNewFile,BufRead cvs\d\+			setf cvs
1795
1796" WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
1797" lines in a WEB file).
1798au BufNewFile,BufRead *.web
1799	\ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
1800	\   setf web |
1801	\ else |
1802	\   setf winbatch |
1803	\ endif
1804
1805" Windows Scripting Host and Windows Script Component
1806au BufNewFile,BufRead *.ws[fc]			setf wsh
1807
1808" XHTML
1809au BufNewFile,BufRead *.xhtml,*.xht		setf xhtml
1810
1811" X Pixmap (dynamically sets colors, use BufEnter to make it work better)
1812au BufEnter *.xpm
1813	\ if getline(1) =~ "XPM2" |
1814	\   setf xpm2 |
1815	\ else |
1816	\   setf xpm |
1817	\ endif
1818au BufEnter *.xpm2				setf xpm2
1819
1820" XFree86 config
1821au BufNewFile,BufRead XF86Config
1822	\ if getline(1) =~ '\<XConfigurator\>' |
1823	\   let b:xf86conf_xfree86_version = 3 |
1824	\ endif |
1825	\ setf xf86conf
1826au BufNewFile,BufRead */xorg.conf.d/*.conf
1827	\ let b:xf86conf_xfree86_version = 4 |
1828	\ setf xf86conf
1829
1830" Xorg config
1831au BufNewFile,BufRead xorg.conf,xorg.conf-4	let b:xf86conf_xfree86_version = 4 | setf xf86conf
1832
1833" Xinetd conf
1834au BufNewFile,BufRead */etc/xinetd.conf		setf xinetd
1835
1836" XS Perl extension interface language
1837au BufNewFile,BufRead *.xs			setf xs
1838
1839" X resources file
1840au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
1841
1842" Xmath
1843au BufNewFile,BufRead *.msc,*.msf		setf xmath
1844au BufNewFile,BufRead *.ms
1845	\ if !dist#ft#FTnroff() | setf xmath | endif
1846
1847" XML  specific variants: docbk and xbl
1848au BufNewFile,BufRead *.xml			call dist#ft#FTxml()
1849
1850" XMI (holding UML models) is also XML
1851au BufNewFile,BufRead *.xmi			setf xml
1852
1853" CSPROJ files are Visual Studio.NET's XML-based project config files
1854au BufNewFile,BufRead *.csproj,*.csproj.user	setf xml
1855
1856" Qt Linguist translation source and Qt User Interface Files are XML
1857au BufNewFile,BufRead *.ts,*.ui			setf xml
1858
1859" TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
1860au BufNewFile,BufRead *.tpm			setf xml
1861
1862" Xdg menus
1863au BufNewFile,BufRead */etc/xdg/menus/*.menu	setf xml
1864
1865" ATI graphics driver configuration
1866au BufNewFile,BufRead fglrxrc			setf xml
1867
1868" Web Services Description Language (WSDL)
1869au BufNewFile,BufRead *.wsdl			setf xml
1870
1871" XLIFF (XML Localisation Interchange File Format) is also XML
1872au BufNewFile,BufRead *.xlf			setf xml
1873au BufNewFile,BufRead *.xliff			setf xml
1874
1875" XML User Interface Language
1876au BufNewFile,BufRead *.xul			setf xml
1877
1878" X11 xmodmap (also see below)
1879au BufNewFile,BufRead *Xmodmap			setf xmodmap
1880
1881" Xquery
1882au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy	setf xquery
1883
1884" XSD
1885au BufNewFile,BufRead *.xsd			setf xsd
1886
1887" Xslt
1888au BufNewFile,BufRead *.xsl,*.xslt		setf xslt
1889
1890" Yacc
1891au BufNewFile,BufRead *.yy,*.yxx,*.y++		setf yacc
1892
1893" Yacc or racc
1894au BufNewFile,BufRead *.y			call dist#ft#FTy()
1895
1896" Yaml or Raml
1897au BufNewFile,BufRead *.yaml,*.yml,*.raml	setf yaml
1898
1899" yum conf (close enough to dosini)
1900au BufNewFile,BufRead */etc/yum.conf		setf dosini
1901
1902" Zimbu
1903au BufNewFile,BufRead *.zu			setf zimbu
1904" Zimbu Templates
1905au BufNewFile,BufRead *.zut			setf zimbutempl
1906
1907" Zope
1908"   dtml (zope dynamic template markup language), pt (zope page template),
1909"   cpt (zope form controller page template)
1910au BufNewFile,BufRead *.dtml,*.pt,*.cpt		call dist#ft#FThtml()
1911"   zsql (zope sql method)
1912au BufNewFile,BufRead *.zsql			call dist#ft#SQL()
1913
1914" Z80 assembler asz80
1915au BufNewFile,BufRead *.z8a			setf z8a
1916
1917augroup END
1918
1919
1920" Source the user-specified filetype file, for backwards compatibility with
1921" Vim 5.x.
1922if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
1923  execute "source " . myfiletypefile
1924endif
1925
1926
1927" Check for "*" after loading myfiletypefile, so that scripts.vim is only used
1928" when there are no matching file name extensions.
1929" Don't do this for compressed files.
1930augroup filetypedetect
1931au BufNewFile,BufRead *
1932	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
1933	\ | runtime! scripts.vim | endif
1934au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
1935
1936
1937" Extra checks for when no filetype has been detected now.  Mostly used for
1938" patterns that end in "*".  E.g., "zsh*" matches "zsh.vim", but that's a Vim
1939" script file.
1940" Most of these should call s:StarSetf() to avoid names ending in .gz and the
1941" like are used.
1942
1943" More Apache style config files
1944au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/*	call s:StarSetf('apachestyle')
1945
1946" More Apache config files
1947au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*	call s:StarSetf('apache')
1948au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf*		call s:StarSetf('apache')
1949
1950" Asterisk config file
1951au BufNewFile,BufRead *asterisk/*.conf*		call s:StarSetf('asterisk')
1952au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
1953
1954" Bazaar version control
1955au BufNewFile,BufRead bzr_log.*			setf bzr
1956
1957" Bazel build file
1958if !has("fname_case")
1959  au BufNewFile,BufRead BUILD			setf bzl
1960endif
1961
1962" BIND zone
1963au BufNewFile,BufRead */named/db.*,*/bind/db.*	call s:StarSetf('bindzone')
1964
1965" Calendar
1966au BufNewFile,BufRead */.calendar/*,
1967	\*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
1968	\					call s:StarSetf('calendar')
1969
1970" Changelog
1971au BufNewFile,BufRead [cC]hange[lL]og*
1972	\ if getline(1) =~ '; urgency='
1973	\|  call s:StarSetf('debchangelog')
1974	\|else
1975	\|  call s:StarSetf('changelog')
1976	\|endif
1977
1978" Crontab
1979au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/*		call s:StarSetf('crontab')
1980
1981" dnsmasq(8) configuration
1982au BufNewFile,BufRead */etc/dnsmasq.d/*		call s:StarSetf('dnsmasq')
1983
1984" Dracula
1985au BufNewFile,BufRead drac.*			call s:StarSetf('dracula')
1986
1987" Fvwm
1988au BufNewFile,BufRead */.fvwm/*			call s:StarSetf('fvwm')
1989au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
1990	\ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
1991au BufNewFile,BufRead *fvwm2rc*
1992	\ if expand("<afile>:e") == "m4"
1993	\|  call s:StarSetf('fvwm2m4')
1994	\|else
1995	\|  let b:fvwm_version = 2 | call s:StarSetf('fvwm')
1996	\|endif
1997
1998" Gedcom
1999au BufNewFile,BufRead */tmp/lltmp*		call s:StarSetf('gedcom')
2000
2001" GTK RC
2002au BufNewFile,BufRead .gtkrc*,gtkrc*		call s:StarSetf('gtkrc')
2003
2004" Jam
2005au BufNewFile,BufRead Prl*.*,JAM*.*		call s:StarSetf('jam')
2006
2007" Jargon
2008au! BufNewFile,BufRead *jarg*
2009	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
2010	\|  call s:StarSetf('jargon')
2011	\|endif
2012
2013" Kconfig
2014au BufNewFile,BufRead Kconfig.*			call s:StarSetf('kconfig')
2015
2016" Lilo: Linux loader
2017au BufNewFile,BufRead lilo.conf*		call s:StarSetf('lilo')
2018
2019" Logcheck
2020au BufNewFile,BufRead */etc/logcheck/*.d*/*	call s:StarSetf('logcheck')
2021
2022" Makefile
2023au BufNewFile,BufRead [mM]akefile*		call s:StarSetf('make')
2024
2025" Ruby Makefile
2026au BufNewFile,BufRead [rR]akefile*		call s:StarSetf('ruby')
2027
2028" Mail (also matches muttrc.vim, so this is below the other checks)
2029au BufNewFile,BufRead {neo,}mutt[[:alnum:]._-]\\\{6\}	setf mail
2030
2031au BufNewFile,BufRead reportbug-*		call s:StarSetf('mail')
2032
2033" Modconf
2034au BufNewFile,BufRead */etc/modutils/*
2035	\ if executable(expand("<afile>")) != 1
2036	\|  call s:StarSetf('modconf')
2037	\|endif
2038au BufNewFile,BufRead */etc/modprobe.*		call s:StarSetf('modconf')
2039
2040" Mutt setup file
2041au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc*	call s:StarSetf('muttrc')
2042au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc*		call s:StarSetf('muttrc')
2043
2044" Neomutt setup file
2045au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc*	call s:StarSetf('neomuttrc')
2046au BufNewFile,BufRead neomuttrc*,Neomuttrc*		call s:StarSetf('neomuttrc')
2047
2048" Nroff macros
2049au BufNewFile,BufRead tmac.*			call s:StarSetf('nroff')
2050
2051" OpenBSD hostname.if
2052au BufNewFile,BufRead /etc/hostname.*		call s:StarSetf('config')
2053
2054" Pam conf
2055au BufNewFile,BufRead */etc/pam.d/*		call s:StarSetf('pamconf')
2056
2057" Printcap and Termcap
2058au BufNewFile,BufRead *printcap*
2059	\ if !did_filetype()
2060	\|  let b:ptcap_type = "print" | call s:StarSetf('ptcap')
2061	\|endif
2062au BufNewFile,BufRead *termcap*
2063	\ if !did_filetype()
2064	\|  let b:ptcap_type = "term" | call s:StarSetf('ptcap')
2065	\|endif
2066
2067" ReDIF
2068" Only used when the .rdf file was not detected to be XML.
2069au BufRead,BufNewFile *.rdf			call dist#ft#Redif()
2070
2071" Remind
2072au BufNewFile,BufRead .reminders*		call s:StarSetf('remind')
2073
2074" Vim script
2075au BufNewFile,BufRead *vimrc*			call s:StarSetf('vim')
2076
2077" Subversion commit file
2078au BufNewFile,BufRead svn-commit*.tmp		setf svn
2079
2080" X resources file
2081au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
2082
2083" XFree86 config
2084au BufNewFile,BufRead XF86Config-4*
2085	\ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf')
2086au BufNewFile,BufRead XF86Config*
2087	\ if getline(1) =~ '\<XConfigurator\>'
2088	\|  let b:xf86conf_xfree86_version = 3
2089	\|endif
2090	\|call s:StarSetf('xf86conf')
2091
2092" X11 xmodmap
2093au BufNewFile,BufRead *xmodmap*			call s:StarSetf('xmodmap')
2094
2095" Xinetd conf
2096au BufNewFile,BufRead */etc/xinetd.d/*		call s:StarSetf('xinetd')
2097
2098" yum conf (close enough to dosini)
2099au BufNewFile,BufRead */etc/yum.repos.d/*	call s:StarSetf('dosini')
2100
2101" Z-Shell script
2102au BufNewFile,BufRead zsh*,zlog*		call s:StarSetf('zsh')
2103
2104
2105" Plain text files, needs to be far down to not override others.  This avoids
2106" the "conf" type being used if there is a line starting with '#'.
2107au BufNewFile,BufRead *.text,README		setf text
2108
2109" Help files match *.txt but should have a last line that is a modeline.
2110au BufNewFile,BufRead *.txt
2111	\  if getline('$') !~ 'vim:.*ft=help'
2112	\|   setf text
2113	\| endif
2114
2115
2116" Use the filetype detect plugins.  They may overrule any of the previously
2117" detected filetypes.
2118runtime! ftdetect/*.vim
2119
2120" NOTE: The above command could have ended the filetypedetect autocmd group
2121" and started another one. Let's make sure it has ended to get to a consistent
2122" state.
2123augroup END
2124
2125" Generic configuration file. Use FALLBACK, it's just guessing!
2126au filetypedetect BufNewFile,BufRead,StdinReadPost *
2127	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
2128	\    && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
2129	\	|| getline(4) =~ '^#' || getline(5) =~ '^#') |
2130	\   setf FALLBACK conf |
2131	\ endif
2132
2133
2134" If the GUI is already running, may still need to install the Syntax menu.
2135" Don't do it when the 'M' flag is included in 'guioptions'.
2136if has("menu") && has("gui_running")
2137      \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
2138  source <sfile>:p:h/menu.vim
2139endif
2140
2141" Function called for testing all functions defined here.  These are
2142" script-local, thus need to be executed here.
2143" Returns a string with error messages (hopefully empty).
2144func! TestFiletypeFuncs(testlist)
2145  let output = ''
2146  for f in a:testlist
2147    try
2148      exe f
2149    catch
2150      let output = output . "\n" . f . ": " . v:exception
2151    endtry
2152  endfor
2153  return output
2154endfunc
2155
2156" Restore 'cpoptions'
2157let &cpo = s:cpo_save
2158unlet s:cpo_save
2159