1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 12:10:05 +08:00

Add key binding for open plugin dir

This commit is contained in:
wsdjeg 2017-12-23 00:38:24 +08:00
parent c48ab7e6a2
commit 5f3b59ff85

View File

@ -538,11 +538,27 @@ function! s:new_window() abort
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nomodifiable nospell
setf SpaceVimPlugManager
nnoremap <silent> <buffer> q :bd<CR>
nnoremap <silent> <buffer> gf :call <SID>open_plugin_dir()<cr>
" process has finished or does not start.
return 2
endif
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
execute get(g:, 'spacevim_window', 'vertical topleft new')
let s:plugin_manager_buffer = bufnr('%')