diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 7ce471d15..e331148c2 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -69,7 +69,7 @@ let g:spacevim_windows_leader = 's' "" " Unite work flow leader of SpaceVim. Default is `f`. " Set to empty to disable this feature, or you can set to another char. -let g:spacevim_unite_leader = 'f' +let g:spacevim_unite_leader = '\f' "" " Denite work flow leader of SpaceVim. Default is `F`. " Set to empty to disable this feature, or you can set to another char. @@ -614,12 +614,6 @@ 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 !empty(g:spacevim_denite_leader) - call SpaceVim#mapping#leader#defindDeniteLeader(g:spacevim_denite_leader) - endif call SpaceVim#mapping#g#init() call SpaceVim#mapping#z#init() call SpaceVim#mapping#leader#defindglobalMappings() diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index 734d9882b..b9184cb26 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -17,13 +17,18 @@ function! SpaceVim#layers#core#plugins() abort call add(plugins, ['Shougo/vimproc.vim', {'build' : ['make']}]) endif call add(plugins, ['benizi/vim-automkdir']) + + call add(plugins, ['rhysd/clever-f.vim']) + call add(plugins, ['andymass/vim-matchup']) + return plugins endfunction let s:filename = expand(':~') let s:lnum = expand('') + 2 function! SpaceVim#layers#core#config() abort + let g:matchup_matchparen_status_offscreen = 0 " Unimpaired bindings " Quickly add empty lines nnoremap [ :put! =repeat(nr2char(10), v:count1) @@ -211,9 +216,9 @@ function! SpaceVim#layers#core#config() abort if has('python3') let cmd = 'Denite file_rec' elseif has('python') - let cmd = "LeaderfFile" + let cmd = 'LeaderfFile' else - let cmd = "CtrlP" + let cmd = 'CtrlP' endif call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], \ cmd, @@ -340,7 +345,7 @@ function! s:previous_window() abort endfunction function! s:split_string(newline) abort - let syn_name = synIDattr(synID(line("."), col("."), 1), "name") + let syn_name = synIDattr(synID(line('.'), col('.'), 1), 'name') if syn_name == &filetype . 'String' let c = col('.') let sep = '' @@ -367,7 +372,7 @@ function! s:split_string(newline) abort endfunction function! s:is_string(l,c) abort - return synIDattr(synID(a:l, a:c, 1), "name") == &filetype . 'String' + return synIDattr(synID(a:l, a:c, 1), 'name') == &filetype . 'String' endfunction " function() wrapper diff --git a/autoload/SpaceVim/layers/git.vim b/autoload/SpaceVim/layers/git.vim index 13cb09fb6..daece697a 100644 --- a/autoload/SpaceVim/layers/git.vim +++ b/autoload/SpaceVim/layers/git.vim @@ -40,10 +40,6 @@ function! SpaceVim#layers#git#config() abort call SpaceVim#mapping#space#def('nnoremap', ['g', 'A'], 'Gita add .', 'stage all files', 1) call SpaceVim#mapping#space#def('nnoremap', ['g', 'b'], 'Gina blame', 'view git blame', 1) endif - nmap hj (signify-next-hunk) - nmap hk (signify-prev-hunk) - nmap hJ 9999gj - nmap hK 9999gk augroup spacevim_layer_git autocmd! autocmd FileType diff nnoremap q :bd! diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim index 81561c173..de17bb1f4 100644 --- a/autoload/SpaceVim/layers/lang/c.vim +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -81,7 +81,6 @@ function! SpaceVim#layers#lang#c#plugins() abort else call add(plugins, ['bbchung/clighter', { 'if' : has('python')}]) endif - call add(plugins, ['lyuts/vim-rtags', { 'if' : has('python')}]) return plugins endfunction diff --git a/autoload/SpaceVim/layers/leaderf.vim b/autoload/SpaceVim/layers/leaderf.vim new file mode 100644 index 000000000..3492bf68c --- /dev/null +++ b/autoload/SpaceVim/layers/leaderf.vim @@ -0,0 +1,18 @@ +"============================================================================= +" leaderf.vim --- leaderf layer for SpaceVim +" Copyright (c) 2016-2017 Wang Shidong & Contributors +" Author: Wang Shidong < wsdjeg at 163.com > +" URL: https://spacevim.org +" License: GPLv3 +"============================================================================= + + +function! SpaceVim#layers#leaderf#plugins() abort + let plugins = [] + call add(plugins, + \ ['Yggdroot/LeaderF', { 'on_cmd' : 'LeaderfFile', + \ 'loadconf' : 1, + \ 'merged' : 0}]) + return plugins +endfunction + diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index 8babc814c..70e62f40f 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -15,9 +15,6 @@ function! SpaceVim#layers#tools#plugins() abort \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', \ 'loadconf' : 1}], \ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}], - \ ['Yggdroot/LeaderF', { 'on_cmd' : 'LeaderfFile', - \ 'loadconf' : 1, - \ 'merged' : 0}], \ ['MattesGroeger/vim-bookmarks', { 'on_map' : 'Bookmark', \ 'on_cmd' : 'BookmarkShowAll', \ 'loadconf_before' : 1}], @@ -82,14 +79,12 @@ function! SpaceVim#layers#tools#config() abort let g:rainbow#pairs = [['(', ')'], ['[', ']'],['{','}']] " List of colors that you do not want. ANSI code or #RRGGBB let g:rainbow#blacklist = [233, 234] - nnoremap fz :FZF if maparg('', 'v') ==# '' vnoremap :Ydv endif if maparg('', 'n') ==# '' nnoremap :Ydc endif - map td TaskList noremap :TlistToggle if g:spacevim_filemanager ==# 'nerdtree' noremap :NERDTreeToggle diff --git a/autoload/SpaceVim/layers/unite.vim b/autoload/SpaceVim/layers/unite.vim index 061a1f478..94050a560 100644 --- a/autoload/SpaceVim/layers/unite.vim +++ b/autoload/SpaceVim/layers/unite.vim @@ -91,8 +91,293 @@ function! SpaceVim#layers#unite#config() abort call SpaceVim#mapping#space#def('nnoremap', ['p', '!'], 'call call(' \ . string(s:_function('s:run_shell_cmd_project')) . ', [])', \ 'shell cmd(project root)', 1) + let g:_spacevim_mappings.f = {'name' : '+Fuzzy Finder'} + call s:defind_fuzzy_finder() endfunction +let s:file = expand(':~') +let s:unite_lnum = expand('') + 3 +function! s:defind_fuzzy_finder() abort + nnoremap fr + \ :Unite -buffer-name=resume resume + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings.f.r = ['Unite -buffer-name=resume resume', + \ 'resume unite window', + \ [ + \ '[Leader f r ] is to resume unite window', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + return + if has('nvim') + 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 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 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 T ] is to open unite tag/include source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]l + \ :Unite locationlist + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.l = ['Unite locationlist', + \ 'unite locationlist', + \ [ + \ '[UNITE l ] is to open unite locationlist source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]q + \ :Unite quickfix + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.q = ['Unite quickfix', + \ 'unite quickfix', + \ [ + \ '[UNITE q ] is to open unite quickfix source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]e :Unite + \ -buffer-name=register register + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.e = ['Unite register', + \ 'unite register', + \ [ + \ '[UNITE l ] is to open unite locationlist source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]j + \ :Unite jump + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.j = ['Unite jump', + \ 'unite jump', + \ [ + \ '[UNITE j ] is to open unite jump source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]h + \ :Unite history/yank + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.h = ['Unite history/yank', + \ 'unite history/yank', + \ [ + \ '[UNITE h ] is to open unite history/yank source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite] + \ :UniteWithCursorWord help + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite[''] = ['UniteWithCursorWord help', + \ 'unite with cursor word help', + \ [ + \ '[UNITE ] is to open unite help source for cursor word', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]s + \ :Unite session + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.s = ['Unite session', + \ 'unite session', + \ [ + \ '[UNITE s ] is to open unite session source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]o :Unite -buffer-name=outline + \ -start-insert -auto-preview -split outline + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.o = ['Unite outline', + \ 'unite outline', + \ [ + \ '[UNITE o ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + + " menu + nnoremap [unite]ma + \ :Unite mapping + nnoremap [unite]me + \ :Unite output:message + let lnum = expand('') + s:unite_lnum - 6 + let g:_spacevim_mappings_unite.m = {'name' : '+Menus', + \ 'a' : ['Unite mapping', 'unite mappings', + \ [ + \ '[UNITE m a ] is to open unite mapping menu', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ], + \ 'e' : ['Unite output:message', 'unite messages', + \ [ + \ '[UNITE o ] is to open unite message menu', + \ '', + \ 'Definition: ' . s:file . ':' . (lnum + 2), + \ ] + \ ] + \ } + + nnoremap [unite]c :UniteWithCurrentDir + \ -buffer-name=files buffer bookmark file + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.c = + \ ['UniteWithCurrentDir -buffer-name=files buffer bookmark file', + \ 'unite files in current dir', + \ [ + \ '[UNITE c ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]b :UniteWithBufferDir + \ -buffer-name=files -prompt=%\ buffer bookmark file + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.b = + \ ['UniteWithBufferDir -buffer-name=files' . + \ ' buffer bookmark file', + \ 'unite files in current dir', + \ [ + \ '[UNITE b ] is to open unite buffer and bookmark source with cursor', + \ 'word', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]n + \ :Unite session/new + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.n = ['Unite session/new', + \ 'unite session/new', + \ [ + \ '[UNITE n ] is to create new vim session', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]/ + \ :Unite grep:. + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite['/'] = ['Unite grep:.', + \ 'unite grep with preview', + \ [ + \ '[UNITE / ] is to open unite grep source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite]w + \ :Unite -buffer-name=files -no-split + \ jump_point file_point buffer_tab + \ file_rec:! file file/new + let lnum = expand('') + s:unite_lnum - 6 + let g:_spacevim_mappings_unite.w= ['Unite -buffer-name=files -no-split' . + \ ' jump_point file_point buffer_tab file_rec:! file file/new', + \ 'unite all file and jump', + \ [ + \ '[UNITE w ] is to open unite jump_point file_point and buffer_tab', + \ 'source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap [unite] :Unite -silent -ignorecase -winheight=17 + \ -start-insert menu:CustomKeyMaps + let lnum = expand('') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite['[SPC]'] = ['Unite -silent -ignorecase' . + \ ' -winheight=17 -start-insert menu:CustomKeyMaps', + \ 'unite customkeymaps', + \ [ + \ '[UNITE o ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] +endfunction function! s:run_shell_cmd() abort let cmd = input('Please input shell command:', '', 'customlist,SpaceVim#plugins#bashcomplete#complete') if !empty(cmd) diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 3f026cfb6..e72b9853f 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -619,15 +619,6 @@ else \ 'g:_spacevim_mappings_space') call SpaceVim#plugins#help#regist_root({'SPC' : g:_spacevim_mappings_space}) endif -call SpaceVim#mapping#guide#register_prefix_descriptions( - \ g:spacevim_unite_leader, - \ 'g:_spacevim_mappings_unite') -call SpaceVim#plugins#help#regist_root({'[unite]' : g:_spacevim_mappings_unite}) - -call SpaceVim#mapping#guide#register_prefix_descriptions( - \ g:spacevim_denite_leader, - \ 'g:_spacevim_mappings_denite') -call SpaceVim#plugins#help#regist_root({'[denite]' : g:_spacevim_mappings_denite}) call SpaceVim#mapping#guide#register_prefix_descriptions( \ g:spacevim_windows_leader, \ 'g:_spacevim_mappings_windows') diff --git a/autoload/SpaceVim/mapping/leader.vim b/autoload/SpaceVim/mapping/leader.vim index f380c6595..61c7b8dcf 100644 --- a/autoload/SpaceVim/mapping/leader.vim +++ b/autoload/SpaceVim/mapping/leader.vim @@ -13,46 +13,18 @@ function! SpaceVim#mapping#leader#defindglobalMappings() abort inoremap =MyLeaderTabfunc() endif - "for buftabs - noremap bp :bprev - noremap bn :bnext - - "background - noremap bg :call ToggleBG() - "numbers - noremap nu :call ToggleNumber() - " yark and paste - vmap y "+y - vmap d "+d - nmap p "+p - nmap P "+P - vmap p "+p - vmap P "+P + xnoremap y "+y + xnoremap d "+d + nnoremap p "+p + nnoremap P "+P + xnoremap p "+p + xnoremap P "+P cnoremap - "When pressing cd switch to the directory of the open buffer - map cd :cd %:p:h:pwd - - " Fast saving - call SpaceVim#mapping#def('nnoremap', 'w', ':w', - \ 'Save current file', - \ 'w', - \ 'Save current file') - call SpaceVim#mapping#def('vnoremap', 'w', ':w', - \ 'Save current file', - \ 'w', - \ 'Save current file') - - let g:_spacevim_mappings.t = {'name' : 'Toggle editor visuals'} - nmap ts :setlocal spell! - nmap tn :setlocal nonumber! norelativenumber! - nmap tl :setlocal nolist! - nmap th :nohlsearch - nmap tw :setlocal wrap! breakindent! " Location list movement - let g:_spacevim_mappings.l = {'name' : 'Location list movement'} + let g:_spacevim_mappings.l = {'name' : '+Location movement'} call SpaceVim#mapping#def('nnoremap', 'lj', ':lnext', \ 'Jump to next location list position', \ 'lnext', @@ -67,7 +39,7 @@ function! SpaceVim#mapping#leader#defindglobalMappings() abort \ 'Close location list window') " quickfix list movement - let g:_spacevim_mappings.q = {'name' : 'Quickfix list movement'} + let g:_spacevim_mappings.q = {'name' : '+Quickfix movement'} call SpaceVim#mapping#def('nnoremap', 'qj', ':cnext', \ 'Jump to next quickfix list position', \ 'cnext', @@ -84,41 +56,6 @@ function! SpaceVim#mapping#leader#defindglobalMappings() abort \ 'Toggle recording', \ '', \ 'Toggle recording mode') - - " Duplicate lines - nnoremap d m`YP`` - vnoremap d YPgv - - call SpaceVim#mapping#def('nnoremap ', '', - \ ':call zvim#util#CopyToClipboard(1)', - \ 'Yank the github link of current file to X11 clipboard', - \ 'call zvim#util#CopyToClipboard(1)') - call SpaceVim#mapping#def('nnoremap ', '', - \ ':call zvim#util#CopyToClipboard(2)', - \ 'Yank the github link of current line to X11 clipboard', - \ 'call zvim#util#CopyToClipboard(2)') - call SpaceVim#mapping#def('vnoremap ', '', - \ ':call zvim#util#CopyToClipboard(3)', - \ 'Yank the github link of current selection to X11 clipboard', - \ 'call zvim#util#CopyToClipboard(3)') - call SpaceVim#mapping#def('vnoremap', 'S', - \ "y:execute @@:echo 'Sourced selection.'", - \ 'Sourced selection.', - \ "echo 'Use S to sourced selection.'") - call SpaceVim#mapping#def('nnoremap', 'S', - \ "^vg_y:execute @@:echo 'Sourced line.'", - \ 'Source line', - \ "echo 'Use S to sourced line.'") - - call SpaceVim#mapping#def('nnoremap ', 'sv', - \ ':call SpaceVim#mapping#split_previous_buffer()', - \ 'Open previous buffer in split window', - \ 'call SpaceVim#mapping#split_previous_buffer()', - \ 'Split previout buffer') - call SpaceVim#mapping#def('nnoremap ', 'sg', - \ ':call SpaceVim#mapping#vertical_split_previous_buffer()', - \ 'Open previous buffer in vsplit window' , - \ 'call SpaceVim#mapping#vertical_split_previous_buffer()') endfunction let s:lnum = expand('') + 3 @@ -284,297 +221,6 @@ function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort endif endfunction -let s:unite_lnum = expand('') + 3 -function! SpaceVim#mapping#leader#defindUniteLeader(key) abort - if !empty(a:key) - if a:key ==# 'f' - nnoremap f f - endif - " The prefix key. - exe 'nnoremap [unite] :LeaderGuide "' . - \ a:key . '"' - exe 'nmap ' .a:key . ' [unite]' - let g:_spacevim_mappings_unite = {} - nnoremap [unite]r - \ :Unite -buffer-name=resume resume - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.r = ['Unite -buffer-name=resume resume', - \ 'resume unite window', - \ [ - \ '[UNITE r ] is to resume unite window', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - if has('nvim') - 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 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 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 T ] is to open unite tag/include source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]l - \ :Unite locationlist - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.l = ['Unite locationlist', - \ 'unite locationlist', - \ [ - \ '[UNITE l ] is to open unite locationlist source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]q - \ :Unite quickfix - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.q = ['Unite quickfix', - \ 'unite quickfix', - \ [ - \ '[UNITE q ] is to open unite quickfix source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]e :Unite - \ -buffer-name=register register - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.e = ['Unite register', - \ 'unite register', - \ [ - \ '[UNITE l ] is to open unite locationlist source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]j - \ :Unite jump - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.j = ['Unite jump', - \ 'unite jump', - \ [ - \ '[UNITE j ] is to open unite jump source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]h - \ :Unite history/yank - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.h = ['Unite history/yank', - \ 'unite history/yank', - \ [ - \ '[UNITE h ] is to open unite history/yank source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite] - \ :UniteWithCursorWord help - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite[''] = ['UniteWithCursorWord help', - \ 'unite with cursor word help', - \ [ - \ '[UNITE ] is to open unite help source for cursor word', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]s - \ :Unite session - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.s = ['Unite session', - \ 'unite session', - \ [ - \ '[UNITE s ] is to open unite session source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]o :Unite -buffer-name=outline - \ -start-insert -auto-preview -split outline - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.o = ['Unite outline', - \ 'unite outline', - \ [ - \ '[UNITE o ] is to open unite outline source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - - " menu - nnoremap [unite]ma - \ :Unite mapping - nnoremap [unite]me - \ :Unite output:message - let lnum = expand('') + s:unite_lnum - 6 - let g:_spacevim_mappings_unite.m = {'name' : '+Menus', - \ 'a' : ['Unite mapping', 'unite mappings', - \ [ - \ '[UNITE m a ] is to open unite mapping menu', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ], - \ 'e' : ['Unite output:message', 'unite messages', - \ [ - \ '[UNITE o ] is to open unite message menu', - \ '', - \ 'Definition: ' . s:file . ':' . (lnum + 2), - \ ] - \ ] - \ } - - nnoremap [unite]c :UniteWithCurrentDir - \ -buffer-name=files buffer bookmark file - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.c = - \ ['UniteWithCurrentDir -buffer-name=files buffer bookmark file', - \ 'unite files in current dir', - \ [ - \ '[UNITE c ] is to open unite outline source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]b :UniteWithBufferDir - \ -buffer-name=files -prompt=%\ buffer bookmark file - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.b = - \ ['UniteWithBufferDir -buffer-name=files' . - \ ' buffer bookmark file', - \ 'unite files in current dir', - \ [ - \ '[UNITE b ] is to open unite buffer and bookmark source with cursor', - \ 'word', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]n - \ :Unite session/new - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite.n = ['Unite session/new', - \ 'unite session/new', - \ [ - \ '[UNITE n ] is to create new vim session', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]/ - \ :Unite grep:. - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite['/'] = ['Unite grep:.', - \ 'unite grep with preview', - \ [ - \ '[UNITE / ] is to open unite grep source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite]w - \ :Unite -buffer-name=files -no-split - \ jump_point file_point buffer_tab - \ file_rec:! file file/new - let lnum = expand('') + s:unite_lnum - 6 - let g:_spacevim_mappings_unite.w= ['Unite -buffer-name=files -no-split' . - \ ' jump_point file_point buffer_tab file_rec:! file file/new', - \ 'unite all file and jump', - \ [ - \ '[UNITE w ] is to open unite jump_point file_point and buffer_tab', - \ 'source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - nnoremap [unite] :Unite -silent -ignorecase -winheight=17 - \ -start-insert menu:CustomKeyMaps - let lnum = expand('') + s:unite_lnum - 4 - let g:_spacevim_mappings_unite['[SPC]'] = ['Unite -silent -ignorecase' . - \ ' -winheight=17 -start-insert menu:CustomKeyMaps', - \ 'unite customkeymaps', - \ [ - \ '[UNITE o ] is to open unite outline source', - \ '', - \ 'Definition: ' . s:file . ':' . lnum, - \ ] - \ ] - endif -endfunction function! SpaceVim#mapping#leader#getName(key) abort if a:key == g:spacevim_unite_leader @@ -598,10 +244,6 @@ endfunction function! SpaceVim#mapping#leader#defindKEYs() abort let g:_spacevim_mappings_prefixs = {} - let g:_spacevim_mappings_prefixs[g:spacevim_unite_leader] = {'name' : '+Unite prefix'} - call extend(g:_spacevim_mappings_prefixs[g:spacevim_unite_leader], g:_spacevim_mappings_unite) - let g:_spacevim_mappings_prefixs[g:spacevim_denite_leader] = {'name' : '+Denite prefix'} - call extend(g:_spacevim_mappings_prefixs[g:spacevim_denite_leader], g:_spacevim_mappings_denite) let g:_spacevim_mappings_prefixs[g:spacevim_windows_leader] = {'name' : '+Window prefix'} call extend(g:_spacevim_mappings_prefixs[g:spacevim_windows_leader], g:_spacevim_mappings_windows) let g:_spacevim_mappings_prefixs['g'] = {'name' : '+g prefix'} diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 5280c0f3b..2fdc51921 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -153,13 +153,6 @@ function! SpaceVim#mapping#space#init() abort let g:_spacevim_mappings_space[';'] = ['call feedkeys("\CommentOperator")', 'comment operator'] nmap [SPC]; CommentOperator - " in nerdcomment if has map to ... the default mapping will be - " disable, so we add it for compatibility - nmap cc NERDCommenterComment - xmap cc NERDCommenterComment - nmap ci NERDCommenterInvert - xmap ci NERDCommenterInvert - let g:_spacevim_mappings_space.e = {'name' : '+Errors/Encoding'} let g:_spacevim_mappings_space.B = {'name' : '+Global-buffers'} if g:spacevim_relativenumber diff --git a/config/plugins/nerdcommenter.vim b/config/plugins/nerdcommenter.vim index 2f4b3c0cb..8507aeb81 100644 --- a/config/plugins/nerdcommenter.vim +++ b/config/plugins/nerdcommenter.vim @@ -7,6 +7,7 @@ scriptencoding utf-8 " Add extra space around delimiters when commenting, remove them when " uncommenting let g:NERDSpaceDelims = 1 +let g:NERDCreateDefaultMappings = 0 " Always remove the extra spaces when uncommenting regardless of whether " NERDSpaceDelims is set diff --git a/config/plugins/unite.vim b/config/plugins/unite.vim index 8df097fa4..6af95ac22 100644 --- a/config/plugins/unite.vim +++ b/config/plugins/unite.vim @@ -185,8 +185,6 @@ let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [ \['➤ 505 HTTP Version Not Supported ', \ 'echo "HTTP Version Not Supported"'], \] -nnoremap sc :Unite -silent -winheight=17 - \ -start-insert menu:StatusCodeDefinitions let g:unite_source_grep_max_candidates = get(g:, \ 'unite_source_grep_max_candidates', 200) if executable('hw') @@ -238,12 +236,6 @@ let g:unite_source_rec_async_command = get(g:, \ 'unite_source_rec_async_command', \ ['ag', '--follow', '--nocolor', '--nogroup', \ '--hidden', '-g', '']) -nnoremap ufa :Unite -no-split - \ -buffer-name=Mixed -start-insert file file_mru file_rec buffer -nnoremap ufr :Unite - \ -buffer-name=files file_rec/async:! -nnoremap ufg :Unite - \ -buffer-name=git-repo file_rec/git call unite#custom#profile('file_rec/async,file_rec/git', 'context', { \ 'start_insert' : 1, \ 'quit' : 1, @@ -253,42 +245,11 @@ call unite#custom#profile('file_rec/async,file_rec/git', 'context', { \ }) call unite#custom#source('file_rec/async,file_rec/neovim', 'ignore_globs', \ ['*.png','.git/','*.ttf', '*.eot', '*.woff', '*.svg']) -nnoremap uf :Unite - \ -no-split -buffer-name=files -start-insert file -nnoremap ufm :Unite - \ -no-split -buffer-name=mru -start-insert file_mru -nnoremap ubf :Unite - \ -buffer-name=buffer buffer -nnoremap utb :Unite - \ -buffer-name=buffer_tab buffer_tab call unite#custom#profile('buffer,buffer_tab', 'context', { \ 'start_insert' : 0, \ 'quit' : 1, \ 'keep_focus' : 1, \ }) -nnoremap um :Unite -start-insert mapping -"" grep dictionay -""" For searching the word in the cursor in the current directory -nnoremap v :Unite - \ -auto-preview -no-split grep:.:: -""" For searching the word handin -nnoremap vs :Unite -auto-preview -no-split grep:. -""" For searching the word in the cursor in the current buffer -noremap vf :Unite - \ -auto-preview -no-split grep:%:: -""" For searching the word in the cursor in all opened buffer -noremap va :Unite - \ -auto-preview -no-split grep:$buffers:: -nnoremap bl :Unite - \ -start-insert -buffer-name=buffer buffer -nnoremap ta :Unite -start-insert -buffer-name=tag tag -" search plugin -" :Unite neobundle/search -"for Unite menu{ -nnoremap ugg :Unite -silent -start-insert menu:git -nnoremap ugf :UniteWithCursorWord file_rec/async -nnoremap ugt :UniteWithCursorWord tag -nnoremap ls :call view_github_starred_repos() function! s:view_github_starred_repos() abort if empty(g:unite_source_menu_menus.MyStarredrepos.command_candidates) if UpdateStarredRepos() @@ -298,8 +259,6 @@ function! s:view_github_starred_repos() abort Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos endif endfunction -nnoremap lm :Unite - \ -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer call zvim#util#loadMusics() augroup unite_buffer_feature autocmd FileType unite call s:unite_my_settings() diff --git a/config/plugins_before/vim-bookmarks.vim b/config/plugins_before/vim-bookmarks.vim deleted file mode 100644 index 83c16b056..000000000 --- a/config/plugins_before/vim-bookmarks.vim +++ /dev/null @@ -1,7 +0,0 @@ -nmap m BookmarkToggle -nmap mi BookmarkAnnotate -nmap ma BookmarkShowAll -nmap mj BookmarkNext -nmap mk BookmarkPrev -nmap mc BookmarkClear -nmap mx BookmarkClearAll diff --git a/docs/documentation.md b/docs/documentation.md index 2e979d8ac..3f628b42d 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -30,7 +30,6 @@ description: "General documentation about how to using SpaceVim, including the q - [File Operations](#file-operations) - [Editor UI](#editor-ui) - [Native functions](#native-functions) - - [Plugin: Unite](#plugin-unite) - [Plugin: Bookmarks](#plugin-bookmarks) - [Completion](#completion) - [Unite/Denite](#unitedenite) @@ -305,14 +304,6 @@ Move Text Transient State: ## Differences between vim/neovim and SpaceVim -- The `f` key does find char on the right, but in SpaceVim it is the `Unite` key bindings specific leader key by default (which can be set on another key binding in dotfile). If you still prefer the origin function of `f`, you can use an empty string to disable this feature. - -the option is `g:spacevim_unite_leader`, default value is `f`. - -- The `F` key does find char on the left, but in SpaceVim it is the `Denite` key bindings specific leader key by default (which can be set on another key binding in dotfile). If you still prefer the origin function of `F`, you can use an empty string to disable this feature. - -the option is `g:spacevim_denite_leader`, default value is `F`. - - The `s` key does replace cursor char, but in SpaceVim it is the `Window` key bindings specific leader key by default (which can be set on another key binding in dotfile). If you still prefer the origin function of `s`, you can use an empty string to disable this feature. the option is `g:spacevim_windows_leader`, default value is `s`. @@ -668,35 +659,6 @@ can be get by q r | `` + `qr?` | Normal | Same as native `q?`, open cmdwin | | `` + `qr:` | Normal | Same as native `q:`, open cmdwin | -### Plugin: Unite - -| Key | Mode | Action | -| ------------------- | :-----------: | ---------------------------------------------------------- | -| `[unite]` | Normal | unite leader, default is `f`, `:h g:spacevim_unite_leader` | -| `[unite]`+`r` | Normal | Resumes Unite window | -| `[unite]`+`f` | Normal | Opens Unite file recursive search | -| `[unite]`+`i` | Normal | Opens Unite git file search | -| `[unite]`+`g` | Normal | Opens Unite grep with ag (the_silver_searcher) | -| `[unite]`+`u` | Normal | Opens Unite source | -| `[unite]`+`t` | Normal | Opens Unite tag | -| `[unite]`+`T` | Normal | Opens Unite tag/include | -| `[unite]`+`l` | Normal | Opens Unite location list | -| `[unite]`+`q` | Normal | Opens Unite quick fix | -| `[unite]`+`e` | Normal | Opens Unite register | -| `[unite]`+`j` | Normal | Opens Unite jump, change | -| `[unite]`+`h` | Normal | Opens Unite history/yank | -| `[unite]`+`s` | Normal | Opens Unite session | -| `[unite]`+`n` | Normal | Opens Unite session/new | -| `[unite]`+`o` | Normal | Opens Unite outline | -| `[unite]`+`c` | Normal | Opens Unite buffer bookmark file in current directory | -| `[unite]`+`b` | Normal | Opens Unite buffer bookmark file in buffer directory | -| `[unite]`+`ma` | Normal | Opens Unite mapping | -| `[unite]`+`` | Normal | Opens Unite menu:CustomKeyMaps | -| `[unite]`+`me` | Normal | Opens Unite output messages | -| ``+`bl` | Normal | Opens Unite buffers, mru, bookmark | -| ``+`ta` | Normal | Opens Unite tab | -| ``+`ugf` | Normal | Opens Unite file with word at cursor | -| ``+`ugt` | Normal/visual | Opens Unite tag with word at cursor | ### Plugin: Bookmarks diff --git a/docs/layers/unite.md b/docs/layers/unite.md index b85a95aad..f61d75a7a 100644 --- a/docs/layers/unite.md +++ b/docs/layers/unite.md @@ -13,4 +13,33 @@ This layer is a heavily customized warpper for unite.vim and unite sources. ## Configuration -SpaceVim use `f` as the default customized key bindings prefix for unite layer. +This is a fuzzy finder layer for SpaceVim, and it is based on unite.vim. In SpaceVim all fuzzy finder layer use same key bindings: + +## Key bindings + +| Key | Mode | Action | +| ------------------- | :-----------: | ---------------------------------------------------------- | +| `[unite]`+`r` | Normal | Resumes Unite window | +| `[unite]`+`f` | Normal | Opens Unite file recursive search | +| `[unite]`+`i` | Normal | Opens Unite git file search | +| `[unite]`+`g` | Normal | Opens Unite grep with ag (the_silver_searcher) | +| `[unite]`+`u` | Normal | Opens Unite source | +| `[unite]`+`t` | Normal | Opens Unite tag | +| `[unite]`+`T` | Normal | Opens Unite tag/include | +| `[unite]`+`l` | Normal | Opens Unite location list | +| `[unite]`+`q` | Normal | Opens Unite quick fix | +| `[unite]`+`e` | Normal | Opens Unite register | +| `[unite]`+`j` | Normal | Opens Unite jump, change | +| `[unite]`+`h` | Normal | Opens Unite history/yank | +| `[unite]`+`s` | Normal | Opens Unite session | +| `[unite]`+`n` | Normal | Opens Unite session/new | +| `[unite]`+`o` | Normal | Opens Unite outline | +| `[unite]`+`c` | Normal | Opens Unite buffer bookmark file in current directory | +| `[unite]`+`b` | Normal | Opens Unite buffer bookmark file in buffer directory | +| `[unite]`+`ma` | Normal | Opens Unite mapping | +| `[unite]`+`` | Normal | Opens Unite menu:CustomKeyMaps | +| `[unite]`+`me` | Normal | Opens Unite output messages | +| ``+`bl` | Normal | Opens Unite buffers, mru, bookmark | +| ``+`ta` | Normal | Opens Unite tab | +| ``+`ugf` | Normal | Opens Unite file with word at cursor | +| ``+`ugt` | Normal/visual | Opens Unite tag with word at cursor | diff --git a/docs/quick-start-guide.md b/docs/quick-start-guide.md index 6cbd966d0..6af2e85df 100644 --- a/docs/quick-start-guide.md +++ b/docs/quick-start-guide.md @@ -49,6 +49,6 @@ The easist way is to download [install.cmd](https://spacevim.org/install.cmd) an ## Learning SpaceVim -- [SpaceVim Documentation](documentation/). Also known as "The Book", The SpaceVim Documentation will introduce +- [SpaceVim Documentation](documentation). Also known as "The Book", The SpaceVim Documentation will introduce you to the main topics important to using SpaceVim. The book is the primary official document of the language. - [Hack-SpaceVim](https://github.com/Gabirel/Hack-SpaceVim). Tell you how to hack SpaceVim.