Handle keyboard shortcuts at plugin load time
Don't load plugins based on keyboard shortcuts, as this conflicts with vim-which-key. Instead, create shortcuts when plugins are declared, and load them when the commands they provide are used.
This commit is contained in:
parent
b13a63ba83
commit
be99bfda32
9 changed files with 16 additions and 20 deletions
|
@ -1,6 +1,2 @@
|
|||
let g:ctrlp_working_path_mode = '' " Disable CtrlP-controlled chdir
|
||||
let g:ctrlp_map = '' " Disable default mapping
|
||||
|
||||
nnoremap <Leader>pp :CtrlPBuffer<CR>
|
||||
nnoremap <Leader>po :CtrlPMRUFiles<CR>
|
||||
nnoremap <Leader>pi :CtrlP<CR>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
call dein#add('ctrlpvim/ctrlp.vim', #{
|
||||
\ lazy: 1,
|
||||
\ on_map: #{
|
||||
\ n: [ '<Leader>pi' , '<Leader>po', '<Leader>pp' ]
|
||||
\ }
|
||||
\ on_cmd: ['CtrlPBuffer', 'CtrlPMRUFiles', 'CtrlP']
|
||||
\ })
|
||||
|
||||
nnoremap <Leader>pp :CtrlPBuffer<CR>
|
||||
nnoremap <Leader>po :CtrlPMRUFiles<CR>
|
||||
nnoremap <Leader>pi :CtrlP<CR>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
" Add key mappings for updates and installation
|
||||
nnoremap <silent> <Leader>Pu :DeinUpdate<cr>
|
||||
nnoremap <silent> <Leader>Pi :call CheckDeinInstall()<cr>
|
|
@ -1,6 +1,8 @@
|
|||
call dein#add('wsdjeg/dein-ui.vim', #{
|
||||
\ lazy: 1,
|
||||
\ on_map: #{
|
||||
\ n: [ '<Leader>Pu' , '<Leader>Pi' ]
|
||||
\ }
|
||||
\ on_cmd: ['DeinUpdate'],
|
||||
\ })
|
||||
|
||||
" Add key mappings for updates and installation
|
||||
nnoremap <silent> <Leader>Pu :DeinUpdate<cr>
|
||||
nnoremap <silent> <Leader>Pi :call CheckDeinInstall()<cr>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
" NERDTree: ' e' = toggle side bar
|
||||
let g:NERDTreeGitStatusUpdateOnWrite = 1
|
||||
nnoremap <Leader>e :NERDTreeToggle<CR>
|
||||
|
||||
" Set the bookmarks file's path
|
||||
let g:NERDTreeBookmarksFile = GetVardataPath( 'NTBookmarks' )
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
call dein#add('scrooloose/nerdtree', #{
|
||||
\ lazy: 1,
|
||||
\ on_map: #{ n: ['<Leader>e'] },
|
||||
\ on_cmd: [ 'NERDTree', 'NERDTreeToggle' ],
|
||||
\ })
|
||||
|
||||
nnoremap <Leader>e :NERDTreeToggle<CR>
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
" Keyboard shortcut
|
||||
nnoremap <Leader>u :UndotreeToggle<CR>
|
||||
|
||||
" Hide the sign column
|
||||
autocmd FileType undotree setlocal signcolumn=no
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
call dein#add('mbbill/undotree', #{
|
||||
\ lazy: 1 ,
|
||||
\ on_map: #{ n: [ '<Leader>u' ] },
|
||||
\ on_cmd: [ 'UndotreeShow', 'UndotreeToggle' ],
|
||||
\ })
|
||||
|
||||
nnoremap <Leader>u :UndotreeToggle<CR>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
nnoremap <silent> <Space> :<c-u>WhichKey '<Space>'<CR>
|
||||
let g:which_key_map = {}
|
||||
call which_key#register('<Space>', 'g:which_key_map')
|
||||
let g:which_key_fallback_to_native_key = 1
|
||||
|
||||
" Direct commands
|
||||
let g:which_key_map[' '] = [ 'call feedkeys(":nohlsearch\n")' , 'clear-search' ]
|
||||
|
|
Loading…
Reference in a new issue