kran
2018-06-20 09:58:00 +08:00
建议针对 tab 打开终端。之前自己改的一个:
function! Term_toggle(height)
if exists("t:term_win") && win_gotoid(t:term_win)
let t:term_hight = winheight("")
hide
if exists("t:term_org_win")
call win_gotoid(t:term_org_win)
endif
else
let t:term_org_win = win_getid()
botright new
if exists("t:term_hight")
exec "resize " . t:term_hight
else
exec "resize " . a:height
endif
try
exec "buffer " . t:term_buf
catch
call termopen($SHELL, {"detach": 0})
let t:term_buf = bufnr("")
endtry
startinsert!
let t:term_win = win_getid()
endif
endfunction