mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 09:50:04 +08:00
commit
c7b85d5f56
@ -86,11 +86,6 @@ function! SpaceVim#layers#core#config() abort
|
|||||||
call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['f', 'W'], 'write !sudo tee % >/dev/null', 'save buffer with sudo', 1)
|
||||||
" help mappings
|
" help mappings
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'I'], 'call SpaceVim#issue#report()', 'Report an issue of SpaceVim', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'I'], 'call SpaceVim#issue#report()', 'Report an issue of SpaceVim', 1)
|
||||||
if has('python3')
|
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'i'], 'DeniteCursorWord help', 'get help with the symbol at point', 1)
|
|
||||||
else
|
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'i'], 'UniteWithCursorWord help', 'get help with the symbol at point', 1)
|
|
||||||
endif
|
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'l'], 'SPLayer -l', 'lists all the layers available in SpaceVim', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'l'], 'SPLayer -l', 'lists all the layers available in SpaceVim', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'm'], 'Unite manpage', 'search available man pages', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'm'], 'Unite manpage', 'search available man pages', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['h', 'k'], 'LeaderGuide "[KEYs]"', 'show top-level bindings with mapping guide', 1)
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'k'], 'LeaderGuide "[KEYs]"', 'show top-level bindings with mapping guide', 1)
|
||||||
|
@ -12,6 +12,7 @@ function! SpaceVim#layers#ctrlp#plugins() abort
|
|||||||
\ ['FelikZ/ctrlp-py-matcher'],
|
\ ['FelikZ/ctrlp-py-matcher'],
|
||||||
\ ['mattn/ctrlp-register', {'on_cmd' : 'CtrlPRegister'}],
|
\ ['mattn/ctrlp-register', {'on_cmd' : 'CtrlPRegister'}],
|
||||||
\ ['DeaR/ctrlp-jumps', {'on_cmd' : 'CtrlPJump'}],
|
\ ['DeaR/ctrlp-jumps', {'on_cmd' : 'CtrlPJump'}],
|
||||||
|
\ ['SpaceVim/vim-ctrlp-help', {'on_cmd' : 'CtrlPHelp'}],
|
||||||
\ ]
|
\ ]
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
endfunction
|
||||||
@ -19,6 +20,9 @@ endfunction
|
|||||||
let s:filename = expand('<sfile>:~')
|
let s:filename = expand('<sfile>:~')
|
||||||
let s:lnum = expand('<slnum>') + 2
|
let s:lnum = expand('<slnum>') + 2
|
||||||
function! SpaceVim#layers#ctrlp#config() abort
|
function! SpaceVim#layers#ctrlp#config() abort
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'i'], 'call call('
|
||||||
|
\ . string(s:_function('s:get_help_with_cursor_symbol')) . ', [])',
|
||||||
|
\ 'get help with the symbol at point', 1)
|
||||||
let lnum = expand('<slnum>') + s:lnum - 1
|
let lnum = expand('<slnum>') + s:lnum - 1
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'],
|
call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'],
|
||||||
\ 'CtrlP',
|
\ 'CtrlP',
|
||||||
@ -49,6 +53,13 @@ function! SpaceVim#layers#ctrlp#config() abort
|
|||||||
\ , 1)
|
\ , 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:get_help_with_cursor_symbol() abort
|
||||||
|
let save_ctrlp_default_input = get(g:, 'ctrlp_default_input', '')
|
||||||
|
let g:ctrlp_default_input = expand('<cword>')
|
||||||
|
CtrlPHelp
|
||||||
|
let g:ctrlp_default_input = save_ctrlp_default_input
|
||||||
|
endfunction
|
||||||
|
|
||||||
let s:file = expand('<sfile>:~')
|
let s:file = expand('<sfile>:~')
|
||||||
let s:unite_lnum = expand('<slnum>') + 3
|
let s:unite_lnum = expand('<slnum>') + 3
|
||||||
function! s:defind_fuzzy_finder() abort
|
function! s:defind_fuzzy_finder() abort
|
||||||
@ -96,3 +107,19 @@ function! s:defind_fuzzy_finder() abort
|
|||||||
\ ]
|
\ ]
|
||||||
\ ]
|
\ ]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" function() wrapper
|
||||||
|
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||||
|
function! s:_function(fstr) abort
|
||||||
|
return function(a:fstr)
|
||||||
|
endfunction
|
||||||
|
else
|
||||||
|
function! s:_SID() abort
|
||||||
|
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||||
|
endfunction
|
||||||
|
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||||
|
function! s:_function(fstr) abort
|
||||||
|
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
@ -50,6 +50,7 @@ function! SpaceVim#layers#denite#config() abort
|
|||||||
\ ]
|
\ ]
|
||||||
\ ]
|
\ ]
|
||||||
\ , 1)
|
\ , 1)
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'i'], 'DeniteCursorWord help', 'get help with the symbol at point', 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:file = expand('<sfile>:~')
|
let s:file = expand('<sfile>:~')
|
||||||
|
@ -48,6 +48,7 @@ endfunction
|
|||||||
let s:filename = expand('<sfile>:~')
|
let s:filename = expand('<sfile>:~')
|
||||||
let s:lnum = expand('<slnum>') + 2
|
let s:lnum = expand('<slnum>') + 2
|
||||||
function! SpaceVim#layers#unite#config() abort
|
function! SpaceVim#layers#unite#config() abort
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['h', 'i'], 'UniteWithCursorWord help', 'get help with the symbol at point', 1)
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
let cmd = 'Unite file_rec/neovim'
|
let cmd = 'Unite file_rec/neovim'
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user