Skip to content

Commit

Permalink
Make more portable using vim-blink
Browse files Browse the repository at this point in the history
  • Loading branch information
ViViDboarder committed Sep 17, 2024
1 parent f011bbe commit 14a5983
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ neovim/tmp/
vim/.netrwhist
vim/UltiSnips
vim/autoload/plug.vim
vim/autoload/blink.vim
vim/autoload/plug.vim.old
vim/backup/
vim/plugged/
Expand All @@ -19,3 +20,4 @@ vim/spell/
vim/tmp/
vim/tmp/viminfo.*
vim/view/
vim/pack/
14 changes: 8 additions & 6 deletions vim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
87 changes: 27 additions & 60 deletions vim/rc/plugins.rc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,44 @@ 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 <silent> <F6> :call ToggleQuickfixList()<CR>
nnoremap <silent> <F7> :call ToggleLocationList()<CR>
" 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
call s:smart_source_rc('plugins/fugitive')
call s:smart_source_rc('plugins/gitgutter')

" Programming
Plug 'FooSoft/vim-argwrap'
Blink 'FooSoft/vim-argwrap'
nnoremap <silent> <leader>a :ArgWrap<CR>
Plug 'tomtom/tcomment_vim', { 'on': ['TComment', 'TCommentBlock'] }
Blink 'tomtom/tcomment_vim'
nnoremap // :TComment<CR>
vnoremap // :TCommentBlock<CR>
Plug 'rizzatti/dash.vim', { 'on': 'DashSearch' }
nmap <silent> <leader>d <Plug>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
Expand All @@ -69,71 +62,45 @@ 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 <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)
imap <silent> <C-Space> <Blink>(ale_complete)
" inoremap <silent><expr> <C-Space>
" \ pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ <Plug>(ale_complete)
" \ <Blink>(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
au BufRead,BufNewFile */playbooks/*.yaml set filetype=yaml.ansible
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'
4 changes: 2 additions & 2 deletions vim/rc/plugins/airline.rc.vim
Original file line number Diff line number Diff line change
@@ -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 = {
\ '__' : '-',
Expand Down
2 changes: 1 addition & 1 deletion vim/rc/plugins/ale.rc.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion vim/rc/plugins/ctrlp.rc.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Plug 'ctrlpvim/ctrlp.vim'
Blink 'ctrlpvim/ctrlp.vim'
" Configuration for ctrlp.vim

let g:ctrlp_in_use = 1
Expand Down
2 changes: 1 addition & 1 deletion vim/rc/plugins/fugitive.rc.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Plug 'tpope/vim-fugitive' ", { 'on': ['Git'] }
Blink 'tpope/vim-fugitive'
" Mappings
nnoremap <leader>gb :Git blame<CR>
nnoremap <leader>gc :Git commit<CR>
Expand Down
4 changes: 2 additions & 2 deletions vim/rc/plugins/fzf.rc.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion vim/rc/plugins/gitgutter.rc.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions vim/rc/plugins/goyo-limelight.rc.vim
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions vim/rc/plugins/python.rc.vim
Original file line number Diff line number Diff line change
@@ -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 <silent><leader>ptp <Esc>:Pytest project<CR>
nmap <silent><leader>ptf <Esc>:Pytest file<CR>
nmap <silent><leader>ptm <Esc>:Pytest method<CR>
2 changes: 1 addition & 1 deletion vim/rc/plugins/startify.rc.vim
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
2 changes: 1 addition & 1 deletion vim/rc/plugins/tagbar.rc.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
Blink 'majutsushi/tagbar'
nnoremap <silent> <F8> :TagbarToggle<CR>
let g:tagbar_autofocus = 1 " Autofocus tagbar
2 changes: 1 addition & 1 deletion vim/rc/plugins/vim-grepper.rc.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Plug 'mhinz/vim-grepper'
Blink 'mhinz/vim-grepper'
" Grepper settings and shortcuts
let g:grepper = {
\ 'quickfix': 1,
Expand Down

0 comments on commit 14a5983

Please sign in to comment.