diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim index bd5a8aca7..4c8c327a9 100644 --- a/autoload/SpaceVim/layers/core.vim +++ b/autoload/SpaceVim/layers/core.vim @@ -205,27 +205,6 @@ function! SpaceVim#layers#core#config() abort call SpaceVim#mapping#space#def('nnoremap', ['p', 't'], 'call SpaceVim#plugins#projectmanager#current_root()', 'find project root', 1) call SpaceVim#mapping#space#def('nnoremap', ['p', 'k'], 'call SpaceVim#plugins#projectmanager#kill_project()', 'kill all project buffers', 1) call SpaceVim#mapping#space#def('nnoremap', ['p', 'p'], 'call SpaceVim#plugins#projectmanager#list()', 'List all projects', 1) - let lnum = expand('') + s:lnum - 1 - if has('python3') - let cmd = 'Denite file_rec' - elseif has('python') - let cmd = 'LeaderfFile' - else - let cmd = 'CtrlP' - endif - call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], - \ cmd, - \ ['find files in current project', - \ [ - \ '[SPC p f] is to find files in the root of the current project', - \ 'vim with +python3 support will use denite', - \ 'vim with +python support will use leaderf', - \ 'otherwise will use ctrlp', - \ '', - \ 'Definition: ' . s:filename . ':' . lnum, - \ ] - \ ] - \ , 1) call SpaceVim#mapping#space#def('nnoremap', ['p', '/'], 'Grepper', 'fuzzy search for text in current project', 1) call SpaceVim#mapping#space#def('nnoremap', ['q', 'q'], 'qa', 'prompt-kill-vim', 1) call SpaceVim#mapping#space#def('nnoremap', ['q', 'Q'], 'qa!', 'kill-vim', 1) diff --git a/autoload/SpaceVim/layers/ctrlp.vim b/autoload/SpaceVim/layers/ctrlp.vim index 14ed8de19..725ca58e6 100644 --- a/autoload/SpaceVim/layers/ctrlp.vim +++ b/autoload/SpaceVim/layers/ctrlp.vim @@ -19,6 +19,17 @@ endfunction let s:filename = expand(':~') let s:lnum = expand('') + 2 function! SpaceVim#layers#ctrlp#config() abort + let lnum = expand('') + s:lnum - 1 + call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], + \ 'CtrlP', + \ ['find files in current project', + \ [ + \ '[SPC p f] is to find files in the root of the current project', + \ '', + \ 'Definition: ' . s:filename . ':' . lnum, + \ ] + \ ] + \ , 1) call SpaceVim#mapping#space#def('nnoremap', ['j', 'i'], 'Denite outline', 'jump to a definition in buffer', 1) " This is definded in plugin config " nnoremap :Ctrlp diff --git a/autoload/SpaceVim/layers/denite.vim b/autoload/SpaceVim/layers/denite.vim index 589bc75dd..3a5c4bd19 100644 --- a/autoload/SpaceVim/layers/denite.vim +++ b/autoload/SpaceVim/layers/denite.vim @@ -39,6 +39,17 @@ function! SpaceVim#layers#denite#config() abort \ ] \ ] \ , 1) + let lnum = expand('') + s:lnum - 1 + call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], + \ 'Denite file_rec', + \ ['find files in current project', + \ [ + \ '[SPC p f] is to find files in the root of the current project', + \ '', + \ 'Definition: ' . s:filename . ':' . lnum, + \ ] + \ ] + \ , 1) endfunction let s:file = expand(':~') diff --git a/autoload/SpaceVim/layers/fzf.vim b/autoload/SpaceVim/layers/fzf.vim index bb67b4553..7f5134f73 100644 --- a/autoload/SpaceVim/layers/fzf.vim +++ b/autoload/SpaceVim/layers/fzf.vim @@ -21,6 +21,17 @@ endfunction let s:filename = expand(':~') let s:lnum = expand('') + 2 function! SpaceVim#layers#fzf#config() abort + let lnum = expand('') + s:lnum - 1 + call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], + \ 'FzfFiles', + \ ['find files in current project', + \ [ + \ '[SPC p f] is to find files in the root of the current project', + \ '', + \ 'Definition: ' . s:filename . ':' . lnum, + \ ] + \ ] + \ , 1) call SpaceVim#mapping#space#def('nnoremap', ['j', 'i'], 'Denite outline', 'jump to a definition in buffer', 1) nnoremap :FzfFiles call SpaceVim#mapping#space#def('nnoremap', ['T', 's'], 'FzfColors', 'fuzzy find colorschemes', 1) diff --git a/autoload/SpaceVim/layers/unite.vim b/autoload/SpaceVim/layers/unite.vim index ed405c5d3..5244021e0 100644 --- a/autoload/SpaceVim/layers/unite.vim +++ b/autoload/SpaceVim/layers/unite.vim @@ -48,6 +48,22 @@ endfunction let s:filename = expand(':~') let s:lnum = expand('') + 2 function! SpaceVim#layers#unite#config() abort + if has('nvim') + let cmd = 'Unite file_rec/neovim' + else + let cmd = 'Unite file_rec/async' + endif + let lnum = expand('') + s:lnum - 1 + call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], + \ cmd, + \ ['find files in current project', + \ [ + \ '[SPC p f] is to find files in the root of the current project', + \ '', + \ 'Definition: ' . s:filename . ':' . lnum, + \ ] + \ ] + \ , 1) call SpaceVim#mapping#space#def('nnoremap', ['!'], 'call call(' \ . string(s:_function('s:run_shell_cmd')) . ', [])', \ 'shell cmd(current dir)', 1)