From 4e5627a9c2e9653b04789839132736f0999cde0f Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 19 Jul 2024 15:05:09 -0700 Subject: [PATCH] Make more portable using vim-blink --- vim/init.vim | 14 +++-- vim/rc/plugins.rc.vim | 87 +++++++++------------------- vim/rc/plugins/airline.rc.vim | 4 +- vim/rc/plugins/ale.rc.vim | 2 +- vim/rc/plugins/ctrlp.rc.vim | 2 +- vim/rc/plugins/fugitive.rc.vim | 2 +- vim/rc/plugins/fzf.rc.vim | 4 +- vim/rc/plugins/gitgutter.rc.vim | 2 +- vim/rc/plugins/goyo-limelight.rc.vim | 4 +- vim/rc/plugins/python.rc.vim | 6 +- vim/rc/plugins/startify.rc.vim | 2 +- vim/rc/plugins/tagbar.rc.vim | 2 +- vim/rc/plugins/vim-grepper.rc.vim | 2 +- 13 files changed, 51 insertions(+), 82 deletions(-) diff --git a/vim/init.vim b/vim/init.vim index a4a829c..44f83f4 100644 --- a/vim/init.vim +++ b/vim/init.vim @@ -52,14 +52,16 @@ function! IsGuiApp() \ || has('gui_vimr') || exists('g:gui_oni') endfunction -" Auto install vim-plug -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - augroup pluginstall - autocmd VimEnter * PlugInstall +" Auto install vim-blink +let data_dir = expand('~/.vim') +if empty(glob(data_dir . '/autoload/blink.vim')) + call mkdir(expand(data_dir.'/autoload'),'p') + silent execute '!curl -fLo ' . data_dir . '/autoload/blink.vim --create-dirs https://raw.githubusercontent.com/IamTheFij/vim-blink/cmd-array/blink.vim' + augroup blinkinstall + autocmd VimEnter * BlinkUpdate augroup end endif +call blink#init() call s:smart_source_rc('init') call s:smart_source_rc('input') diff --git a/vim/rc/plugins.rc.vim b/vim/rc/plugins.rc.vim index fa838f8..085966c 100644 --- a/vim/rc/plugins.rc.vim +++ b/vim/rc/plugins.rc.vim @@ -13,29 +13,29 @@ endfunction " }} Functions " General -Plug 'godlygeek/tabular' " Tabular spacing -Plug 'gregsexton/MatchTag' -Plug 'tpope/vim-endwise' -Plug 'tpope/vim-eunuch' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-rsi' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-vinegar' -Plug 'vim-scripts/file-line' +Blink 'gregsexton/MatchTag' +Blink 'tpope/vim-endwise' +Blink 'tpope/vim-eunuch' +Blink 'tpope/vim-repeat' +Blink 'tpope/vim-rsi' +Blink 'tpope/vim-surround' +Blink 'tpope/vim-vinegar' +Blink 'vim-scripts/file-line' call s:smart_source_rc('plugins/airline') call s:smart_source_rc('plugins/startify') call s:smart_source_rc('plugins/goyo-limelight') -Plug 'milkypostman/vim-togglelist' +Blink 'milkypostman/vim-togglelist' nnoremap :call ToggleQuickfixList() nnoremap :call ToggleLocationList() -" Plug 'edkolev/tmuxline.vim' " Removed because this can fail on some machines +" Blink 'edkolev/tmuxline.vim' " Removed because this can fail on some machines " let g:tmuxline_powerline_separators = 0 " Searching -if !executable('fzf') +if executable('fzf') + call s:smart_source_rc('plugins/fzf') +else call s:smart_source_rc('plugins/ctrlp') endif -call s:smart_source_rc('plugins/fzf') call s:smart_source_rc('plugins/vim-grepper') " Git / Version control @@ -43,21 +43,14 @@ call s:smart_source_rc('plugins/fugitive') call s:smart_source_rc('plugins/gitgutter') " Programming -Plug 'FooSoft/vim-argwrap' +Blink 'FooSoft/vim-argwrap' nnoremap a :ArgWrap -Plug 'tomtom/tcomment_vim', { 'on': ['TComment', 'TCommentBlock'] } +Blink 'tomtom/tcomment_vim' nnoremap // :TComment vnoremap // :TCommentBlock -Plug 'rizzatti/dash.vim', { 'on': 'DashSearch' } -nmap d DashSearch -let g:dash_map = { 'apex' : 'apex', 'visualforce' : 'vf' } " 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 if has('nvim') || v:version >= 800 " let g:ale_completion_enabled = 1 @@ -69,50 +62,32 @@ if has('nvim') || v:version >= 800 return !col || getline('.')[col - 1] =~? '\s' endfunction - " " 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, - " \ })) - " au CompleteDone * if pumvisible() == 0 | pclose | endif - " augroup end - " - " let g:asyncomplete_auto_popup = 0 - " " Make asyncomplete manually triggered - " inoremap - " \ pumvisible() ? "\" : - " \ check_back_space() ? "\" : - " \ asyncomplete#force_refresh() - " - set completeopt+=preview - imap (ale_complete) + imap (ale_complete) " inoremap " \ pumvisible() ? "\" : " \ check_back_space() ? "\" : - " \ (ale_complete) + " \ (ale_complete) end " Programming Tag navigation call s:smart_source_rc('plugins/tagbar') -Plug 'ludovicchabant/vim-gutentags' +Blink 'ludovicchabant/vim-gutentags' command! TagsUpdate :GutentagsUpdate " Filetype configuration " Languages with custom configuration " Custom Go -Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } +Blink 'fatih/vim-go' " Custom rust let g:rustfmt_autosave = 1 -Plug 'rust-lang/rust.vim' +Blink 'rust-lang/rust.vim' " Lots of custom python call s:smart_source_rc('plugins/python') " Disable polyglot for languages with more robust plugins let g:polyglot_disabled = ['go', 'rust'] -Plug 'sheerun/vim-polyglot' +Blink 'sheerun/vim-polyglot' " Custom rule for ansible playbook detection augroup ansible_playbook au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible @@ -120,20 +95,12 @@ augroup ansible_playbook augroup end " Languages not in polyglot -Plug 'ViViDboarder/force-vim', { 'for': ['apex', 'visualforce'] } -Plug 'ViViDboarder/vim-forcedotcom' -Plug 'hsanson/vim-android' -Plug 'pdurbin/vim-tsv' +Blink 'ViViDboarder/force-vim' +Blink 'ViViDboarder/vim-forcedotcom' +Blink 'hsanson/vim-android' +Blink 'pdurbin/vim-tsv' " }} " Themes -Plug 'altercation/vim-colors-solarized' -Plug 'vim-scripts/wombat256.vim' - -" Saving and loading specific versions of plugins -call s:source_rc('plug-snapshot.rc.vim') -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() +Blink 'altercation/vim-colors-solarized' +Blink 'vim-scripts/wombat256.vim' diff --git a/vim/rc/plugins/airline.rc.vim b/vim/rc/plugins/airline.rc.vim index b6e61ac..30cc0e1 100644 --- a/vim/rc/plugins/airline.rc.vim +++ b/vim/rc/plugins/airline.rc.vim @@ -1,5 +1,5 @@ -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' +Blink 'vim-airline/vim-airline' +Blink 'vim-airline/vim-airline-themes' " Use short-form mode text let g:airline_mode_map = { \ '__' : '-', diff --git a/vim/rc/plugins/ale.rc.vim b/vim/rc/plugins/ale.rc.vim index 52f3261..66acbe8 100644 --- a/vim/rc/plugins/ale.rc.vim +++ b/vim/rc/plugins/ale.rc.vim @@ -1,5 +1,5 @@ " Install ALE -Plug 'dense-analysis/ale' +Blink 'dense-analysis/ale' let g:airline#extensions#ale#enabled = 1 " Speed up first load time for quick editing let g:ale_lint_on_enter = 0 diff --git a/vim/rc/plugins/ctrlp.rc.vim b/vim/rc/plugins/ctrlp.rc.vim index 541157d..aa0b0c6 100644 --- a/vim/rc/plugins/ctrlp.rc.vim +++ b/vim/rc/plugins/ctrlp.rc.vim @@ -1,4 +1,4 @@ -Plug 'ctrlpvim/ctrlp.vim' +Blink 'ctrlpvim/ctrlp.vim' " Configuration for ctrlp.vim let g:ctrlp_in_use = 1 diff --git a/vim/rc/plugins/fugitive.rc.vim b/vim/rc/plugins/fugitive.rc.vim index 9c172a7..0165865 100644 --- a/vim/rc/plugins/fugitive.rc.vim +++ b/vim/rc/plugins/fugitive.rc.vim @@ -1,4 +1,4 @@ -Plug 'tpope/vim-fugitive' ", { 'on': ['Git'] } +Blink 'tpope/vim-fugitive' " Mappings nnoremap gb :Git blame nnoremap gc :Git commit diff --git a/vim/rc/plugins/fzf.rc.vim b/vim/rc/plugins/fzf.rc.vim index c598e7d..316e802 100644 --- a/vim/rc/plugins/fzf.rc.vim +++ b/vim/rc/plugins/fzf.rc.vim @@ -1,5 +1,5 @@ -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' } -Plug 'junegunn/fzf.vim' +Blink 'junegunn/fzf' +Blink 'junegunn/fzf.vim' let g:fzf_command_prefix = 'FZF' " Jump to existing window if possible let g:fzf_buffers_jump = 1 diff --git a/vim/rc/plugins/gitgutter.rc.vim b/vim/rc/plugins/gitgutter.rc.vim index cae8274..4fd3d47 100644 --- a/vim/rc/plugins/gitgutter.rc.vim +++ b/vim/rc/plugins/gitgutter.rc.vim @@ -1,4 +1,4 @@ -Plug 'airblade/vim-gitgutter', { 'on': ['GitGutterSignsToggle'] } +Blink 'airblade/vim-gitgutter' " Settings to keep gitgutter fast let g:gitgutter_enabled = 1 " Will toggle signs when I want them diff --git a/vim/rc/plugins/goyo-limelight.rc.vim b/vim/rc/plugins/goyo-limelight.rc.vim index c861d8d..6d04e23 100644 --- a/vim/rc/plugins/goyo-limelight.rc.vim +++ b/vim/rc/plugins/goyo-limelight.rc.vim @@ -1,6 +1,6 @@ " Both these plugins work well together for distraction free editing -Plug 'junegunn/goyo.vim', { 'on': 'Goyo' } -Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } +Blink 'junegunn/goyo.vim' +Blink 'junegunn/limelight.vim' let g:goyo_width = 120 command Zen :Goyo diff --git a/vim/rc/plugins/python.rc.vim b/vim/rc/plugins/python.rc.vim index 926a963..c0bbddf 100644 --- a/vim/rc/plugins/python.rc.vim +++ b/vim/rc/plugins/python.rc.vim @@ -1,7 +1,7 @@ " All Python plugins and settings -Plug 'alfredodeza/coveragepy.vim', { 'for': 'python' } -Plug 'alfredodeza/pytest.vim', { 'for': 'python' } -Plug 'tmhedberg/SimpylFold', { 'for': 'python' } +Blink 'alfredodeza/coveragepy.vim' +Blink 'alfredodeza/pytest.vim' +Blink 'tmhedberg/SimpylFold' nmap ptp :Pytest project nmap ptf :Pytest file nmap ptm :Pytest method diff --git a/vim/rc/plugins/startify.rc.vim b/vim/rc/plugins/startify.rc.vim index 48b420d..fda0dee 100644 --- a/vim/rc/plugins/startify.rc.vim +++ b/vim/rc/plugins/startify.rc.vim @@ -1,4 +1,4 @@ -Plug 'mhinz/vim-startify' +Blink 'mhinz/vim-startify' let g:startify_list_order = [ \ [' My Bookmarks'], 'bookmarks', \ [' Most recently used files in the current directory'], 'dir', diff --git a/vim/rc/plugins/tagbar.rc.vim b/vim/rc/plugins/tagbar.rc.vim index 75fd1dd..a1d83a7 100644 --- a/vim/rc/plugins/tagbar.rc.vim +++ b/vim/rc/plugins/tagbar.rc.vim @@ -1,3 +1,3 @@ -Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' } +Blink 'majutsushi/tagbar' nnoremap :TagbarToggle let g:tagbar_autofocus = 1 " Autofocus tagbar diff --git a/vim/rc/plugins/vim-grepper.rc.vim b/vim/rc/plugins/vim-grepper.rc.vim index 8a147f3..1543208 100644 --- a/vim/rc/plugins/vim-grepper.rc.vim +++ b/vim/rc/plugins/vim-grepper.rc.vim @@ -1,4 +1,4 @@ -Plug 'mhinz/vim-grepper' +Blink 'mhinz/vim-grepper' " Grepper settings and shortcuts let g:grepper = { \ 'quickfix': 1,