1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:40:05 +08:00

Fix SPC p f key binding

This commit is contained in:
wsdjeg 2018-03-31 21:21:09 +08:00
parent 96b4830ff1
commit 1683e4c024
5 changed files with 49 additions and 21 deletions

View File

@ -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('<slnum>') + 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)

View File

@ -19,6 +19,17 @@ endfunction
let s:filename = expand('<sfile>:~')
let s:lnum = expand('<slnum>') + 2
function! SpaceVim#layers#ctrlp#config() abort
let lnum = expand('<slnum>') + 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 <silent> <C-p> :Ctrlp<cr>

View File

@ -39,6 +39,17 @@ function! SpaceVim#layers#denite#config() abort
\ ]
\ ]
\ , 1)
let lnum = expand('<slnum>') + 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('<sfile>:~')

View File

@ -21,6 +21,17 @@ endfunction
let s:filename = expand('<sfile>:~')
let s:lnum = expand('<slnum>') + 2
function! SpaceVim#layers#fzf#config() abort
let lnum = expand('<slnum>') + 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 <silent> <C-p> :FzfFiles<cr>
call SpaceVim#mapping#space#def('nnoremap', ['T', 's'], 'FzfColors', 'fuzzy find colorschemes', 1)

View File

@ -48,6 +48,22 @@ endfunction
let s:filename = expand('<sfile>:~')
let s:lnum = expand('<slnum>') + 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('<slnum>') + 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)