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