xref: /vim-8.2.3635/runtime/filetype.vim (revision 3fa5e64e)
1" Vim support file to detect file types
2"
3" Maintainer:	Bram Moolenaar <[email protected]>
4" Last Change:	2021 Mar 19
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[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.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
1565" Shell script (Arch Linux) or PHP file (Drupal)
1566au BufNewFile,BufRead *.install
1567	\ if getline(1) =~ '<?php' |
1568	\   setf php |
1569	\ else |
1570	\   call dist#ft#SetFileTypeSH("bash") |
1571	\ endif
1572
1573" tcsh scripts (patterns ending in a star further below)
1574au BufNewFile,BufRead .tcshrc,*.tcsh,tcsh.tcshrc,tcsh.login	call dist#ft#SetFileTypeShell("tcsh")
1575
1576" csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
1577" (patterns ending in a start further below)
1578au BufNewFile,BufRead .login,.cshrc,csh.cshrc,csh.login,csh.logout,*.csh,.alias  call dist#ft#CSH()
1579
1580" Z-Shell script (patterns ending in a star further below)
1581au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks  setf zsh
1582au BufNewFile,BufRead .zshrc,.zshenv,.zlogin,.zlogout,.zcompdump setf zsh
1583au BufNewFile,BufRead *.zsh			setf zsh
1584
1585" Scheme
1586au BufNewFile,BufRead *.scm,*.ss,*.rkt		setf scheme
1587
1588" Screen RC
1589au BufNewFile,BufRead .screenrc,screenrc	setf screen
1590
1591" Sexplib
1592au BufNewFile,BufRead *.sexp setf sexplib
1593
1594" Simula
1595au BufNewFile,BufRead *.sim			setf simula
1596
1597" SINDA
1598au BufNewFile,BufRead *.sin,*.s85		setf sinda
1599
1600" SiSU
1601au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu
1602au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
1603
1604" SKILL
1605au BufNewFile,BufRead *.il,*.ils,*.cdf		setf skill
1606
1607" SLRN
1608au BufNewFile,BufRead .slrnrc			setf slrnrc
1609au BufNewFile,BufRead *.score			setf slrnsc
1610
1611" Smalltalk (and TeX)
1612au BufNewFile,BufRead *.st			setf st
1613au BufNewFile,BufRead *.cls
1614	\ if getline(1) =~ '^%' |
1615	\  setf tex |
1616	\ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
1617	\  setf rexx |
1618	\ else |
1619	\  setf st |
1620	\ endif
1621
1622" Smarty templates
1623au BufNewFile,BufRead *.tpl			setf smarty
1624
1625" SMIL or XML
1626au BufNewFile,BufRead *.smil
1627	\ if getline(1) =~ '<?\s*xml.*?>' |
1628	\   setf xml |
1629	\ else |
1630	\   setf smil |
1631	\ endif
1632
1633" SMIL or SNMP MIB file
1634au BufNewFile,BufRead *.smi
1635	\ if getline(1) =~ '\<smil\>' |
1636	\   setf smil |
1637	\ else |
1638	\   setf mib |
1639	\ endif
1640
1641" SMITH
1642au BufNewFile,BufRead *.smt,*.smith		setf smith
1643
1644" Snobol4 and spitbol
1645au BufNewFile,BufRead *.sno,*.spt		setf snobol4
1646
1647" SNMP MIB files
1648au BufNewFile,BufRead *.mib,*.my		setf mib
1649
1650" Snort Configuration
1651au BufNewFile,BufRead *.hog,snort.conf,vision.conf	setf hog
1652au BufNewFile,BufRead *.rules			call dist#ft#FTRules()
1653
1654" SPARQL queries
1655au BufNewFile,BufRead *.rq,*.sparql		setf sparql
1656
1657" Spec (Linux RPM)
1658au BufNewFile,BufRead *.spec			setf spec
1659
1660" Speedup (AspenTech plant simulator)
1661au BufNewFile,BufRead *.speedup,*.spdata,*.spd	setf spup
1662
1663" Slice
1664au BufNewFile,BufRead *.ice			setf slice
1665
1666" Spice
1667au BufNewFile,BufRead *.sp,*.spice		setf spice
1668
1669" Spyce
1670au BufNewFile,BufRead *.spy,*.spi		setf spyce
1671
1672" Squid
1673au BufNewFile,BufRead squid.conf		setf squid
1674
1675" SQL for Oracle Designer
1676au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks	setf sql
1677
1678" SQL
1679au BufNewFile,BufRead *.sql			call dist#ft#SQL()
1680
1681" SQLJ
1682au BufNewFile,BufRead *.sqlj			setf sqlj
1683
1684" SQR
1685au BufNewFile,BufRead *.sqr,*.sqi		setf sqr
1686
1687" OpenSSH configuration
1688au BufNewFile,BufRead ssh_config,*/.ssh/config		setf sshconfig
1689au BufNewFile,BufRead */etc/ssh/ssh_config.d/*.conf	setf sshconfig
1690
1691" OpenSSH server configuration
1692au BufNewFile,BufRead sshd_config			setf sshdconfig
1693au BufNewFile,BufRead */etc/ssh/sshd_config.d/*.conf	setf sshdconfig
1694
1695" Stata
1696au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata	setf stata
1697" Also *.class, but not when it's a Java bytecode file
1698au BufNewFile,BufRead *.class
1699	\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
1700
1701" SMCL
1702au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl	setf smcl
1703
1704" Stored Procedures
1705au BufNewFile,BufRead *.stp			setf stp
1706
1707" Standard ML
1708au BufNewFile,BufRead *.sml			setf sml
1709
1710" Sratus VOS command macro
1711au BufNewFile,BufRead *.cm			setf voscm
1712
1713" Swift
1714au BufNewFile,BufRead *.swift			setf swift
1715au BufNewFile,BufRead *.swift.gyb		setf swiftgyb
1716
1717" Swift Intermediate Language
1718au BufNewFile,BufRead *.sil			setf sil
1719
1720" Sysctl
1721au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf	setf sysctl
1722
1723" Systemd unit files
1724au BufNewFile,BufRead */systemd/*.{automount,dnssd,link,mount,netdev,network,nspawn,path,service,slice,socket,swap,target,timer}	setf systemd
1725" Systemd overrides
1726au BufNewFile,BufRead */etc/systemd/*.conf.d/*.conf	setf systemd
1727au BufNewFile,BufRead */etc/systemd/system/*.d/*.conf	setf systemd
1728au BufNewFile,BufRead */.config/systemd/user/*.d/*.conf	setf systemd
1729" Systemd temp files
1730au BufNewFile,BufRead */etc/systemd/system/*.d/.#*	setf systemd
1731au BufNewFile,BufRead */etc/systemd/system/.#*		setf systemd
1732au BufNewFile,BufRead */.config/systemd/user/*.d/.#*	setf systemd
1733au BufNewFile,BufRead */.config/systemd/user/.#*	setf systemd
1734
1735" Synopsys Design Constraints
1736au BufNewFile,BufRead *.sdc			setf sdc
1737
1738" Sudoers
1739au BufNewFile,BufRead */etc/sudoers,sudoers.tmp	setf sudoers
1740
1741" SVG (Scalable Vector Graphics)
1742au BufNewFile,BufRead *.svg			setf svg
1743
1744" Tads (or Nroff or Perl test file)
1745au BufNewFile,BufRead *.t
1746	\ if !dist#ft#FTnroff() && !dist#ft#FTperl() | setf tads | endif
1747
1748" Tags
1749au BufNewFile,BufRead tags			setf tags
1750
1751" TAK
1752au BufNewFile,BufRead *.tak			setf tak
1753
1754" Task
1755au BufRead,BufNewFile {pending,completed,undo}.data  setf taskdata
1756au BufRead,BufNewFile *.task			setf taskedit
1757
1758" Tcl (JACL too)
1759au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl	setf tcl
1760
1761" TealInfo
1762au BufNewFile,BufRead *.tli			setf tli
1763
1764" Telix Salt
1765au BufNewFile,BufRead *.slt			setf tsalt
1766
1767" Tera Term Language or Turtle
1768au BufRead,BufNewFile *.ttl
1769	\ if getline(1) =~ '^@\?\(prefix\|base\)' |
1770	\   setf turtle |
1771	\ else |
1772	\   setf teraterm |
1773	\ endif
1774
1775" Terminfo
1776au BufNewFile,BufRead *.ti			setf terminfo
1777
1778" TeX
1779au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl	setf tex
1780au BufNewFile,BufRead *.tex			call dist#ft#FTtex()
1781
1782" ConTeXt
1783au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi,*.mkxl,*.mklx   setf context
1784
1785" Texinfo
1786au BufNewFile,BufRead *.texinfo,*.texi,*.txi	setf texinfo
1787
1788" TeX configuration
1789au BufNewFile,BufRead texmf.cnf			setf texmf
1790
1791" Tidy config
1792au BufNewFile,BufRead .tidyrc,tidyrc,tidy.conf	setf tidy
1793
1794" TF mud client
1795au BufNewFile,BufRead *.tf,.tfrc,tfrc		setf tf
1796
1797" tmux configuration
1798au BufNewFile,BufRead {.,}tmux*.conf		setf tmux
1799
1800" TOML
1801au BufNewFile,BufRead *.toml			setf toml
1802
1803" TPP - Text Presentation Program
1804au BufNewFile,BufReadPost *.tpp			setf tpp
1805
1806" Treetop
1807au BufRead,BufNewFile *.treetop			setf treetop
1808
1809" Trustees
1810au BufNewFile,BufRead trustees.conf		setf trustees
1811
1812" TSS - Geometry
1813au BufNewFile,BufReadPost *.tssgm		setf tssgm
1814
1815" TSS - Optics
1816au BufNewFile,BufReadPost *.tssop		setf tssop
1817
1818" TSS - Command Line (temporary)
1819au BufNewFile,BufReadPost *.tsscl		setf tsscl
1820
1821" TWIG files
1822au BufNewFile,BufReadPost *.twig		setf twig
1823
1824" Typescript or Qt translation file (which is XML)
1825au BufNewFile,BufReadPost *.ts
1826	\ if getline(1) =~ '<?xml' |
1827	\   setf xml |
1828	\ else |
1829	\   setf typescript |
1830	\ endif
1831
1832" TypeScript with React
1833au BufNewFile,BufRead *.tsx			setf typescriptreact
1834
1835" Motif UIT/UIL files
1836au BufNewFile,BufRead *.uit,*.uil		setf uil
1837
1838" Udev conf
1839au BufNewFile,BufRead */etc/udev/udev.conf	setf udevconf
1840
1841" Udev permissions
1842au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm
1843"
1844" Udev symlinks config
1845au BufNewFile,BufRead */etc/udev/cdsymlinks.conf	setf sh
1846
1847" UnrealScript
1848au BufNewFile,BufRead *.uc			setf uc
1849
1850" Updatedb
1851au BufNewFile,BufRead */etc/updatedb.conf	setf updatedb
1852
1853" Upstart (init(8)) config files
1854au BufNewFile,BufRead */usr/share/upstart/*.conf	       setf upstart
1855au BufNewFile,BufRead */usr/share/upstart/*.override	       setf upstart
1856au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override  setf upstart
1857au BufNewFile,BufRead */.init/*.conf,*/.init/*.override	       setf upstart
1858au BufNewFile,BufRead */.config/upstart/*.conf		       setf upstart
1859au BufNewFile,BufRead */.config/upstart/*.override	       setf upstart
1860
1861" Vera
1862au BufNewFile,BufRead *.vr,*.vri,*.vrh		setf vera
1863
1864" Verilog HDL
1865au BufNewFile,BufRead *.v			setf verilog
1866
1867" Verilog-AMS HDL
1868au BufNewFile,BufRead *.va,*.vams		setf verilogams
1869
1870" SystemVerilog
1871au BufNewFile,BufRead *.sv,*.svh		setf systemverilog
1872
1873" VHDL
1874au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho  setf vhdl
1875
1876" Vim script
1877au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc	setf vim
1878
1879" Viminfo file
1880au BufNewFile,BufRead .viminfo,_viminfo		setf viminfo
1881
1882" Virata Config Script File or Drupal module
1883au BufRead,BufNewFile *.hw,*.module,*.pkg
1884	\ if getline(1) =~ '<?php' |
1885	\   setf php |
1886	\ else |
1887	\   setf virata |
1888	\ endif
1889
1890" Visual Basic (also uses *.bas) or FORM
1891au BufNewFile,BufRead *.frm			call dist#ft#FTVB("form")
1892
1893" SaxBasic is close to Visual Basic
1894au BufNewFile,BufRead *.sba			setf vb
1895
1896" Vgrindefs file
1897au BufNewFile,BufRead vgrindefs			setf vgrindefs
1898
1899" VRML V1.0c
1900au BufNewFile,BufRead *.wrl			setf vrml
1901
1902" Vroom (vim testing and executable documentation)
1903au BufNewFile,BufRead *.vroom			setf vroom
1904
1905" Vue.js Single File Component
1906au BufNewFile,BufRead *.vue			setf vue
1907
1908" WebAssembly
1909au BufNewFile,BufRead *.wast,*.wat		setf wast
1910
1911" Webmacro
1912au BufNewFile,BufRead *.wm			setf webmacro
1913
1914" Wget config
1915au BufNewFile,BufRead .wgetrc,wgetrc		setf wget
1916
1917" Website MetaLanguage
1918au BufNewFile,BufRead *.wml			setf wml
1919
1920" Winbatch
1921au BufNewFile,BufRead *.wbt			setf winbatch
1922
1923" WSML
1924au BufNewFile,BufRead *.wsml			setf wsml
1925
1926" WPL
1927au BufNewFile,BufRead *.wpl			setf xml
1928
1929" WvDial
1930au BufNewFile,BufRead wvdial.conf,.wvdialrc	setf wvdial
1931
1932" CVS RC file
1933au BufNewFile,BufRead .cvsrc			setf cvsrc
1934
1935" CVS commit file
1936au BufNewFile,BufRead cvs\d\+			setf cvs
1937
1938" WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
1939" lines in a WEB file).
1940au BufNewFile,BufRead *.web
1941	\ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
1942	\   setf web |
1943	\ else |
1944	\   setf winbatch |
1945	\ endif
1946
1947" Windows Scripting Host and Windows Script Component
1948au BufNewFile,BufRead *.ws[fc]			setf wsh
1949
1950" XHTML
1951au BufNewFile,BufRead *.xhtml,*.xht		setf xhtml
1952
1953" X Pixmap (dynamically sets colors, use BufEnter to make it work better)
1954au BufEnter *.xpm
1955	\ if getline(1) =~ "XPM2" |
1956	\   setf xpm2 |
1957	\ else |
1958	\   setf xpm |
1959	\ endif
1960au BufEnter *.xpm2				setf xpm2
1961
1962" XFree86 config
1963au BufNewFile,BufRead XF86Config
1964	\ if getline(1) =~ '\<XConfigurator\>' |
1965	\   let b:xf86conf_xfree86_version = 3 |
1966	\ endif |
1967	\ setf xf86conf
1968au BufNewFile,BufRead */xorg.conf.d/*.conf
1969	\ let b:xf86conf_xfree86_version = 4 |
1970	\ setf xf86conf
1971
1972" Xorg config
1973au BufNewFile,BufRead xorg.conf,xorg.conf-4	let b:xf86conf_xfree86_version = 4 | setf xf86conf
1974
1975" Xinetd conf
1976au BufNewFile,BufRead */etc/xinetd.conf		setf xinetd
1977
1978" XS Perl extension interface language
1979au BufNewFile,BufRead *.xs			setf xs
1980
1981" X resources file
1982au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
1983
1984" Xmath
1985au BufNewFile,BufRead *.msc,*.msf		setf xmath
1986au BufNewFile,BufRead *.ms
1987	\ if !dist#ft#FTnroff() | setf xmath | endif
1988
1989" XML  specific variants: docbk and xbl
1990au BufNewFile,BufRead *.xml			call dist#ft#FTxml()
1991
1992" XMI (holding UML models) is also XML
1993au BufNewFile,BufRead *.xmi			setf xml
1994
1995" CSPROJ files are Visual Studio.NET's XML-based project config files
1996au BufNewFile,BufRead *.csproj,*.csproj.user	setf xml
1997
1998" Qt Linguist translation source and Qt User Interface Files are XML
1999" However, for .ts Typescript is more common.
2000au BufNewFile,BufRead *.ui			setf xml
2001
2002" TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull)
2003au BufNewFile,BufRead *.tpm			setf xml
2004
2005" Xdg menus
2006au BufNewFile,BufRead */etc/xdg/menus/*.menu	setf xml
2007
2008" ATI graphics driver configuration
2009au BufNewFile,BufRead fglrxrc			setf xml
2010
2011" Web Services Description Language (WSDL)
2012au BufNewFile,BufRead *.wsdl			setf xml
2013
2014" XLIFF (XML Localisation Interchange File Format) is also XML
2015au BufNewFile,BufRead *.xlf			setf xml
2016au BufNewFile,BufRead *.xliff			setf xml
2017
2018" XML User Interface Language
2019au BufNewFile,BufRead *.xul			setf xml
2020
2021" X11 xmodmap (also see below)
2022au BufNewFile,BufRead *Xmodmap			setf xmodmap
2023
2024" Xquery
2025au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy	setf xquery
2026
2027" XSD
2028au BufNewFile,BufRead *.xsd			setf xsd
2029
2030" Xslt
2031au BufNewFile,BufRead *.xsl,*.xslt		setf xslt
2032
2033" Yacc
2034au BufNewFile,BufRead *.yy,*.yxx,*.y++		setf yacc
2035
2036" Yacc or racc
2037au BufNewFile,BufRead *.y			call dist#ft#FTy()
2038
2039" Yaml
2040au BufNewFile,BufRead *.yaml,*.yml		setf yaml
2041
2042" Raml
2043au BufNewFile,BufRead *.raml			setf raml
2044
2045" yum conf (close enough to dosini)
2046au BufNewFile,BufRead */etc/yum.conf		setf dosini
2047
2048" Zimbu
2049au BufNewFile,BufRead *.zu			setf zimbu
2050" Zimbu Templates
2051au BufNewFile,BufRead *.zut			setf zimbutempl
2052
2053" Zope
2054"   dtml (zope dynamic template markup language), pt (zope page template),
2055"   cpt (zope form controller page template)
2056au BufNewFile,BufRead *.dtml,*.pt,*.cpt		call dist#ft#FThtml()
2057"   zsql (zope sql method)
2058au BufNewFile,BufRead *.zsql			call dist#ft#SQL()
2059
2060" Z80 assembler asz80
2061au BufNewFile,BufRead *.z8a			setf z8a
2062
2063augroup END
2064
2065
2066" Source the user-specified filetype file, for backwards compatibility with
2067" Vim 5.x.
2068if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
2069  execute "source " . myfiletypefile
2070endif
2071
2072
2073" Check for "*" after loading myfiletypefile, so that scripts.vim is only used
2074" when there are no matching file name extensions.
2075" Don't do this for compressed files.
2076augroup filetypedetect
2077au BufNewFile,BufRead *
2078	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
2079	\ | runtime! scripts.vim | endif
2080au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
2081
2082
2083" Extra checks for when no filetype has been detected now.  Mostly used for
2084" patterns that end in "*".  E.g., "zsh*" matches "zsh.vim", but that's a Vim
2085" script file.
2086" Most of these should call s:StarSetf() to avoid names ending in .gz and the
2087" like are used.
2088
2089" More Apache style config files
2090au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/*	call s:StarSetf('apachestyle')
2091au BufNewFile,BufRead proftpd.conf*					call s:StarSetf('apachestyle')
2092
2093" More Apache config files
2094au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*	call s:StarSetf('apache')
2095au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf*		call s:StarSetf('apache')
2096
2097" Asterisk config file
2098au BufNewFile,BufRead *asterisk/*.conf*		call s:StarSetf('asterisk')
2099au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
2100
2101" Bazaar version control
2102au BufNewFile,BufRead bzr_log.*			setf bzr
2103
2104" Bazel build file
2105if !has("fname_case")
2106  au BufNewFile,BufRead *.BUILD,BUILD		setf bzl
2107endif
2108
2109" BIND zone
2110au BufNewFile,BufRead */named/db.*,*/bind/db.*	call s:StarSetf('bindzone')
2111
2112au BufNewFile,BufRead cabal.project.*		call s:StarSetf('cabalproject')
2113
2114" Calendar
2115au BufNewFile,BufRead */.calendar/*,
2116	\*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
2117	\					call s:StarSetf('calendar')
2118
2119" Changelog
2120au BufNewFile,BufRead [cC]hange[lL]og*
2121	\ if getline(1) =~ '; urgency='
2122	\|  call s:StarSetf('debchangelog')
2123	\|else
2124	\|  call s:StarSetf('changelog')
2125	\|endif
2126
2127" Crontab
2128au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/*		call s:StarSetf('crontab')
2129
2130" dnsmasq(8) configuration
2131au BufNewFile,BufRead */etc/dnsmasq.d/*		call s:StarSetf('dnsmasq')
2132
2133" Dracula
2134au BufNewFile,BufRead drac.*			call s:StarSetf('dracula')
2135
2136" Fvwm
2137au BufNewFile,BufRead */.fvwm/*			call s:StarSetf('fvwm')
2138au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
2139	\ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
2140au BufNewFile,BufRead *fvwm2rc*
2141	\ if expand("<afile>:e") == "m4"
2142	\|  call s:StarSetf('fvwm2m4')
2143	\|else
2144	\|  let b:fvwm_version = 2 | call s:StarSetf('fvwm')
2145	\|endif
2146
2147" Gedcom
2148au BufNewFile,BufRead */tmp/lltmp*		call s:StarSetf('gedcom')
2149
2150" Git
2151au BufNewFile,BufRead */.gitconfig.d/*,/etc/gitconfig.d/*	call s:StarSetf('gitconfig')
2152
2153" Gitolite
2154au BufNewFile,BufRead */gitolite-admin/conf/*	call s:StarSetf('gitolite')
2155
2156" GTK RC
2157au BufNewFile,BufRead .gtkrc*,gtkrc*		call s:StarSetf('gtkrc')
2158
2159" Jam
2160au BufNewFile,BufRead Prl*.*,JAM*.*		call s:StarSetf('jam')
2161
2162" Jargon
2163au! BufNewFile,BufRead *jarg*
2164	\ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
2165	\|  call s:StarSetf('jargon')
2166	\|endif
2167
2168" Java Properties resource file (note: doesn't catch font.properties.pl)
2169au BufNewFile,BufRead *.properties_??_??_*	call s:StarSetf('jproperties')
2170
2171" Kconfig
2172au BufNewFile,BufRead Kconfig.*			call s:StarSetf('kconfig')
2173
2174" Lilo: Linux loader
2175au BufNewFile,BufRead lilo.conf*		call s:StarSetf('lilo')
2176
2177" Logcheck
2178au BufNewFile,BufRead */etc/logcheck/*.d*/*	call s:StarSetf('logcheck')
2179
2180" Makefile
2181au BufNewFile,BufRead [mM]akefile*		call s:StarSetf('make')
2182
2183" Ruby Makefile
2184au BufNewFile,BufRead [rR]akefile*		call s:StarSetf('ruby')
2185
2186" Mail (also matches muttrc.vim, so this is below the other checks)
2187au BufNewFile,BufRead {neo,}mutt[[:alnum:]._-]\\\{6\}	setf mail
2188
2189au BufNewFile,BufRead reportbug-*		call s:StarSetf('mail')
2190
2191" Modconf
2192au BufNewFile,BufRead */etc/modutils/*
2193	\ if executable(expand("<afile>")) != 1
2194	\|  call s:StarSetf('modconf')
2195	\|endif
2196au BufNewFile,BufRead */etc/modprobe.*		call s:StarSetf('modconf')
2197
2198" Mutt setup file
2199au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc*	call s:StarSetf('muttrc')
2200au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc*		call s:StarSetf('muttrc')
2201
2202" Neomutt setup file
2203au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc*	call s:StarSetf('neomuttrc')
2204au BufNewFile,BufRead neomuttrc*,Neomuttrc*		call s:StarSetf('neomuttrc')
2205
2206" Nroff macros
2207au BufNewFile,BufRead tmac.*			call s:StarSetf('nroff')
2208
2209" OpenBSD hostname.if
2210au BufNewFile,BufRead /etc/hostname.*		call s:StarSetf('config')
2211
2212" Pam conf
2213au BufNewFile,BufRead */etc/pam.d/*		call s:StarSetf('pamconf')
2214
2215" Printcap and Termcap
2216au BufNewFile,BufRead *printcap*
2217	\ if !did_filetype()
2218	\|  let b:ptcap_type = "print" | call s:StarSetf('ptcap')
2219	\|endif
2220au BufNewFile,BufRead *termcap*
2221	\ if !did_filetype()
2222	\|  let b:ptcap_type = "term" | call s:StarSetf('ptcap')
2223	\|endif
2224
2225" ReDIF
2226" Only used when the .rdf file was not detected to be XML.
2227au BufRead,BufNewFile *.rdf			call dist#ft#Redif()
2228
2229" Remind
2230au BufNewFile,BufRead .reminders*		call s:StarSetf('remind')
2231
2232" SGML catalog file
2233au BufNewFile,BufRead sgml.catalog*		call s:StarSetf('catalog')
2234
2235" Shell scripts ending in a star
2236au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD* call dist#ft#SetFileTypeSH("bash")
2237au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
2238au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
2239
2240" tcsh scripts ending in a star
2241au BufNewFile,BufRead .tcshrc*	call dist#ft#SetFileTypeShell("tcsh")
2242
2243" csh scripts ending in a star
2244au BufNewFile,BufRead .login*,.cshrc*  call dist#ft#CSH()
2245
2246" VHDL
2247au BufNewFile,BufRead *.vhdl_[0-9]*		call s:StarSetf('vhdl')
2248
2249" Vim script
2250au BufNewFile,BufRead *vimrc*			call s:StarSetf('vim')
2251
2252" Subversion commit file
2253au BufNewFile,BufRead svn-commit*.tmp		setf svn
2254
2255" X resources file
2256au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
2257
2258" XFree86 config
2259au BufNewFile,BufRead XF86Config-4*
2260	\ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf')
2261au BufNewFile,BufRead XF86Config*
2262	\ if getline(1) =~ '\<XConfigurator\>'
2263	\|  let b:xf86conf_xfree86_version = 3
2264	\|endif
2265	\|call s:StarSetf('xf86conf')
2266
2267" X11 xmodmap
2268au BufNewFile,BufRead *xmodmap*			call s:StarSetf('xmodmap')
2269
2270" Xinetd conf
2271au BufNewFile,BufRead */etc/xinetd.d/*		call s:StarSetf('xinetd')
2272
2273" yum conf (close enough to dosini)
2274au BufNewFile,BufRead */etc/yum.repos.d/*	call s:StarSetf('dosini')
2275
2276" Z-Shell script ending in a star
2277au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump*  call s:StarSetf('zsh')
2278au BufNewFile,BufRead zsh*,zlog*		call s:StarSetf('zsh')
2279
2280
2281" Plain text files, needs to be far down to not override others.  This avoids
2282" the "conf" type being used if there is a line starting with '#'.
2283au BufNewFile,BufRead *.text,README		setf text
2284
2285" Help files match *.txt but should have a last line that is a modeline.
2286au BufNewFile,BufRead *.txt
2287	\  if getline('$') !~ 'vim:.*ft=help'
2288	\|   setf text
2289	\| endif
2290
2291
2292" Use the filetype detect plugins.  They may overrule any of the previously
2293" detected filetypes.
2294runtime! ftdetect/*.vim
2295
2296" NOTE: The above command could have ended the filetypedetect autocmd group
2297" and started another one. Let's make sure it has ended to get to a consistent
2298" state.
2299augroup END
2300
2301" Generic configuration file. Use FALLBACK, it's just guessing!
2302au filetypedetect BufNewFile,BufRead,StdinReadPost *
2303	\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
2304	\    && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
2305	\	|| getline(4) =~ '^#' || getline(5) =~ '^#') |
2306	\   setf FALLBACK conf |
2307	\ endif
2308
2309
2310" If the GUI is already running, may still need to install the Syntax menu.
2311" Don't do it when the 'M' flag is included in 'guioptions'.
2312if has("menu") && has("gui_running")
2313      \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
2314  source <sfile>:p:h/menu.vim
2315endif
2316
2317" Function called for testing all functions defined here.  These are
2318" script-local, thus need to be executed here.
2319" Returns a string with error messages (hopefully empty).
2320func! TestFiletypeFuncs(testlist)
2321  let output = ''
2322  for f in a:testlist
2323    try
2324      exe f
2325    catch
2326      let output = output . "\n" . f . ": " . v:exception
2327    endtry
2328  endfor
2329  return output
2330endfunc
2331
2332" Restore 'cpoptions'
2333let &cpo = s:cpo_save
2334unlet s:cpo_save
2335