Mercurial > vim
diff runtime/filetype.vim @ 9041:34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 30 15:13:38 2016 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 30 Apr 2016 15:15:06 +0200 |
parents | 514f51fa1966 |
children | 619a98a67f67 |
line wrap: on
line diff
--- 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: 2015 Dec 03 +" Last Change: 2016 Apr 29 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -17,7 +17,7 @@ augroup filetypedetect " Ignored extensions if exists("*fnameescape") -au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew +au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew,?\+.pacsave,?\+.pacnew \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) au BufNewFile,BufRead *~ \ let s:name = expand("<afile>") | @@ -1861,11 +1861,19 @@ au BufNewFile,BufRead catalog setf cat au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. -" Gentoo ebuilds are actually bash scripts -au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass call SetFileTypeSH("bash") +" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts +au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call SetFileTypeSH("bash") au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) +" Shell script (Arch Linux) or PHP file (Drupal) +au BufNewFile,BufRead *.install + \ if getline(1) =~ '<?php' | + \ setf php | + \ else | + \ call SetFileTypeSH("bash") | + \ endif + " Also called from scripts.vim. func! SetFileTypeSH(name) if expand("<amatch>") =~ g:ft_ignore_pat