diff options
Diffstat (limited to 'ftdetect/polyglot.vim')
-rw-r--r-- | ftdetect/polyglot.vim | 82 |
1 files changed, 21 insertions, 61 deletions
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 0bef8008..44c70eea 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -242,77 +242,22 @@ augroup END augroup filetypedetect " fish:dag/vim-fish -autocmd BufRead,BufNewFile *.fish setfiletype fish - -" Detect fish scripts by the shebang line. -autocmd BufRead * - \ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' | - \ setlocal filetype=fish | - \ endif - -" Move cursor to first empty line when using funced. -autocmd BufRead fish_funced_*_*.fish call search('^$') - -" Fish histories are YAML documents. -autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml - -" Universal variable storages should not be hand edited. -autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly - -" Mimic `funced` when manually creating functions. -autocmd BufNewFile ~/.config/fish/functions/*.fish - \ call append(0, ['function '.expand('%:t:r'), - \'', - \'end']) | - \ 2 augroup END augroup filetypedetect " fsharp:fsharp/vim-fsharp:_BASIC -" F#, fsharp -autocmd BufNewFile,BufRead *.fs,*.fsi,*.fsx set filetype=fsharp augroup END augroup filetypedetect " git:tpope/vim-git -" Git -autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit -autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig -autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig -autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig -autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase -autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail -autocmd BufNewFile,BufRead *.git/** - \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | - \ set ft=git | - \ endif - -" This logic really belongs in scripts.vim -autocmd BufNewFile,BufRead,StdinReadPost * - \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' | - \ set ft=git | - \ endif -autocmd BufNewFile,BufRead * - \ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' | - \ set filetype=gitsendemail | - \ endif augroup END augroup filetypedetect " gmpl:maelvalais/gmpl.vim -au BufRead,BufNewFile *.mod set filetype=gmpl augroup END augroup filetypedetect " glsl:tikhomirov/vim-glsl -" Language: OpenGL Shading Language -" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io> - -" Extensions supported by Khronos reference compiler (with one exception, ".glsl") -" https://github.com/KhronosGroup/glslang -autocmd! BufNewFile,BufRead *.vert,*.tesc,*.tese,*.glsl,*.geom,*.frag,*.comp set filetype=glsl - -" vim:set sts=2 sw=2 : augroup END augroup filetypedetect @@ -493,13 +438,28 @@ autocmd BufNewFile,BufRead *.js augroup END augroup filetypedetect -" julia:dcjones/julia-minimalist-vim -" NOTE: this line fixes an issue with the default system-wide lisp ftplugin -" which doesn't define b:undo_ftplugin -" (*.jt files are recognized as lisp) -au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<" +" julia:JuliaEditorSupport/julia-vim +if v:version < 704 + " NOTE: this line fixes an issue with the default system-wide lisp ftplugin + " which didn't define b:undo_ftplugin on older Vim versions + " (*.jl files are recognized as lisp) + autocmd BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<" +endif -au BufRead,BufNewFile *.jl set filetype=julia +autocmd BufRead,BufNewFile *.jl set filetype=julia + +autocmd FileType * call LaTeXtoUnicode#Refresh() +autocmd BufEnter * call LaTeXtoUnicode#Refresh() + +" This autocommand is used to postpone the first initialization of LaTeXtoUnicode as much as possible, +" by calling LaTeXtoUnicode#SetTab amd LaTeXtoUnicode#SetAutoSub only at InsertEnter or later +function! s:L2UTrigger() + augroup L2UInit + autocmd! + autocmd InsertEnter * let g:did_insert_enter = 1 | call LaTeXtoUnicode#Init(0) + augroup END +endfunction +autocmd BufEnter * call s:L2UTrigger() augroup END augroup filetypedetect |