filetype.vim 69 KB

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