Mercurial > vim
comparison runtime/filetype.vim @ 7013:349e6c01f35d
Update runtime files.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 11 Aug 2015 20:34:49 +0200 |
parents | b2673982c625 |
children | 66137191901a |
comparison
equal
deleted
inserted
replaced
7012:0175e7cfea2e | 7013:349e6c01f35d |
---|---|
1 " Vim support file to detect file types | 1 " Vim support file to detect file types |
2 " | 2 " |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | 3 " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 " Last Change: 2015 Jun 06 | 4 " Last Change: 2015 Aug 11 |
5 | 5 |
6 " Listen very carefully, I will say this only once | 6 " Listen very carefully, I will say this only once |
7 if exists("did_load_filetypes") | 7 if exists("did_load_filetypes") |
8 finish | 8 finish |
9 endif | 9 endif |
1166 | 1166 |
1167 func! s:FTm() | 1167 func! s:FTm() |
1168 let n = 1 | 1168 let n = 1 |
1169 while n < 10 | 1169 while n < 10 |
1170 let line = getline(n) | 1170 let line = getline(n) |
1171 if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)' | 1171 if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' |
1172 setf objc | 1172 setf objc |
1173 return | 1173 return |
1174 endif | 1174 endif |
1175 if line =~ '^\s*%' | 1175 if line =~ '^\s*%' |
1176 setf matlab | 1176 setf matlab |
1334 | 1334 |
1335 func! s:FTmm() | 1335 func! s:FTmm() |
1336 let n = 1 | 1336 let n = 1 |
1337 while n < 10 | 1337 while n < 10 |
1338 let line = getline(n) | 1338 let line = getline(n) |
1339 if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)' | 1339 if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' |
1340 setf objcpp | 1340 setf objcpp |
1341 return | 1341 return |
1342 endif | 1342 endif |
1343 let n = n + 1 | 1343 let n = n + 1 |
1344 endwhile | 1344 endwhile |
1856 au BufNewFile,BufRead catalog setf catalog | 1856 au BufNewFile,BufRead catalog setf catalog |
1857 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') | 1857 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') |
1858 | 1858 |
1859 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. | 1859 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. |
1860 " Gentoo ebuilds are actually bash scripts | 1860 " Gentoo ebuilds are actually bash scripts |
1861 au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,.bash_aliases*,*.bash,*.ebuild call SetFileTypeSH("bash") | 1861 au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass call SetFileTypeSH("bash") |
1862 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") | 1862 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") |
1863 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) | 1863 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) |
1864 | 1864 |
1865 " Also called from scripts.vim. | 1865 " Also called from scripts.vim. |
1866 func! SetFileTypeSH(name) | 1866 func! SetFileTypeSH(name) |