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