Mercurial > vim
comparison runtime/filetype.vim @ 12027:c2aa4af29251 v8.0.0894
patch 8.0.0894: there is no test for runtime filetype detection
commit https://github.com/vim/vim/commit/0a0217abfabcee8b0779df2e18a186a4b41e18ce
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 9 22:06:48 2017 +0200
patch 8.0.0894: there is no test for runtime filetype detection
Problem: There is no test for runtime filetype detection.
Solution: Test a list of filetypes from patterns.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 09 Aug 2017 22:15:04 +0200 |
parents | 49c12c93abf3 |
children | 7eb512f2a896 |
comparison
equal
deleted
inserted
replaced
12026:fcbb47ff27ce | 12027:c2aa4af29251 |
---|---|
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: 2017 Jul 11 | 4 " Last Change: 2017 Aug 09 |
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 |
1025 | 1025 |
1026 " JavaCC | 1026 " JavaCC |
1027 au BufNewFile,BufRead *.jj,*.jjt setf javacc | 1027 au BufNewFile,BufRead *.jj,*.jjt setf javacc |
1028 | 1028 |
1029 " JavaScript, ECMAScript | 1029 " JavaScript, ECMAScript |
1030 au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript | 1030 au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx,*.mjs setf javascript |
1031 | 1031 |
1032 " Java Server Pages | 1032 " Java Server Pages |
1033 au BufNewFile,BufRead *.jsp setf jsp | 1033 au BufNewFile,BufRead *.jsp setf jsp |
1034 | 1034 |
1035 " Java Properties resource file (note: doesn't catch font.properties.pl) | 1035 " Java Properties resource file (note: doesn't catch font.properties.pl) |
2265 if format == 'tex' | 2265 if format == 'tex' |
2266 let format = 'latex' | 2266 let format = 'latex' |
2267 elseif format == 'plaintex' | 2267 elseif format == 'plaintex' |
2268 let format = 'plain' | 2268 let format = 'plain' |
2269 endif | 2269 endif |
2270 elseif expand('%') =~ 'tex/context/.*/.*.tex' | |
2271 let format = 'context' | |
2270 else | 2272 else |
2271 " Default value, may be changed later: | 2273 " Default value, may be changed later: |
2272 let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' | 2274 let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' |
2273 " Save position, go to the top of the file, find first non-comment line. | 2275 " Save position, go to the top of the file, find first non-comment line. |
2274 let save_cursor = getpos('.') | 2276 let save_cursor = getpos('.') |
2306 endif | 2308 endif |
2307 return | 2309 return |
2308 endfunc | 2310 endfunc |
2309 | 2311 |
2310 " ConTeXt | 2312 " ConTeXt |
2311 au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context | 2313 au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context |
2312 | 2314 |
2313 " Texinfo | 2315 " Texinfo |
2314 au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo | 2316 au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo |
2315 | 2317 |
2316 " TeX configuration | 2318 " TeX configuration |