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