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