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