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:
1
.config/vim/pack/plugins/start/fzf
Symbolic link
1
.config/vim/pack/plugins/start/fzf
Symbolic link
@@ -0,0 +1 @@
|
||||
../opt/fzf
|
||||
1
.config/vim/pack/plugins/start/fzf.vim
Symbolic link
1
.config/vim/pack/plugins/start/fzf.vim
Symbolic link
@@ -0,0 +1 @@
|
||||
../opt/fzf.vim
|
||||
1
.config/vim/pack/plugins/start/vim-gutentags
Symbolic link
1
.config/vim/pack/plugins/start/vim-gutentags
Symbolic link
@@ -0,0 +1 @@
|
||||
../opt/vim-gutentags/
|
||||
1
.config/vim/pack/plugins/start/vim-surround
Symbolic link
1
.config/vim/pack/plugins/start/vim-surround
Symbolic link
@@ -0,0 +1 @@
|
||||
../opt/vim-surround/
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user