Remove vim-plug and use minpac

* Add `Pack`, `PackUpdate`, `PackStatus` and `PackClean` commands to
  manage plugins.
* Don't load `minpac` by default.
* Remove `vim-plug` completely.
This commit is contained in:
Kenneth Benzie 2018-11-30 19:41:21 +00:00
parent 971d510f22
commit 51621e8134
8 changed files with 88 additions and 2522 deletions

View File

@ -4,3 +4,8 @@
- vim-vint
- yamllint
- cmakelint
- repo:
- remote: https://github.com/k-takata/minpac.git
location: ~/.vim/pack/minpac/opt/minpac
- command:
- vim +PackUpdate +quitall

View File

@ -1,18 +1,19 @@
" Surround visual block in #if 0 block
" Add Doxygen documentation generation plugin.
packadd DoxygenToolkit.vim
nnoremap <leader>d :Dox<CR>
" Surround visual block in #if 0 block.
vmap 0 V'<[ ki#if 0<Esc>'>o#endif<Esc>
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
" Set 'commentstring' to single line comment style.
setlocal commentstring=//%s
" Stop automatic new lines which typing long single liners
" Stop automatic new lines which typing long single liners.
setlocal textwidth=0
" Map K to get YouCompleteMe documentation
" Map K to get YouCompleteMe documentation.
nnoremap K :YcmCompleter GetDoc<CR>
" "ys{motion}t" turns "word" -> "TODO(word):"
let b:surround_{char2nr("t")} = "TODO(\r):"
" "ys{motion}/" turns "text" into "/*text*/"
let b:surround_{char2nr("/")} = "/*\r*/"
" Map K to get YouCompleteMe documentation
" Map K to get YouCompleteMe documentation.
nnoremap K :YcmCompleter GetDoc<CR>
" DoxygenToolkit
nnoremap <leader>d :Dox<CR>

View File

@ -1,3 +1,6 @@
" Add omnifunc completion plugin.
packadd vim-cmake-completion
" Enable syntax folding, see .vim/after/syntax/cmake.vim
setlocal foldmethod=syntax
" Set comment string

View File

@ -1,4 +1,5 @@
" Add Doxygen documentation generation plugin.
packadd DoxygenToolkit.vim
nnoremap <leader>d :Dox<CR>
" Map K to get YouCompleteMe documentation
nnoremap K :YcmCompleter GetDoc<CR>
" DoxygenToolkit
nnoremap <leader>d :Dox<CR>

View File

@ -1,3 +1,6 @@
" Add omnifunc completion package.
packadd vimomni
" Mapping for Vim help of the word under cursor.
nnoremap K :help <C-r><C-w><CR>

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,9 @@
" minpac
command! PackUpdate packadd minpac | source $MYVIMRC |
\ call minpac#update('', {'do': 'call minpac#status()'})
command! PackStatus packadd minpac | source $MYVIMRC | call minpac#status()
command! PackClean packadd minpac | source $MYVIMRC | call minpac#clean()
" YouCompleteMe
nnoremap <leader>fi :YcmCompleter FixIt<CR>
nnoremap <leader>gd :YcmCompleter GoTo<CR>

121
vimrc
View File

