Browse Source

Updated vimrc to also work before plugins are installed.

master
Daniel Sissom 5 years ago
parent
commit
7dc55f4179
Signed by untrusted user who does not match committer: djsissom GPG Key ID: 2C30FFB796852389
2 changed files with 40 additions and 20 deletions
  1. + 1
    - 0
      vim/vim/autoload/.gitignore
  2. + 39
    - 20
      vim/vimrc

+ 1
- 0
vim/vim/autoload/.gitignore

@ -0,0 +1 @@
plug.vim

+ 39
- 20
vim/vimrc

@ -29,6 +29,13 @@ if has("autocmd")
filetype plugin indent on filetype plugin indent on
endif endif
" Use plugin manager if available
if (filereadable($HOME."/.vim/autoload/plug.vim")) || (filereadable("/usr/share/vim/vimfiles/autoload/plug.vim"))
let g:use_pluggin_manager = 1
else
let g:use_pluggin_manager = 0
endif
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -165,15 +172,24 @@ function! LazyLoadingYMC()
call plug#load('YouCompleteMe') | call youcompleteme#Enable() call plug#load('YouCompleteMe') | call youcompleteme#Enable()
endif endif
endfunction endfunction
autocmd BufRead * call timer_start(1, {id->execute('call LazyLoadingYMC()')} )
" (also try BufWinEnter, InsertEnter, or CursorHold and CursorHoldI events)
if g:use_pluggin_manager == 1
autocmd BufRead * call timer_start(1, {id->execute('call LazyLoadingYMC()')} )
" (also try BufWinEnter, InsertEnter, or CursorHold and CursorHoldI events)
endif
" Enable vimtex completions for YCM " Enable vimtex completions for YCM
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
function! VimtexYCMSetup()
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
endif
if exists('g:vimtex#re#youcompleteme')
let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
endif
endfunction
if has("autocmd")
autocmd VimEnter * call VimtexYCMSetup()
endif endif
autocmd VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
@ -184,21 +200,24 @@ autocmd VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
" Use with :PlugInstall and :PlugUpdate " Use with :PlugInstall and :PlugUpdate
" Set custom plugin directory
call plug#begin('~/.vim/vim-plug')
Plug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM'), 'on': [] }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'dense-analysis/ale'
Plug 'airblade/vim-gitgutter'
Plug 'godlygeek/tabular'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-repeat'
Plug 'lervag/vimtex'
call plug#end()
"if exists('g:use_pluggin_manager') && g:use_pluggin_manager
if g:use_pluggin_manager == 1
" Set custom plugin directory
call plug#begin('~/.vim/vim-plug')
Plug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM'), 'on': [] }
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'dense-analysis/ale'
Plug 'airblade/vim-gitgutter'
Plug 'godlygeek/tabular'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-speeddating'
Plug 'tpope/vim-repeat'
Plug 'lervag/vimtex'
call plug#end()
endif

Loading…
Cancel
Save