mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 17:30:05 +08:00
Add key binding for open plugin dir
This commit is contained in:
parent
c48ab7e6a2
commit
5f3b59ff85
@ -538,11 +538,27 @@ function! s:new_window() abort
|
|||||||
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nomodifiable nospell
|
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nomodifiable nospell
|
||||||
setf SpaceVimPlugManager
|
setf SpaceVimPlugManager
|
||||||
nnoremap <silent> <buffer> q :bd<CR>
|
nnoremap <silent> <buffer> q :bd<CR>
|
||||||
|
nnoremap <silent> <buffer> gf :call <SID>open_plugin_dir()<cr>
|
||||||
" process has finished or does not start.
|
" process has finished or does not start.
|
||||||
return 2
|
return 2
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:open_plugin_dir() abort
|
||||||
|
let line = line('.') - 3
|
||||||
|
let plugin = filter(copy(s:ui_buf), 's:ui_buf[v:key] == line')
|
||||||
|
if !empty(plugin)
|
||||||
|
exe 'topleft split'
|
||||||
|
enew
|
||||||
|
exe 'resize ' . &lines * 30 / 100
|
||||||
|
if has('nvim')
|
||||||
|
call termopen($SHELL, {'cwd' : dein#get(keys(plugin)[0]).path})
|
||||||
|
else
|
||||||
|
call term_start($SHELL, {'curwin' : 1, 'term_finish' : 'close'})
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:resume_window() abort
|
function! s:resume_window() abort
|
||||||
execute get(g:, 'spacevim_window', 'vertical topleft new')
|
execute get(g:, 'spacevim_window', 'vertical topleft new')
|
||||||
let s:plugin_manager_buffer = bufnr('%')
|
let s:plugin_manager_buffer = bufnr('%')
|
||||||
|
Loading…
Reference in New Issue
Block a user