mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-22 06:03:44 +08:00
46 lines
1.5 KiB
VimL
46 lines
1.5 KiB
VimL
"=============================================================================
|
|
" 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',
|
|
\ 'LeaderfColorscheme',
|
|
\ ],
|
|
\ 'loadconf' : 1,
|
|
\ 'merged' : 0}])
|
|
return plugins
|
|
endfunction
|
|
|
|
|
|
function! SpaceVim#layers#leaderf#config() abort
|
|
call SpaceVim#mapping#space#def('nnoremap', ['j', 'i'], 'Denite outline', 'jump to a definition in buffer', 1)
|
|
nnoremap <silent> <C-p> :LeaderfFile<cr>
|
|
call SpaceVim#mapping#space#def('nnoremap', ['T', 's'], 'LeaderfColorscheme', 'fuzzy find colorschemes', 1)
|
|
let g:_spacevim_mappings.f = {'name' : '+Fuzzy Finder'}
|
|
call s:defind_fuzzy_finder()
|
|
endfunction
|
|
|
|
let s:file = expand('<sfile>:~')
|
|
let s:unite_lnum = expand('<slnum>') + 3
|
|
function! s:defind_fuzzy_finder() abort
|
|
nnoremap <silent> <Leader>fo :<C-u>LeaderfFunction<CR>
|
|
let lnum = expand('<slnum>') + s:unite_lnum - 4
|
|
let g:_spacevim_mappings.f.o = ['LeaderfFunction',
|
|
\ 'fuzzy find outline',
|
|
\ [
|
|
\ '[Leader f o] is to fuzzy find outline',
|
|
\ '',
|
|
\ 'Definition: ' . s:file . ':' . lnum,
|
|
\ ]
|
|
\ ]
|
|
endfunction
|