@ -11,38 +11,40 @@ if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
if exists('*minpac#init')
" When minpac is loaded initialize and define the Pack command.
call minpac#init()
command! -nargs=+ Pack call minpac#add(<args>)
else
" Otherwise define the Pack command to do nothing.
command! -nargs=+ Pack
endif
" Append work config to the runttime path.
set runtimepath+=~/.config/work
" Plugins
call plug#begin('~/.vim/bundle')
" Load local plugins first, allows local dev whilst also being installed.
if filereadable(expand('~/.vim/local.vim'))
source ~/.vim/local.vim
endif
" vim-airline - improved status bar
" TODO: Get rid of airline and roll your own
Plug 'vim-airline/vim-airline'
Pack 'vim-airline/vim-airline'
let g:airline#extensions#branch#enabled = 0
let g:airline#extensions#hunks#enabled = 0
for s:setting in ['left_sep', 'right_sep', 'section_error', 'section_warning']
exec 'let g:airline_'.s:setting.' = ""'
endfor
" tabline.vim - sanely numbered tabs
Plug 'mkitt/tabline.vim'
Pack 'mkitt/tabline.vim'
" YouCompleteMe
" TODO: Try out neovim completion plugins to see if they are better
if !platform#is_windows()
if platform#is_linux()
" YouCompleteMe with parameter completion
Plug 'oblitum/YouCompleteMe', {'do': './install.py --clang-completer'}
let s:YouCompleteMe = 'oblitum/YouCompleteMe'
else
" YouCompleteMe upstream works best on macOS
Plug 'Valloric/YouCompleteMe', {'do': './install.py --clang-completer'}
let s:YouCompleteMe = 'Valloric/YouCompleteMe'
endif
Pack 'Valloric/YouCompleteMe',
\ {'type': 'opt', 'do': '!./install.py --clang-completer'}
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:ycm_min_num_of_chars_for_completion = 1
@ -58,22 +60,23 @@ if !platform#is_windows()
endif
if has('python')
" ultisnips - snippet engine
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Pack 'SirVer/ultisnips'
Pack 'honza/vim-snippets'
endif
" vim-cmake-completion - completion & help
Plug 'kbenzie/vim-cmake-completion', {'for': ['cmake']}
Pack 'kbenzie/vim-cmake-completion', {'type': 'opt'}
" vimomni - Completion for vimscript
Plug 'vim-scripts/vimomni', {'for': ['vim']}
Pack 'vim-scripts/vimomni', {'type': 'opt'}
" ale - Asynchronous Lint Engine
Plug 'w0rp/ale'
Pack 'w0rp/ale'
let g:ale_sign_error = '▸'
let g:ale_sign_warning = '▸'
let g:ale_echo_msg_format = '[%linter%] %s (%code%)'
let g:ale_linters = {'c': [], 'cpp': []}
" git diff in the sign column
Plug 'airblade/vim-gitgutter'
Pack 'airblade/vim-gitgutter'
if exists('&signcolumn')
set signcolumn=yes
else
@ -82,61 +85,61 @@ endif
if has('python')
" format.vim - format with text objects
Plug 'git@bitbucket.org:infektor/format.vim.git'
Pack 'git@bitbucket.org:infektor/format.vim.git'
endif
" vim-textobj-user - library for creating text objects
Plug 'kana/vim-textobj-user'
Pack 'kana/vim-textobj-user'
" vim-textobj-entire - Entire file text object
let g:textobj_entire_no_default_key_mappings = 1
Plug 'kana/vim-textobj-entire'
Pack 'kana/vim-textobj-entire'
xmap a% <Plug>(textobj-entire-a)
omap a% <Plug>(textobj-entire-a)
xmap i% <Plug>(textobj-entire-i)
omap i% <Plug>(textobj-entire-i)
" vim-textobj-parameter - Parameter text object
Plug 'sgur/vim-textobj-parameter'
Pack 'sgur/vim-textobj-parameter'
" vim-textobj-uri - URI text object
Plug 'jceb/vim-textobj-uri'
Pack 'jceb/vim-textobj-uri'
" vim-textobj-comment - Comment text object
Plug 'glts/vim-textobj-comment'
Pack 'glts/vim-textobj-comment'
omap a/ <Plug>(textobj-comment-a)
xmap a/ <Plug>(textobj-comment-a)
omap i/ <Plug>(textobj-comment-i)
xmap i/ <Plug>(textobj-comment-i)
" vim-textobj-sentence - Improved sentence text object
Plug 'reedes/vim-textobj-sentence'
Pack 'reedes/vim-textobj-sentence'
" vim-commentary - toggle comments
Plug 'tpope/vim-commentary'
Pack 'tpope/vim-commentary'
" vim-surround - edit delimiters
Plug 'tpope/vim-surround'
Pack 'tpope/vim-surround'
" vim-repeat - better dot command
Plug 'tpope/vim-repeat'
Pack 'tpope/vim-repeat'
" vim-fugitive - git wrapper
Plug 'tpope/vim-fugitive'
Pack 'tpope/vim-fugitive'
" vim-eunuch - unix command warppers
Plug 'tpope/vim-eunuch'
Pack 'tpope/vim-eunuch'
" vim-vinegar - improved directory browser
Plug 'tpope/vim-vinegar'
Pack 'tpope/vim-vinegar'
" vim-abolish - CamelCase to under_score to mixedCase
" TODO: Copy the good bit remove this plugin
Plug 'tpope/vim-abolish'
Pack 'tpope/vim-abolish'
" vim-unimpaired - for pairs of tasks
Plug 'tpope/vim-unimpaired'
Pack 'tpope/vim-unimpaired'
" vim-speeddating - sane date manipulation
Plug 'tpope/vim-speeddating'
Pack 'tpope/vim-speeddating'
" vim-endwise - wisely add end{if,function}, fork with cmake support
Plug 'godbyk/vim-endwise', {'branch': 'patch-1'}
Pack 'godbyk/vim-endwise', {'rev': 'patch-1'}
" vim-jdaddy - text object & formatting for json
Plug 'tpope/vim-jdaddy'
Pack 'tpope/vim-jdaddy'
" vim-projectionist - granular project configuration
Plug 'tpope/vim-projectionist'
Pack 'tpope/vim-projectionist'
" fzf.vim - Fuzzy finder
if !platform#is_windows()
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all --no-update-rc'}
Plug 'junegunn/fzf.vim'
" Pack 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all --no-update-rc'}
Pack 'junegunn/fzf.vim'
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-s': 'split',
@ -144,28 +147,28 @@ if !platform#is_windows()
\ }
endif
Plug 'kbenzie/note.vim'
Pack 'kbenzie/note.vim'
let g:note_directory = '~/Sync/Notes'
if !platform#is_windows()
if !has('win32')
" Seemless vim/tmux pane navigation
Plug 'christoomey/vim-tmux-navigator'
Pack 'christoomey/vim-tmux-navigator'
" Enable focus events when in tmux session
Plug 'tmux-plugins/vim-tmux-focus-events'
Pack 'tmux-plugins/vim-tmux-focus-events'
endif
" replay macros with the enter key
Plug 'wincent/replay'
Pack 'wincent/replay'
" vim-matchit - Improved % matching
Plug 'andymass/vim-matchup'
Pack 'andymass/vim-matchup'
" vim-table-mode - Easy table manipulation
Plug 'dhruvasagar/vim-table-mode'
Pack 'dhruvasagar/vim-table-mode'
let g:table_mode_map_prefix = '<leader>t'
let g:table_mode_toggle_map = 'M'
" DoxygenToolkit.vim - documentation stubs
Plug 'vim-scripts/DoxygenToolkit.vim', {'for': ['cpp', 'c']}
Pack 'vim-scripts/DoxygenToolkit.vim', {'type': 'opt'}
let g:DoxygenToolkit_commentType = 'C++'
" markdown fenced code block languages
@ -173,27 +176,25 @@ let g:markdown_fenced_languages =
\ ['cpp', 'c', 'cmake', 'sh', 'vim', 'python', 'yaml']
" Python folding
Plug 'kalekundert/vim-coiled-snake'
Pack 'kalekundert/vim-coiled-snake'
" Enable builtin syntax folding
let g:xml_syntax_folding = 1
let g:sh_fold_enabled = 1
" xterm-color-table.vim - view term and hex colors
Plug 'guns/xterm-color-table.vim'
Pack 'guns/xterm-color-table.vim'
" SPIR-V syntax
Plug 'kbenzie/vim-spirv'
Pack 'kbenzie/vim-spirv'
let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c'
" CMake, GLSL, HLSL, OpenCL C syntax
Plug 'rperier/vim-cmake-syntax'
Plug 'tikhomirov/vim-glsl'
Plug 'beyondmarc/hlsl.vim'
Plug 'frasercrmck/opencl.vim'
Plug 'asciidoc/vim-asciidoc'
Plug 'mustache/vim-mustache-handlebars'
Plug 'joshglendenning/vim-caddyfile'
Plug 'kbenzie/vim-khr'
call plug#end()
Pack 'rperier/vim-cmake-syntax'
Pack 'tikhomirov/vim-glsl'
Pack 'beyondmarc/hlsl.vim'
Pack 'frasercrmck/opencl.vim'
Pack 'asciidoc/vim-asciidoc'
Pack 'mustache/vim-mustache-handlebars'
Pack 'joshglendenning/vim-caddyfile'
Pack 'kbenzie/vim-khr'