filetype.vim 71 KB

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