diff --git a/vim/vimrc b/vim/vimrc index 9c22b9a..1e23927 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -104,6 +104,7 @@ if filereadable("/etc/vim/vimrc.local") endif syntax spell toplevel +let g:tex_flavor = 'latex' function! BuildYCM(info) " info is a dictionary with 3 fields @@ -133,6 +134,7 @@ call plug#begin('~/.vim/vim-plug') Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM'), 'on': [] } +Plug 'lervag/vimtex' call plug#end() @@ -142,3 +144,9 @@ map :NERDTreeToggle let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_autoclose_preview_window_after_completion = 1 +" enable vimtex completions for YCM +if !exists('g:ycm_semantic_triggers') + let g:ycm_semantic_triggers = {} +endif +autocmd VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme +