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