This commit is contained in:
Adam Stankiewicz
2019-11-04 09:04:28 +01:00
parent 31c55b85a0
commit 4e95df7c7e
26 changed files with 645 additions and 132 deletions

View File

@@ -905,7 +905,7 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ocaml') == -1
augroup filetypedetect
" ocaml, from opam.vim in rgrinberg/vim-ocaml
au BufNewFile,BufRead opam,*.opam set filetype=opam
au BufNewFile,BufRead opam,*.opam,*.opam.template set filetype=opam
augroup end
endif
@@ -1105,7 +1105,24 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
augroup filetypedetect
" racket, from racket.vim in wlangstroth/vim-racket
au BufRead,BufNewFile *.rkt,*.rktl set filetype=racket
"
let g:racket_hash_lang_regexp = '^#lang\s\+\([^][)(}{[:space:]]\+\)'
" Tries to detect filetype from #lang line; defaults to ft=racket.
function RacketDetectHashLang()
let old_ft = &filetype
let matches = matchlist(getline(1), g:racket_hash_lang_regexp)
if ! empty(matches)
let &l:filetype = matches[1]
endif
if &filetype == old_ft
set filetype=racket
endif
endfunction
au BufRead,BufNewFile *.rkt,*.rktl call RacketDetectHashLang()
augroup end
endif
@@ -1437,15 +1454,15 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
augroup filetypedetect
" typescript, from tsx.vim in HerringtonDarkholme/yats.vim
autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescript.tsx
" typescript, from typescript.vim in HerringtonDarkholme/yats.vim
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
augroup filetypedetect
" typescript, from typescript.vim in HerringtonDarkholme/yats.vim
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
" typescript, from typescriptreact.vim in HerringtonDarkholme/yats.vim
autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescriptreact
augroup end
endif