filetype.vim 57 KB

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