vim: Load other always-on plugins too

And move the plugin specific keybindings into 40-keybindings.vim.
`packloadall` sources the plugins directly in contrast to `packadd`.
Because of that we can access the `g:loaded_*` variables and do not have
to specify our own keybindings for vim-surround as now the user bindings
are loaded later and overwrite possible clashes.
This commit is contained in:
2020-12-23 19:26:05 +01:00
parent b6e92aef0e
commit e6262b6593
7 changed files with 12 additions and 21 deletions

View File

@@ -0,0 +1 @@
../opt/fzf

View File

@@ -0,0 +1 @@
../opt/fzf.vim

View File

@@ -0,0 +1 @@
../opt/vim-gutentags/

View File

@@ -0,0 +1 @@
../opt/vim-surround/

View File

@@ -1,10 +0,0 @@
" Overwrite vim-surround bindings.
nmap ds <Plug>Dsurround
nmap cs <Plug>Csurround
nmap cS <Plug>CSurround
nmap ys <Plug>Ysurround
nmap yS <Plug>YSurround
nmap yss <Plug>Yssurround
nmap ySS <Plug>YSsurround
xmap s <Plug>VSurround
xmap gs <Plug>VgSurround

View File

@@ -12,17 +12,6 @@ if (has('patch-8.1.1719') || has('nvim'))
packadd! coc.nvim
source $XDG_CONFIG_HOME/vim/coc.nvim.vim
endif
" Fuzzy finder
packadd! fzf
packadd! fzf.vim
nmap <leader>f :Files<CR>
" LaTeX
autocmd BufNewFile,BufRead *.tex packadd! vimtex
\ | source $XDG_CONFIG_HOME/vim/vimtex.vim
" ctags
packadd! vim-gutentags
nmap <leader>t :Tags<CR>
" Surround text with parentheses, brackets, quotes, tags, etc.
let g:surround_no_mappings = 1
packadd! vim-surround
source $XDG_CONFIG_HOME/vim/vim-surround.vim

View File

@@ -83,3 +83,11 @@ if (has('nvim'))
elseif (has('terminal'))
nmap <leader><CR> :terminal<CR>
endif
" Plugin specific bindings
if (get(g:, 'loaded_fzf'))
nmap <leader>f :Files<CR>
if (get(g:, 'loaded_gutentags'))
nmap <leader>t :Tags<CR>
endif
endif