From 77853348099414aedc6d517fa8ed17ee1c91a604 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 5 Jan 2018 23:59:33 +0800 Subject: [PATCH] Update unite desc --- autoload/SpaceVim/mapping/leader.vim | 96 +++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 17 deletions(-) diff --git a/autoload/SpaceVim/mapping/leader.vim b/autoload/SpaceVim/mapping/leader.vim index 44f221dfe..bf6431461 100644 --- a/autoload/SpaceVim/mapping/leader.vim +++ b/autoload/SpaceVim/mapping/leader.vim @@ -243,7 +243,7 @@ endfunction function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort if !empty(a:key) - if a:key == 'F' + if a:key ==# 'F' nnoremap F F endif exe 'nnoremap [denite] :LeaderGuide "' . @@ -287,7 +287,7 @@ endfunction let s:unite_lnum = expand('') + 3 function! SpaceVim#mapping#leader#defindUniteLeader(key) abort if !empty(a:key) - if a:key == 'f' + if a:key ==# 'f' nnoremap f f endif " The prefix key. @@ -307,23 +307,85 @@ function! SpaceVim#mapping#leader#defindUniteLeader(key) abort \ ] \ ] if has('nvim') - nnoremap [unite]f :Unite file_rec/neovim - let g:_spacevim_mappings_unite.f = ['Unite file_rec/neovim', 'file_rec'] + nnoremap [unite]f + \ :Unite file_rec/neovim + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.f = ['Unite file_rec/neovim', + \ 'file_rec', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] else - nnoremap [unite]f :Unite file_rec/async - let g:_spacevim_mappings_unite.f = ['Unite file_rec/async', 'file_rec'] + nnoremap [unite]f + \ :Unite file_rec/async + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.f = ['Unite file_rec/async', + \ 'file_rec', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endif - nnoremap [unite]i :Unite file_rec/git - let g:_spacevim_mappings_unite.i = ['Unite file_rec/git', 'git files'] - nnoremap [unite]g :Unite grep - let g:_spacevim_mappings_unite.g = ['Unite grep', 'unite grep'] - nnoremap [unite]u :Unite source - let g:_spacevim_mappings_unite.u = ['Unite source', 'unite source'] - nnoremap [unite]t :Unite tag - let g:_spacevim_mappings_unite.t = ['Unite tag', 'unite tag'] - nnoremap [unite]T :Unite tag/include + nnoremap [unite]i + \ :Unite file_rec/git + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.i = ['Unite file_rec/git', + \ 'git files', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]g + \ :Unite grep + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.g = ['Unite grep', + \ 'unite grep', + \ [ + \ '[UNITE g ] is to open unite grep source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]u + \ :Unite source + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.u = ['Unite source', + \ 'unite source', + \ [ + \ '[UNITE u ] is to open unite source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]t + \ :Unite tag + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.t = ['Unite tag', + \ 'unite tag', + \ [ + \ '[UNITE t ] is to open unite tag source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]T + \ :Unite tag/include + let lnum = expand('') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.T = ['Unite tag/include', - \ 'unite tag/include'] + \ 'unite tag/include', + \ [ + \ '[UNITE T ] is to open unite tag/include source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap [unite]l :Unite locationlist let g:_spacevim_mappings_unite.l = ['Unite locationlist', \ 'unite locationlist'] @@ -351,7 +413,7 @@ function! SpaceVim#mapping#leader#defindUniteLeader(key) abort \ :Unite mapping nnoremap [unite]me \ :Unite output:message - let g:_spacevim_mappings_unite.m = {'name' : 'unite menus', + let g:_spacevim_mappings_unite.m = {'name' : '+Menus', \ 'a' : ['Unite mapping', 'unite mappings'], \ 'e' : ['Unite output:message', 'unite messages'] \ }