1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:20:06 +08:00

Add unite leader

This commit is contained in:
wsdjeg 2017-01-12 12:43:13 +08:00
parent a0aa880fa0
commit 8bc023c54d
3 changed files with 29 additions and 25 deletions

View File

@ -244,6 +244,9 @@ function! SpaceVim#end() abort
if !empty(g:spacevim_windows_leader)
call SpaceVim#mapping#leader#defindWindowsLeader(g:spacevim_windows_leader)
endif
if !empty(g:spacevim_unite_leader)
call SpaceVim#mapping#leader#defindUniteLeader(g:spacevim_unite_leader)
endif
if g:spacevim_simple_mode
let g:spacevim_plugin_groups = ['core']
else

View File

@ -17,5 +17,30 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
endfunction
function! SpaceVim#mapping#leader#defindUniteLeader(key) abort
if !empty(a:key)
" The prefix key.
nnoremap [unite] <Nop>
exe 'nmap ' .a:key . ' [unite]'
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
\ -buffer-name=files buffer bookmark file<CR>
nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir
\ -buffer-name=files -prompt=%\ buffer bookmark file<CR>
nnoremap <silent> [unite]r :<C-u>Unite
\ -buffer-name=register register<CR>
nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline -start-insert -auto-preview -split outline<CR>
nnoremap <silent> [unite]s :<C-u>Unite session<CR>
nnoremap <silent> [unite]n :<C-u>Unite session/new<CR>
nnoremap <silent> [unite]fr
\ :<C-u>Unite -buffer-name=resume resume<CR>
nnoremap <silent> [unite]ma
\ :<C-u>Unite mapping<CR>
nnoremap <silent> [unite]me
\ :<C-u>Unite output:message<CR>
nnoremap [unite]f :<C-u>Unite source<CR>
nnoremap <silent> [unite]w
\ :<C-u>Unite -buffer-name=files -no-split
\ jump_point file_point buffer_tab
\ file_rec:! file file/new<CR>
nnoremap <silent>[unite]<Space> :Unite -silent -ignorecase -winheight=17 -start-insert menu:CustomKeyMaps<CR>
endif
endfunction

View File

@ -229,30 +229,6 @@ nnoremap <silent><leader>y :<C-u>Unite -no-split -buffer-name=yank history/yank<
" :Unite neobundle/search
"for Unite menu{
nnoremap <silent><leader>ug :Unite -silent -start-insert menu:git<CR>
" The prefix key.
nnoremap [unite] <Nop>
nmap f [unite]
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
\ -buffer-name=files buffer bookmark file<CR>
nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir
\ -buffer-name=files -prompt=%\ buffer bookmark file<CR>
nnoremap <silent> [unite]r :<C-u>Unite
\ -buffer-name=register register<CR>
nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline -start-insert -auto-preview -split outline<CR>
nnoremap <silent> [unite]s :<C-u>Unite session<CR>
nnoremap <silent> [unite]n :<C-u>Unite session/new<CR>
nnoremap <silent> [unite]fr
\ :<C-u>Unite -buffer-name=resume resume<CR>
nnoremap <silent> [unite]ma
\ :<C-u>Unite mapping<CR>
nnoremap <silent> [unite]me
\ :<C-u>Unite output:message<CR>
nnoremap [unite]f :<C-u>Unite source<CR>
nnoremap <silent> [unite]w
\ :<C-u>Unite -buffer-name=files -no-split
\ jump_point file_point buffer_tab
\ file_rec:! file file/new<CR>
nnoremap <silent>[unite]<Space> :Unite -silent -ignorecase -winheight=17 -start-insert menu:CustomKeyMaps<CR>
nnoremap <silent><Leader>ls :Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos<CR>
nnoremap <silent><Leader>lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR>
call zvim#util#loadMusics()