xref: /vim-8.2.3635/runtime/filetype.vim (revision 125ed274)
1" Vim support file to detect file types
2"
3" Maintainer:	Bram Moolenaar <[email protected]>
4" Last Change:	2021 Apr 05
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" PowerShell
1283au BufNewFile,BufRead	*.ps1,*.psd1,*.psm1,*.pssc	setf ps1
1284au BufNewFile,BufRead	*.ps1xml			setf ps1xml
1285au BufNewFile,BufRead	*.cdxml,*.psc1			setf xml
1286
1287" Printcap and Termcap
1288au BufNewFile,BufRead *printcap
1289	\ let b:ptcap_type = "print" | setf ptcap
1290au BufNewFile,BufRead *termcap
1291	\ let b:ptcap_type = "term" | setf ptcap
1292
1293" PCCTS / ANTLR
1294"au BufNewFile,BufRead *.g			setf antlr
1295au BufNewFile,BufRead *.g			setf pccts
1296
1297" PPWizard
1298au BufNewFile,BufRead *.it,*.ih			setf ppwiz
1299
1300" Puppet
1301au BufNewFile,BufRead Puppetfile		setf ruby
1302
1303" Embedded Puppet
1304au BufNewFile,BufRead *.epp			setf epuppet
1305
1306" Obj 3D file format
1307" TODO: is there a way to avoid MS-Windows Object files?
1308au BufNewFile,BufRead *.obj			setf obj
1309
1310" Oracle Pro*C/C++
1311au BufNewFile,BufRead *.pc			setf proc
1312
1313" Privoxy actions file
1314au BufNewFile,BufRead *.action			setf privoxy
1315
1316" Procmail
1317au BufNewFile,BufRead .procmail,.procmailrc	setf procmail
1318
1319" Progress or CWEB
1320au BufNewFile,BufRead *.w			call dist#ft#FTprogress_cweb()
1321
1322" Progress or assembly
1323au BufNewFile,BufRead *.i			call dist#ft#FTprogress_asm()
1324
1325" Progress or Pascal
1326au BufNewFile,BufRead *.p			call dist#ft#FTprogress_pascal()
1327
1328" Software Distributor Product Specification File (POSIX 1387.2-1995)
1329au BufNewFile,BufRead *.psf			setf psf
1330au BufNewFile,BufRead INDEX,INFO
1331	\ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
1332	\   setf psf |
1333	\ endif
1334
1335" Prolog
1336au BufNewFile,BufRead *.pdb			setf prolog
1337
1338" Promela
1339au BufNewFile,BufRead *.pml			setf promela
1340
1341" Google protocol buffers
1342au BufNewFile,BufRead *.proto			setf proto
1343au BufNewFile,BufRead *.pbtxt			setf pbtxt
1344
1345" Poke
1346au BufNewFile,BufRead *.pk      		setf poke
1347
1348" Protocols
1349au BufNewFile,BufRead */etc/protocols		setf protocols
1350
1351" Pyrex
1352au BufNewFile,BufRead *.pyx,*.pxd		setf pyrex
1353
1354" Python, Python Shell Startup and Python Stub Files
1355" Quixote (Python-based web framework)
1356au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc  setf python
1357au BufNewFile,BufRead *.ptl,*.pyi,SConstruct		   setf python
1358
1359" Radiance
1360au BufNewFile,BufRead *.rad,*.mat		setf radiance
1361
1362" Ratpoison config/command files
1363au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc	setf ratpoison
1364
1365" RCS file
1366au BufNewFile,BufRead *\,v			setf rcs
1367
1368" Readline
1369au BufNewFile,BufRead .inputrc,inputrc		setf readline
1370
1371" Registry for MS-Windows
1372au BufNewFile,BufRead *.reg
1373	\ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
1374
1375" Renderman Interface Bytestream
1376au BufNewFile,BufRead *.rib			setf rib
1377
1378" Rego Policy Language
1379au BufNewFile,BufRead *.rego			setf rego
1380
1381" Rexx
1382au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit	setf rexx
1383
1384" R Help file
1385if has("fname_case")
1386  au BufNewFile,BufRead *.rd,*.Rd		setf rhelp
1387else
1388  au BufNewFile,BufRead *.rd			setf rhelp
1389endif
1390
1391" R noweb file
1392if has("fname_case")
1393  au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw		setf rnoweb
1394else
1395  au BufNewFile,BufRead *.rnw,*.snw			setf rnoweb
1396endif
1397
1398" R Markdown file
1399if has("fname_case")
1400  au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd		setf rmd
1401else
1402  au BufNewFile,BufRead *.rmd,*.smd			setf rmd
1403endif
1404
1405" RSS looks like XML
1406au BufNewFile,BufRead *.rss				setf xml
1407
1408" R reStructuredText file
1409if has("fname_case")
1410  au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst	setf rrst
1411else
1412  au BufNewFile,BufRead *.rrst,*.srst			setf rrst
1413endif
1414
1415" Rexx, Rebol or R
1416au BufNewFile,BufRead *.r,*.R				call dist#ft#FTr()
1417
1418" Remind
1419au BufNewFile,BufRead .reminders,*.remind,*.rem		setf remind
1420
1421" Resolv.conf
1422au BufNewFile,BufRead resolv.conf		setf resolv
1423
1424" Relax NG Compact
1425au BufNewFile,BufRead *.rnc			setf rnc
1426
1427" Relax NG XML
1428au BufNewFile,BufRead *.rng			setf rng
1429
1430" RPL/2
1431au BufNewFile,BufRead *.rpl			setf rpl
1432
1433" Robots.txt
1434au BufNewFile,BufRead robots.txt		setf robots
1435
1436" Rpcgen
1437au BufNewFile,BufRead *.x			setf rpcgen
1438
1439" reStructuredText Documentation Format
1440au BufNewFile,BufRead *.rst			setf rst
1441
1442" RTF
1443au BufNewFile,BufRead *.rtf			setf rtf
1444
1445" Interactive Ruby shell
1446au BufNewFile,BufRead .irbrc,irbrc		setf ruby
1447
1448" Ruby
1449au BufNewFile,BufRead *.rb,*.rbw		setf ruby
1450
1451" RubyGems
1452au BufNewFile,BufRead *.gemspec			setf ruby
1453
1454" RBS (Ruby Signature)
1455au BufNewFile,BufRead *.rbs			setf rbs
1456
1457" Rackup
1458au BufNewFile,BufRead *.ru			setf ruby
1459
1460" Bundler
1461au BufNewFile,BufRead Gemfile			setf ruby
1462
1463" Ruby on Rails
1464au BufNewFile,BufRead *.builder,*.rxml,*.rjs	setf ruby
1465
1466" Rantfile and Rakefile is like Ruby
1467au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake	setf ruby
1468
1469" Rust
1470au BufNewFile,BufRead *.rs			setf rust
1471
1472" S-lang (or shader language, or SmallLisp)
1473au BufNewFile,BufRead *.sl			setf slang
1474
1475" Samba config
1476au BufNewFile,BufRead smb.conf			setf samba
1477
1478" SAS script
1479au BufNewFile,BufRead *.sas			setf sas
1480
1481" Sass
1482au BufNewFile,BufRead *.sass			setf sass
1483
1484" Sather
1485au BufNewFile,BufRead *.sa			setf sather
1486
1487" Scala
1488au BufNewFile,BufRead *.scala			setf scala
1489
1490" SBT - Scala Build Tool
1491au BufNewFile,BufRead *.sbt			setf sbt
1492
1493" Scilab
1494au BufNewFile,BufRead *.sci,*.sce		setf scilab
1495
1496" SCSS
1497au BufNewFile,BufRead *.scss			setf scss
1498
1499" SD: Streaming Descriptors
1500au BufNewFile,BufRead *.sd			setf sd
1501
1502" SDL
1503au BufNewFile,BufRead *.sdl,*.pr		setf sdl
1504
1505" sed
1506au BufNewFile,BufRead *.sed			setf sed
1507
1508" svelte
1509au BufNewFile,BufRead *.svelte			setf svelte
1510
1511" Sieve (RFC 3028, 5228)
1512au BufNewFile,BufRead *.siv,*.sieve		setf sieve
1513
1514" Sendmail
1515au BufNewFile,BufRead sendmail.cf		setf sm
1516
1517" Sendmail .mc files are actually m4.  Could also be MS Message text file.
1518au BufNewFile,BufRead *.mc			call dist#ft#McSetf()
1519
1520" Services
1521au BufNewFile,BufRead */etc/services		setf services
1522
1523" Service Location config
1524au BufNewFile,BufRead */etc/slp.conf		setf slpconf
1525
1526" Service Location registration
1527au BufNewFile,BufRead */etc/slp.reg		setf slpreg
1528
1529" Service Location SPI
1530au BufNewFile,BufRead */etc/slp.spi		setf slpspi
1531
1532" Setserial config
1533au BufNewFile,BufRead */etc/serial.conf		setf setserial
1534
1535" SGML
1536au BufNewFile,BufRead *.sgm,*.sgml
1537	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
1538	\   setf sgmllnx |
1539	\ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
1540	\   let b:docbk_type = "sgml" |
1541	\   let b:docbk_ver = 4 |
1542	\   setf docbk |
1543	\ else |
1544	\   setf sgml |
1545	\ endif
1546
1547" SGMLDECL
1548au BufNewFile,BufRead *.decl,*.dcl,*.dec
1549	\ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
1550	\    setf sgmldecl |
1551	\ endif
1552
1553" SGML catalog file
1554au BufNewFile,BufRead catalog			setf catalog
1555
1556" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
1557" Gentoo ebuilds, Arch Linux PKGBUILDs and Alpine Linux APKBUILDs are actually
1558" bash scripts.
1559" NOTE: Patterns ending in a star are further down, these have lower priority.
1560au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
1561au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
1562au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
1563
1564" Shell script (Arch Linux) or PHP file (Drupal)
1565au BufNewFile,BufRead *.install
1566	\ if getline(1) =~ '<?php' |
1567	\   setf php |
1568	\ else |
1569	\   call dist#ft#SetFileTypeSH("bash") |
1570	\ endif
1571
1572" tcsh scripts (patterns ending in a star further below)
1573au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login	call dist#ft#SetFileTypeShell("tcsh")
1574
1575" csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
1576" (patterns ending in a start further below)
1577au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call dist#ft#CSH()
1578
1579" Z-Shell script (patterns ending in a star further below)
1580au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks  setf zsh
1581au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
1582au BufNewFile,BufRead *.zsh			setf zsh
1583
1584" Scheme
1585au BufNewFile,BufRead *.scm,*.ss,*.rkt		setf scheme
1586
1587" Screen RC
1588au BufNewFile,BufRead .screenrc,screenrc	setf screen
1589
1590" Sexplib
1591au BufNewFile,BufRead *.sexp setf sexplib
1592
1593" Simula
1594au BufNewFile,BufRead *.sim			setf simula
1595
1596" SINDA
1597au BufNewFile,BufRead *.sin,*.s85		setf sinda
1598
1599" SiSU
1600au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu
1601au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
1602
1603" SKILL
1604au BufNewFile,BufRead *.il,*.ils,*.cdf		setf skill
1605
1606" SLRN
1607au BufNewFile,BufRead .slrnrc			setf slrnrc
1608au BufNewFile,BufRead *.score			setf slrnsc
1609
1610" Smalltalk (and TeX)
1611au BufNewFile,BufRead *.st			setf st
1612au BufNewFile,BufRead *.cls
1613	\ if getline(1) =~ '^%' |
1614	\  setf tex |
1615	\ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
1616	\  setf rexx |
1617	\ else |
1618	\  setf st |
1619	\ endif
1620
1621" Smarty templates
1622au BufNewFile,BufRead *.tpl			setf smarty
1623
1624" SMIL or XML
1625au BufNewFile,BufRead *.smil
1626	\ if getline(1) =~ '<?\s*xml.*?>' |
1627	\   setf xml |
1628	\ else |
1629	\   setf smil |
1630	\ endif
1631
1632" SMIL or SNMP MIB file
1633au BufNewFile,BufRead *.smi
1634	\ if getline(1) =~ '\<smil\>' |
1635	\   setf smil |
1636	\ else |
1637	\   setf mib |
1638	\ endif
1639
1640" SMITH
1641au BufNewFile,BufRead *.smt,*.smith		setf smith
1642
1643" Snobol4 and spitbol
1644au BufNewFile,BufRead *.sno,*.spt		setf snobol4
1645
1646" SNMP MIB files
1647au BufNewFile,BufRead *.mib,*.my		setf mib
1648
1649" Snort Configuration
1650au BufNewFile,BufRead *.hog,snort.conf,vision.conf	setf hog
1651au BufNewFile,BufRead *.rules			call dist#ft#FTRules()
1652
1653" SPARQL queries
1654au BufNewFile,BufRead *.rq,*.sparql		setf sparql
1655
1656" Spec (Linux RPM)
1657au BufNewFile,BufRead *.spec			setf spec
1658
1659" Speedup (AspenTech plant simulator)
1660au BufNewFile,BufRead *.speedup,*.spdata,*.spd	setf spup
1661
1662" Slice
1663au BufNewFile,BufRead *.ice			setf slice
1664
1665" Spice
1666au BufNewFile,BufRead *.sp,*.spice		setf spice
1667
1668" Spyce
1669au BufNewFile,BufRead *.spy,*.spi		setf spyce
1670
1671" Squid
1672au BufNewFile,BufRead squid.conf		setf squid
1673
1674" SQL for Oracle Designer
1675au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks	setf sql
1676
1677" SQL
1678au BufNewFile,BufRead *.sql			call dist#ft#SQL()
1679
1680" SQLJ
1681au BufNewFile,BufRead *.sqlj			setf sqlj
1682
1683" SQR
1684au BufNewFile,BufRead *.sqr,*.sqi		setf sqr
1685
1686" OpenSSH configuration
1687au BufNewFile,BufRead ssh_config,*/.ssh/config		setf sshconfig
1688au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf	setf sshconfig
1689
1690" OpenSSH server configuration
1691au BufNewFile,BufRead sshd_config			setf sshdconfig
1692au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf	setf sshdconfig
1693
1694" Stata
1695au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata	setf stata
1696" Also *.class, but not when it's a Java bytecode file
1697au BufNewFile,BufRead *.class
1698	\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
1699
1700" SMCL
1701au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl	setf smcl
1702
1703" Stored Procedures
1704au BufNewFile,BufRead *.stp			setf stp
1705
1706" Standard ML
1707au BufNewFile,BufRead *.sml			setf sml
1708
1709" Sratus VOS command macro
1710au BufNewFile,BufRead *.cm			setf voscm
1711
1712" Swift
1713au BufNewFile,BufRead *.swift			setf swift
1714au BufNewFile,BufRead *.swift.gyb		setf swiftgyb
1715
1716" Swift Intermediate Language
1717au BufNewFile,BufRead *.sil			setf sil
1718
1719" Sysctl
1720au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf	setf sysctl
1721
1722" Systemd unit files
1723au BufNewFile,BufRead */systemd/*.{automount,dnssd,link,mount,netdev,network,nspawn,path,service,slice,socket,swap,target,timer}	setf systemd
1724" Systemd overrides
1725au BufNewFile,BufRead */etc/systemd/*.conf.d/*.conf	setf systemd
1726au BufNewFile,BufRead */etc/systemd/system/*.d/*.conf	setf systemd
1727au BufNewFile,BufRead */.config/systemd/user/*.d/*.conf	setf systemd
1728" Systemd temp files
1729au BufNewFile,BufRead */etc/systemd/system/*.d/.#*	setf systemd
1730au BufNewFile,BufRead */etc/systemd/system/.#*		setf systemd
1731au BufNewFile,BufRead */.config/systemd/user/*.d/.#*	setf systemd
1732au BufNewFile,BufRead */.config/systemd/user/.#*	setf systemd
1733
1734" Synopsys Design Constraints
1735au BufNewFile,BufRead *.sdc			setf sdc
1736
1737" Sudoers
1738au BufNewFile,BufRead */etc/sudoers,sudoers.tmp	setf sudoers
1739
1740" SVG (Scalable Vector Graphics)
1741au BufNewFile,BufRead *.svg			setf svg
1742
1743" Tads (or Nroff or Perl test file)
1744au BufNewFile,BufRead *.t
1745	\ if !dist#ft#FTnroff() && !dist#ft#FTperl() | setf tads | endif
1746
1747" Tags
1748au BufNewFile,BufRead tags			setf tags
1749
1750" TAK
1751au BufNewFile,BufRead *.tak			setf tak
1752
1753" Task
1754au BufRead,BufNewFile {pending,completed,undo}.data  setf taskdata
1755au BufRead,BufNewFile *.task			setf taskedit
1756
1757" Tcl (JACL too)
1758au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl	setf tcl
1759
1760" TealInfo
1761au BufNewFile,BufRead *.tli			setf tli
1762
1763" Telix Salt
1764au BufNewFile,BufRead *.slt			setf tsalt
1765
1766" Tera Term Language or Turtle
1767au BufRead,BufNewFile *.ttl
1768	\ if getline(1) =~ '^@\?\(prefix\|base\)' |
1769	\   setf turtle |
1770	\ else |
1771	\   setf teraterm |
1772	\ endif
1773
1774" Terminfo
1775au BufNewFile,BufRead *.ti			setf terminfo
1776
1777" TeX
1778au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl	setf tex
1779au BufNewFile,BufRead *.tex			call dist#ft#FTtex()
1780
1781" ConTeXt
1782au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx   setf context
1783
1784" Texinfo
1785au BufNewFile,BufRead *.texinfo,*.texi,*.txi	setf texinfo
1786
1787" TeX configuration
1788au BufNewFile,BufRead texmf.cnf			setf texmf
1789
1790" Tidy config
1791au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf	setf tidy
1792
1793" TF mud client
1794au BufNewFile,BufRead *.tf,.tfrc,tfrc		setf tf
1795
1796" tmux configuration
1797au BufNewFile,BufRead {.,}tmux*.conf		setf tmux
1798
1799" TOML
1800au BufNewFile,BufRead *.toml			setf toml
1801
1802" TPP - Text Presentation Program
1803au BufNewFile,BufReadPost *.tpp			setf tpp
1804
1805" Treetop
1806au BufRead,BufNewFile *.treetop			setf treetop
1807
1808" Trustees
1809au BufNewFile,BufRead trustees.conf		setf trustees
1810
1811" TSS - Geometry
1812au BufNewFile,BufReadPost *.tssgm		setf tssgm
1813
1814" TSS - Optics
1815au BufNewFile,BufReadPost *.tssop		setf tssop
1816
1817" TSS - Command Line (temporary)
1818au BufNewFile,BufReadPost *.tsscl		setf tsscl
1819
1820" TWIG files
1821au BufNewFile,BufReadPost *.twig		setf twig
1822
1823" Typescript or Qt translation file (which is XML)
1824au BufNewFile,BufReadPost *.ts
1825	\ if getline(1) =~ '<?xml' |
1826	\   setf xml |
1827	\ else |
1828	\   setf typescript |
1829	\ endif
1830
1831" TypeScript with React
1832au BufNewFile,BufRead *.tsx			setf typescriptreact
1833
1834" Motif UIT/UIL files
1835au BufNewFile,BufRead *.uit,*.uil		setf uil
1836
1837" Udev conf
1838au BufNewFile,BufRead */etc/udev/udev.conf	setf udevconf
1839
1840" Udev permissions
1841au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
1842"
1843" Udev symlinks config
1844au BufNewFile,BufRead */etc/udev/cdsymlinks.conf	setf sh
1845
1846" UnrealScript
1847au BufNewFile,BufRead *.uc			setf uc
1848
1849" Updatedb
1850au BufNewFile,BufRead */etc/updatedb.conf	setf updatedb
1851
1852" Upstart (init(8)) config files
1853au BufNewFile,BufRead */usr/share/upstart/*.conf	       setf upstart
1854au BufNewFile,BufRead */usr/share/upstart/*.override	       setf upstart
1855au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override  setf upstart
1856au BufNewFile,BufRead */.init/*.conf,*/.init/*.override	       setf upstart
1857au BufNewFile,BufRead */.config/upstart/*.conf		       setf upstart
1858au BufNewFile,BufRead */.config/upstart/*.override	       setf upstart
1859
1860" Vera
1861au BufNewFile,BufRead *.vr,*.vri,*.vrh		setf vera
1862
1863" Verilog HDL
1864au BufNewFile,BufRead *.v			setf verilog
1865
1866" Verilog-AMS HDL
1867au BufNewFile,BufRead *.va,*.vams		setf verilogams
1868
1869" SystemVerilog
1870au BufNewFile,BufRead *.sv,*.svh		setf systemverilog
1871
1872" VHDL
1873au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho  setf vhdl
1874
1875" Vim script
1876au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc	setf vim
1877
1878" Viminfo file
1879au BufNewFile,BufRead .viminfo,_viminfo		setf viminfo
1880
1881" Virata Config Script File or Drupal module
1882au BufRead,BufNewFile *.hw,*.module,*.pkg
1883	\ if getline(1) =~ '<?php' |
1884	\   setf php |
1885	\ else |
1886	\   setf virata |
1887	\ endif
1888
1889" Visual Basic (also uses *.bas) or FORM
1890au BufNewFile,BufRead *.frm			call dist#ft#FTVB("form")
1891
1892" SaxBasic is close to Visual Basic
1893au BufNewFile,BufRead *.sba			setf vb
1894
1895" Vgrindefs file
1896au BufNewFile,BufRead vgrindefs			setf vgrindefs
1897
1898" VRML V1.0c
1899au BufNewFile,BufRead *.wrl			setf vrml
1900
1901" Vroom (vim testing and executable documentation)
1902au BufNewFile,BufRead *.vroom			setf vroom
1903
1904" Vue.js Single File Component
1905au BufNewFile,BufRead *.vue			setf vue
1906
1907" WebAssembly
1908au BufNewFile,BufRead *.wast,*.wat		setf wast
1909
1910" Webmacro
1911au BufNewFile,BufRead *.wm			setf webmacro
1912
1913" Wget config
1914au BufNewFile,BufRead .wgetrc,wgetrc		setf wget
1915
1916" Website MetaLanguage
1917au BufNewFile,BufRead *.wml			setf wml
1918
1919" Winbatch
1920au BufNewFile,BufRead *.wbt			setf winbatch
1921
1922" WSML
1923au BufNewFile,BufRead *.wsml			setf wsml
1924
1925" WPL
1926au BufNewFile,BufRead *.wpl			setf xml
1927
1928" WvDial
1929au BufNewFile,BufRead wvdial.conf,.wvdialrc	setf wvdial
1930
1931" CVS RC file
1932au BufNewFile,BufRead .cvsrc			setf cvsrc
1933
1934" CVS commit file
1935au BufNewFile,BufRead cvs\d\+			setf cvs
1936
1937" WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
1938" lines in a WEB file).
1939au BufNewFile,BufRead *.web
1940	\ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
1941	\   setf web |
1942	\ else |
1943	\   setf winbatch |
1944	\ endif
1945
1946" Windows Scripting Host and Windows Script Component
1947au BufNewFile,BufRead *.ws[fc]			setf wsh
1948
1949" XHTML
1950au BufNewFile,BufRead *.xhtml,*.xht		setf xhtml
1951
1952" X Pixmap (dynamically sets colors, use BufEnter to make it work better)
1953au BufEnter *.xpm
1954	\ if getline(1) =~ "XPM2" |
1955	\   setf xpm2 |
1956	\ else |
1957	\   setf xpm |
1958	\ endif
1959au BufEnter *.xpm2				setf xpm2
1960
1961" XFree86 config
1962au BufNewFile,BufRead XF86Config
1963	\ if getline(1) =~ '\<XConfigurator\>' |
1964	\   let b:xf86conf_xfree86_version = 3 |
1965	\ endif |
1966	\ setf xf86conf
1967au BufNewFile,BufRead */xorg.conf.d/*.conf
1968	\ let b:xf86conf_xfree86_version = 4 |
1969	\ setf xf86conf
1970
1971" Xorg config
1972au BufNewFile,BufRead xorg.conf,xorg.conf-4	let b:xf86conf_xfree86_version = 4 | setf xf86conf
1973
1974" Xinetd conf
1975au BufNewFile,BufRead */etc/xinetd.conf		setf xinetd
1976
1977" XS Perl extension interface language
1978au BufNewFile,BufRead *.xs			setf xs
1979
1980" X resources file
1981au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
1982
1983" Xmath
1984au BufNewFile,BufRead *.msc,*.msf		setf xmath
1985au BufNewFile,BufRead *.ms
1986	\ if !dist#ft#FTnroff() | setf xmath | endif
1987
1988" XML  specific variants: docbk and xbl
1989au BufNewFile,BufRead *.xml			call dist#ft#FTxml()
1990
1991" XMI (holding UML models) is also XML
1992au BufNewFile,BufRead *.xmi			setf xml
1993
1994" CSPROJ files are Visual Studio.NET's XML-based project config files
1995au BufNewFile,BufRead *.csproj,*.csproj.user	setf xml
1996
1997" Qt Linguist translation source and Qt User Interface Files are XML
1998" However, for .ts Typescript is more common.
1999au BufNewFile,BufRead *.ui			setf xml
2000
2001" TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
2002au BufNewFile,BufRead *.tpm			setf xml
2003
2004" Xdg menus
2005au BufNewFile,BufRead */etc/xdg/menus/*.menu	setf xml
2006
2007" ATI graphics driver configuration
2008au BufNewFile,BufRead fglrxrc			setf xml
2009
2010" Web Services Description Language (WSDL)
2011au BufNewFile,BufRead *.wsdl			setf xml
2012
2013" XLIFF (XML Localisation Interchange File Format) is also XML
2014au BufNewFile,BufRead *.xlf			setf xml
2015au BufNewFile,BufRead *.xliff			setf xml
2016
2017" XML User Interface Language
2018au BufNewFile,BufRead *.xul			setf xml
2019
2020" X11 xmodmap (also see below)
2021au BufNewFile,BufRead *Xmodmap			setf xmodmap
2022
2023" Xquery
2024au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy	setf xquery
2025
2026" XSD
2027au BufNewFile,BufRead *.xsd			setf xsd
2028
2029" Xslt
2030au BufNewFile,BufRead *.xsl,*.xslt		setf xslt
2031
2032" Yacc
2033au BufNewFile,BufRead *.yy,*.yxx,*.y++		setf yacc
2034
2035" Yacc or racc
2036au BufNewFile,BufRead *.y			call dist#ft#FTy()
2037
2038" Yaml
2039au BufNewFile,BufRead *.yaml,*.yml		setf yaml
2040
2041" Raml
2042au BufNewFile,BufRead *.raml			setf raml
2043
2044" yum conf (close enough to dosini)
2045au BufNewFile,BufRead */etc/yum.conf		setf dosini
2046
2047" Zimbu
2048au BufNewFile,BufRead *.zu			setf zimbu
2049" Zimbu Templates
2050au BufNewFile,BufRead *.zut			setf zimbutempl
2051
2052" Zope
2053"   dtml (zope dynamic template markup language), pt (zope page template),
2054"   cpt (zope form controller page template)
2055au BufNewFile,BufRead *.dtml,*.pt,*.cpt		call dist#ft#FThtml()
2056"   zsql (zope sql method)
2057au BufNewFile,BufRead *.zsql			call dist#ft#SQL()
2058
2059" Z80 assembler asz80
2060au BufNewFile,BufRead *.z8a			setf z8a
2061
2062augroup END
2063
2064
2065" Source the user-specified filetype file, for backwards compatibility with
2066" Vim 5.x.
2067if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
2068  execute "source " . myfiletypefile
2069endif
2070
2071
2072" Check for "*" after loading myfiletypefile, so that scripts.vim is only used
2073" when there are no matching file name extensions.
2074" Don't do this for compressed files.
2075augroup filetypedetect
2076au BufNewFile,BufRead *
2077	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
2078	\ | runtime! scripts.vim | endif
2079au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
2080
2081
2082" Extra checks for when no filetype has been detected now.  Mostly used for
2083" patterns that end in "*".  E.g., "zsh*" matches "zsh.vim", but that's a Vim
2084" script file.
2085" Most of these should call s:StarSetf() to avoid names ending in .gz and the
2086" like are used.
2087
2088" More Apache style config files
2089au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/*	call s:StarSetf('apachestyle')
2090au BufNewFile,BufRead proftpd.conf*					call s:StarSetf('apachestyle')
2091
2092" More Apache config files
2093au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*	call s:StarSetf('apache')
2094au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf*		call s:StarSetf('apache')
2095
2096" Asterisk config file
2097au BufNewFile,BufRead *asterisk/*.conf*		call s:StarSetf('asterisk')
2098au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
2099
2100" Bazaar version control
2101au BufNewFile,BufRead bzr_log.*			setf bzr
2102
2103" Bazel build file
2104if !has("fname_case")
2105  au BufNewFile,BufRead *.BUILD,BUILD		setf bzl
2106endif
2107
2108" BIND zone
2109au BufNewFile,BufRead */named/db.*,*/bind/db.*	call s:StarSetf('bindzone')
2110
2111au BufNewFile,BufRead cabal.project.*		call s:StarSetf('cabalproject')
2112
2113" Calendar
2114au BufNewFile,BufRead */.calendar/*,
2115	\*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
2116	\					call s:StarSetf('calendar')
2117
2118" Changelog
2119au BufNewFile,BufRead [cC]hange[lL]og*
2120	\ if getline(1) =~ '; urgency='
2121	\|  call s:StarSetf('debchangelog')
2122	\|else
2123	\|  call s:StarSetf('changelog')
2124	\|endif
2125
2126" Crontab
2127au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/*		call s:StarSetf('crontab')
2128
2129" dnsmasq(8) configuration
2130au BufNewFile,BufRead */etc/dnsmasq.d/*		call s:StarSetf('dnsmasq')
2131
2132" Dracula
2133au BufNewFile,BufRead drac.*			call s:StarSetf('dracula')
2134
2135" Fvwm
2136au BufNewFile,BufRead */.fvwm/*			call s:StarSetf('fvwm')
2137au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
2138	\ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
2139au BufNewFile,BufRead *fvwm2rc*
2140	\ if expand("<afile>:e") == "m4"
2141	\|  call s:StarSetf('fvwm2m4')
2142	\|else
2143	\|  let b:fvwm_version = 2 | call s:StarSetf('fvwm')
2144	\|endif
2145
2146" Gedcom
2147au BufNewFile,BufRead */tmp/lltmp*		call s:StarSetf('gedcom')
2148
2149" Git
2150au BufNewFile,BufRead */.gitconfig.d/*,/etc/gitconfig.d/*	call s:StarSetf('gitconfig')
2151
2152" Gitolite
2153au BufNewFile,BufRead */gitolite-admin/conf/*	call s:StarSetf('gitolite')
2154
2155" GTK RC
2156au BufNewFile,BufRead .gtkrc*,gtkrc*		call s:StarSetf('gtkrc')
2157
2158" Jam
2159au BufNewFile,BufRead Prl*.*,JAM*.*		call s:StarSetf('jam')
2160
2161" Jargon
2162au! BufNewFile,BufRead *jarg*
2163	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
2164	\|  call s:StarSetf('jargon')
2165	\|endif
2166
2167" Java Properties resource file (note: doesn't catch font.properties.pl)
2168au BufNewFile,BufRead *.properties_??_??_*	call s:StarSetf('jproperties')
2169
2170" Kconfig
2171au BufNewFile,BufRead Kconfig.*			call s:StarSetf('kconfig')
2172
2173" Lilo: Linux loader
2174au BufNewFile,BufRead lilo.conf*		call s:StarSetf('lilo')
2175
2176" Logcheck
2177au BufNewFile,BufRead */etc/logcheck/*.d*/*	call s:StarSetf('logcheck')
2178
2179" Makefile
2180au BufNewFile,BufRead [mM]akefile*		call s:StarSetf('make')
2181
2182" Ruby Makefile
2183au BufNewFile,BufRead [rR]akefile*		call s:StarSetf('ruby')
2184
2185" Mail (also matches muttrc.vim, so this is below the other checks)
2186au BufNewFile,BufRead {neo,}mutt[[:alnum:]._-]\\\{6\}	setf mail
2187
2188au BufNewFile,BufRead reportbug-*		call s:StarSetf('mail')
2189
2190" Modconf
2191au BufNewFile,BufRead */etc/modutils/*
2192	\ if executable(expand("<afile>")) != 1
2193	\|  call s:StarSetf('modconf')
2194	\|endif
2195au BufNewFile,BufRead */etc/modprobe.*		call s:StarSetf('modconf')
2196
2197" Mutt setup file
2198au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc*	call s:StarSetf('muttrc')
2199au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc*		call s:StarSetf('muttrc')
2200
2201" Neomutt setup file
2202au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc*	call s:StarSetf('neomuttrc')
2203au BufNewFile,BufRead neomuttrc*,Neomuttrc*		call s:StarSetf('neomuttrc')
2204
2205" Nroff macros
2206au BufNewFile,BufRead tmac.*			call s:StarSetf('nroff')
2207
2208" OpenBSD hostname.if
2209au BufNewFile,BufRead /etc/hostname.*		call s:StarSetf('config')
2210
2211" Pam conf
2212au BufNewFile,BufRead */etc/pam.d/*		call s:StarSetf('pamconf')
2213
2214" Printcap and Termcap
2215au BufNewFile,BufRead *printcap*
2216	\ if !did_filetype()
2217	\|  let b:ptcap_type = "print" | call s:StarSetf('ptcap')
2218	\|endif
2219au BufNewFile,BufRead *termcap*
2220	\ if !did_filetype()
2221	\|  let b:ptcap_type = "term" | call s:StarSetf('ptcap')
2222	\|endif
2223
2224" ReDIF
2225" Only used when the .rdf file was not detected to be XML.
2226au BufRead,BufNewFile *.rdf			call dist#ft#Redif()
2227
2228" Remind
2229au BufNewFile,BufRead .reminders*		call s:StarSetf('remind')
2230
2231" SGML catalog file
2232au BufNewFile,BufRead sgml.catalog*		call s:StarSetf('catalog')
2233
2234" avoid doc files being recognized a shell files
2235au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
2236
2237" Shell scripts ending in a star
2238au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
2239au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
2240au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
2241
2242" tcsh scripts ending in a star
2243au BufNewFile,BufRead .tcshrc*	call dist#ft#SetFileTypeShell("tcsh")
2244
2245" csh scripts ending in a star
2246au BufNewFile,BufRead .login*,.cshrc*  call dist#ft#CSH()
2247
2248" VHDL
2249au BufNewFile,BufRead *.vhdl_[0-9]*		call s:StarSetf('vhdl')
2250
2251" Vim script
2252au BufNewFile,BufRead *vimrc*			call s:StarSetf('vim')
2253
2254" Subversion commit file
2255au BufNewFile,BufRead svn-commit*.tmp		setf svn
2256
2257" X resources file
2258au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
2259
2260" XFree86 config
2261au BufNewFile,BufRead XF86Config-4*
2262	\ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf')
2263au BufNewFile,BufRead XF86Config*
2264	\ if getline(1) =~ '\<XConfigurator\>'
2265	\|  let b:xf86conf_xfree86_version = 3
2266	\|endif
2267	\|call s:StarSetf('xf86conf')
2268
2269" X11 xmodmap
2270au BufNewFile,BufRead *xmodmap*			call s:StarSetf('xmodmap')
2271
2272" Xinetd conf
2273au BufNewFile,BufRead */etc/xinetd.d/*		call s:StarSetf('xinetd')
2274
2275" yum conf (close enough to dosini)
2276au BufNewFile,BufRead */etc/yum.repos.d/*	call s:StarSetf('dosini')
2277
2278" Z-Shell script ending in a star
2279au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh')
2280au BufNewFile,BufRead zsh*,zlog*		call s:StarSetf('zsh')
2281
2282
2283" Plain text files, needs to be far down to not override others.  This avoids
2284" the "conf" type being used if there is a line starting with '#'.
2285au BufNewFile,BufRead *.text,README		setf text
2286
2287" Help files match *.txt but should have a last line that is a modeline.
2288au BufNewFile,BufRead *.txt
2289	\  if getline('$') !~ 'vim:.*ft=help'
2290	\|   setf text
2291	\| endif
2292
2293
2294" Use the filetype detect plugins.  They may overrule any of the previously
2295" detected filetypes.
2296runtime! ftdetect/*.vim
2297
2298" NOTE: The above command could have ended the filetypedetect autocmd group
2299" and started another one. Let's make sure it has ended to get to a consistent
2300" state.
2301augroup END
2302
2303" Generic configuration file. Use FALLBACK, it's just guessing!
2304au filetypedetect BufNewFile,BufRead,StdinReadPost *
2305	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
2306	\    && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
2307	\	|| getline(4) =~ '^#' || getline(5) =~ '^#') |
2308	\   setf FALLBACK conf |
2309	\ endif
2310
2311
2312" If the GUI is already running, may still need to install the Syntax menu.
2313" Don't do it when the 'M' flag is included in 'guioptions'.
2314if has("menu") && has("gui_running")
2315      \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
2316  source <sfile>:p:h/menu.vim
2317endif
2318
2319" Function called for testing all functions defined here.  These are
2320" script-local, thus need to be executed here.
2321" Returns a string with error messages (hopefully empty).
2322func! TestFiletypeFuncs(testlist)
2323  let output = ''
2324  for f in a:testlist
2325    try
2326      exe f
2327    catch
2328      let output = output . "\n" . f . ": " . v:exception
2329    endtry
2330  endfor
2331  return output
2332endfunc
2333
2334" Restore 'cpoptions'
2335let &cpo = s:cpo_save
2336unlet s:cpo_save
2337