diff options
Diffstat (limited to 'runtime/filetype.vim')
-rw-r--r-- | runtime/filetype.vim | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 79fbcbca00..76f76af345 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2017 Mar 13 +" Last Change: 2017 Nov 02 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -284,14 +284,15 @@ au BufNewFile,BufRead *.bib setf bib au BufNewFile,BufRead *.bst setf bst " BIND configuration -au BufNewFile,BufRead named.conf,rndc.conf setf named +" sudoedit uses namedXXXX.conf +au BufNewFile,BufRead named*.conf,rndc*.conf,rndc*.key setf named " BIND zone au BufNewFile,BufRead named.root setf bindzone au BufNewFile,BufRead *.db call s:BindzoneCheck('') func! s:BindzoneCheck(default) - if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' + if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' setf bindzone elseif a:default != '' exe 'setf ' . a:default @@ -626,7 +627,13 @@ au BufNewFile,BufRead dict.conf,.dictrc setf dictconf au BufNewFile,BufRead dictd.conf setf dictdconf " Diff files -au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff +au BufNewFile,BufRead *.diff,*.rej setf diff +au BufNewFile,BufRead *.patch + \ if getline(1) =~ '^From [0-9a-f]\{40\} Mon Sep 17 00:00:00 2001$' | + \ setf gitsendemail | + \ else | + \ setf diff | + \ endif " Dircolors au BufNewFile,BufRead .dir_colors,.dircolors,*/etc/DIR_COLORS setf dircolors @@ -795,6 +802,7 @@ if !empty($XDG_CONFIG_HOME) au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig endif au BufNewFile,BufRead git-rebase-todo setf gitrebase +au BufRead,BufNewFile .gitsendemail.msg.?????? setf gitsendemail au BufNewFile,BufRead .msg.[0-9]* \ if getline(1) =~ '^From.*# This line is ignored.$' | \ setf gitsendemail | @@ -975,7 +983,7 @@ au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng " Innovation Data Processing au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat -au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog +au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog @@ -1139,8 +1147,8 @@ au BufNewFile,BufRead *.m4 " MaGic Point au BufNewFile,BufRead *.mgp setf mgp -" Mail (for Elm, trn, mutt, muttng, rn, slrn) -au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail +" Mail (for Elm, trn, mutt, muttng, rn, slrn, neomutt) +au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail " Mail aliases au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases setf mailaliases @@ -1316,6 +1324,9 @@ au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc " Natural au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural +" Noemutt setup file +au BufNewFile,BufRead Neomuttrc setf neomuttrc + " Netrc au BufNewFile,BufRead .netrc setf netrc @@ -1407,14 +1418,17 @@ au BufNewFile,BufRead *.dpr setf pascal " PDF au BufNewFile,BufRead *.pdf setf pdf +" PCMK - HAE - crm configure edit +au BufNewFile,BufRead *.pcmk setf pcmk + " Perl if has("fname_case") au BufNewFile,BufRead *.pl,*.PL call s:FTpl() else au BufNewFile,BufRead *.pl call s:FTpl() endif -au BufNewFile,BufRead *.plx,*.al setf perl -au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 +au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl +au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 func! s:FTpl() if exists("g:filetype_pl") @@ -1801,6 +1815,9 @@ au BufNewFile,BufRead *.sa setf sather " Scala au BufNewFile,BufRead *.scala setf scala +" SBT - Scala Build Tool +au BufNewFile,BufRead *.sbt setf sbt + " Scilab au BufNewFile,BufRead *.sci,*.sce setf scilab @@ -2127,7 +2144,10 @@ au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig au BufNewFile,BufRead sshd_config setf sshdconfig " Stata -au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata +au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata +" Also *.class, but not when it's a Java bytecode file +au BufNewFile,BufRead *.class + \ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif " SMCL au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl @@ -2222,6 +2242,8 @@ func! s:FTtex() let format = tolower(matchstr(firstline, '\a\+')) let format = substitute(format, 'pdf', '', '') if format == 'tex' + let format = 'latex' + elseif format == 'plaintex' let format = 'plain' endif else @@ -2392,6 +2414,9 @@ au BufNewFile,BufRead *.wbt setf winbatch " WSML au BufNewFile,BufRead *.wsml setf wsml +" WPL +au BufNewFile,BufRead *.wpl setf xml + " WvDial au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial @@ -2667,7 +2692,7 @@ au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make') au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') " Mail (also matches muttrc.vim, so this is below the other checks) -au BufNewFile,BufRead mutt[[:alnum:]._-]\\\{6\} setf mail +au BufNewFile,BufRead {neo,}mutt[[:alnum:]._-]\\\{6\} setf mail au BufNewFile,BufRead reportbug-* call s:StarSetf('mail') @@ -2682,6 +2707,10 @@ au BufNewFile,BufRead */etc/modprobe.* call s:StarSetf('modconf') au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc') au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') +" Neomutt setup file +au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc') +au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc') + " Nroff macros au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') |