mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:27:34 +00:00
Simplify plugin config
Remove all the ide toggle flags. I wasn't using them
This commit is contained in:
parent
eca03d227c
commit
41ef5dc30f
@ -52,13 +52,6 @@ function! IsGuiApp()
|
|||||||
\ || has('gui_vimr') || exists('g:gui_oni')
|
\ || has('gui_vimr') || exists('g:gui_oni')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Some GUI applications provide built in support for certain features
|
|
||||||
let g:gui = {}
|
|
||||||
let g:gui.has_buffer_features = exists('g:gui_oni')
|
|
||||||
let g:gui.has_autocomplete_features = exists('g:gui_oni')
|
|
||||||
let g:gui.has_linter_features = exists('g:gui_oni')
|
|
||||||
let g:gui.has_ctags_features = exists('g:gui_oni')
|
|
||||||
|
|
||||||
" Auto install vim-plug
|
" Auto install vim-plug
|
||||||
if empty(glob('~/.vim/autoload/plug.vim'))
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
||||||
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||||
|
@ -18,7 +18,3 @@ endif
|
|||||||
augroup syntax_overrides
|
augroup syntax_overrides
|
||||||
au BufRead,BufNewFile *.md set syntax=markdown
|
au BufRead,BufNewFile *.md set syntax=markdown
|
||||||
augroup end
|
augroup end
|
||||||
|
|
||||||
" Default to running vim like it's an IDE. To disable on a more restricted
|
|
||||||
" machine, override this to 0 using an init.local.rc.vim
|
|
||||||
let g:vim_as_an_ide = 1
|
|
||||||
|
@ -12,44 +12,31 @@ function! s:source_rc(path)
|
|||||||
endfunction
|
endfunction
|
||||||
" }} Functions
|
" }} Functions
|
||||||
|
|
||||||
" Saving and loading specific versions of plugins
|
|
||||||
call s:smart_source_rc('plug-snapshot')
|
|
||||||
function! s:save_snapshot()
|
|
||||||
let l:f_path = fnameescape(expand('~/.vim/rc/plug-snapshot.rc.vim'))
|
|
||||||
execute 'PlugSnapshot!' . l:f_path
|
|
||||||
endfunction
|
|
||||||
command! SavePlugSnapshot call s:save_snapshot()
|
|
||||||
|
|
||||||
|
|
||||||
" General
|
" General
|
||||||
Plug 'godlygeek/tabular' " Tabular spacing
|
Plug 'godlygeek/tabular' " Tabular spacing
|
||||||
Plug 'gregsexton/MatchTag'
|
Plug 'gregsexton/MatchTag'
|
||||||
Plug 'tpope/vim-endwise'
|
Plug 'tpope/vim-endwise'
|
||||||
Plug 'tpope/vim-eunuch'
|
Plug 'tpope/vim-eunuch'
|
||||||
Plug 'tpope/vim-repeat'
|
Plug 'tpope/vim-repeat'
|
||||||
Plug 'tpope/vim-rsi' " emacs bindinds in insert
|
Plug 'tpope/vim-rsi'
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
Plug 'tpope/vim-vinegar'
|
Plug 'tpope/vim-vinegar'
|
||||||
Plug 'vim-scripts/file-line'
|
Plug 'vim-scripts/file-line'
|
||||||
if !g:gui.has_buffer_features
|
|
||||||
call s:smart_source_rc('plugins/airline')
|
call s:smart_source_rc('plugins/airline')
|
||||||
call s:smart_source_rc('plugins/startify')
|
call s:smart_source_rc('plugins/startify')
|
||||||
endif
|
call s:smart_source_rc('plugins/goyo-limelight')
|
||||||
Plug 'milkypostman/vim-togglelist'
|
Plug 'milkypostman/vim-togglelist'
|
||||||
nnoremap <silent> <F6> :call ToggleQuickfixList()<CR>
|
nnoremap <silent> <F6> :call ToggleQuickfixList()<CR>
|
||||||
nnoremap <silent> <F7> :call ToggleLocationList()<CR>
|
nnoremap <silent> <F7> :call ToggleLocationList()<CR>
|
||||||
" Plug 'edkolev/tmuxline.vim' " Removed because this can fail on some machines
|
" Plug 'edkolev/tmuxline.vim' " Removed because this can fail on some machines
|
||||||
" let g:tmuxline_powerline_separators = 0
|
" let g:tmuxline_powerline_separators = 0
|
||||||
call s:smart_source_rc('plugins/goyo-limelight') " Distraction free editing
|
|
||||||
|
|
||||||
" Searching
|
" Searching
|
||||||
if !exists('g:gui_oni')
|
|
||||||
if !executable('fzf')
|
if !executable('fzf')
|
||||||
call s:smart_source_rc('plugins/ctrlp')
|
call s:smart_source_rc('plugins/ctrlp')
|
||||||
endif
|
endif
|
||||||
call s:smart_source_rc('plugins/fzf')
|
call s:smart_source_rc('plugins/fzf')
|
||||||
call s:smart_source_rc('plugins/vim-grepper')
|
call s:smart_source_rc('plugins/vim-grepper')
|
||||||
endif
|
|
||||||
|
|
||||||
" Git / Version control
|
" Git / Version control
|
||||||
call s:smart_source_rc('plugins/fugitive')
|
call s:smart_source_rc('plugins/fugitive')
|
||||||
@ -67,43 +54,51 @@ let g:dash_map = { 'apex' : 'apex', 'visualforce' : 'vf' }
|
|||||||
|
|
||||||
" IDE stuff
|
" IDE stuff
|
||||||
|
|
||||||
|
" let l:is_vim8 = v:version >= 8
|
||||||
|
" let l:is_nvim = has('nvim')
|
||||||
|
" let l:is_nvim_5 = has('nvim-0.5')
|
||||||
|
|
||||||
" Lint and completion
|
" Lint and completion
|
||||||
if (g:vim_as_an_ide && !g:gui.has_linter_features) && (has('nvim') || v:version >= 800)
|
if has('nvim') || v:version >= 800
|
||||||
|
" let g:ale_completion_enabled = 1
|
||||||
call s:smart_source_rc('plugins/ale')
|
call s:smart_source_rc('plugins/ale')
|
||||||
|
|
||||||
" Enable autocomplete from ale and asyncomplete
|
|
||||||
if !g:gui.has_autocomplete_features
|
|
||||||
set omnifunc=ale#completion#OmniFunc
|
set omnifunc=ale#completion#OmniFunc
|
||||||
" Set ale completion as omni-func
|
|
||||||
" Enable asyncomplete
|
|
||||||
Plug 'prabirshrestha/asyncomplete.vim'
|
|
||||||
" Add ALE to asyncomplete
|
|
||||||
augroup acomp_setup
|
|
||||||
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#ale#get_source_options({
|
|
||||||
\ 'priority': 10,
|
|
||||||
\ }))
|
|
||||||
augroup end
|
|
||||||
|
|
||||||
let g:asyncomplete_auto_popup = 0
|
|
||||||
" Make asyncomplete manually triggered
|
|
||||||
function! s:check_back_space() abort
|
function! s:check_back_space() abort
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~? '\s'
|
return !col || getline('.')[col - 1] =~? '\s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
inoremap <silent><expr> <C-Space>
|
" " Enable asyncomplete
|
||||||
\ pumvisible() ? "\<C-n>" :
|
" Plug 'prabirshrestha/asyncomplete.vim'
|
||||||
\ <SID>check_back_space() ? "\<TAB>" :
|
" " Add ALE to asyncomplete
|
||||||
\ asyncomplete#force_refresh()
|
" augroup acomp_setup
|
||||||
end
|
" au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#ale#get_source_options({
|
||||||
|
" \ 'priority': 10,
|
||||||
|
" \ }))
|
||||||
|
" au CompleteDone * if pumvisible() == 0 | pclose | endif
|
||||||
|
" augroup end
|
||||||
|
"
|
||||||
|
" let g:asyncomplete_auto_popup = 0
|
||||||
|
" " Make asyncomplete manually triggered
|
||||||
|
" inoremap <silent><expr> <C-Space>
|
||||||
|
" \ pumvisible() ? "\<C-n>" :
|
||||||
|
" \ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
" \ asyncomplete#force_refresh()
|
||||||
|
"
|
||||||
|
|
||||||
|
set completeopt+=preview
|
||||||
|
imap <silent> <C-Space> <Plug>(ale_complete)
|
||||||
|
" inoremap <silent><expr> <C-Space>
|
||||||
|
" \ pumvisible() ? "\<C-n>" :
|
||||||
|
" \ <SID>check_back_space() ? "\<TAB>" :
|
||||||
|
" \ <Plug>(ale_complete)
|
||||||
end
|
end
|
||||||
|
|
||||||
" Programming Tag navigation
|
" Programming Tag navigation
|
||||||
if g:vim_as_an_ide && (v:version > 703) && !g:gui.has_ctags_features
|
|
||||||
call s:smart_source_rc('plugins/tagbar')
|
call s:smart_source_rc('plugins/tagbar')
|
||||||
Plug 'ludovicchabant/vim-gutentags' " Auto generate tags files
|
Plug 'ludovicchabant/vim-gutentags'
|
||||||
command! TagsUpdate :GutentagsUpdate
|
command! TagsUpdate :GutentagsUpdate
|
||||||
end
|
|
||||||
|
|
||||||
" Filetype configuration
|
" Filetype configuration
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ endfunction
|
|||||||
command! UpdateColors call UpdateColors()
|
command! UpdateColors call UpdateColors()
|
||||||
nnoremap <leader>cc :UpdateColors<CR>
|
nnoremap <leader>cc :UpdateColors<CR>
|
||||||
|
|
||||||
" Disabled because this is slow...
|
|
||||||
augroup AutoColors
|
augroup AutoColors
|
||||||
autocmd FocusGained * call UpdateColors()
|
autocmd FocusGained * call UpdateColors()
|
||||||
augroup END
|
augroup END
|
||||||
|
Loading…
Reference in New Issue
Block a user