Skip to content

Commit 905e002

Browse files
committed
Add VimuxTogglePane
1 parent 4cea1a1 commit 905e002

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugin/vimux.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ command VimuxScrollDownInspect :call VimuxScrollDownInspect()
1212
command VimuxInterruptRunner :call VimuxInterruptRunner()
1313
command VimuxPromptCommand :call VimuxPromptCommand()
1414
command VimuxClearRunnerHistory :call VimuxClearRunnerHistory()
15+
command VimuxTogglePane :call VimuxTogglePane()
1516

1617
function! VimuxRunLastCommand()
1718
if exists("g:VimuxRunnerIndex")
@@ -80,6 +81,18 @@ function! VimuxCloseRunner()
8081
endif
8182
endfunction
8283

84+
function! VimuxTogglePane()
85+
if exists("g:VimuxRunnerIndex")
86+
if _VimuxRunnerType() == "window"
87+
call system("tmux join-pane -d -s ".g:VimuxRunnerIndex." -p "._VimuxOption("g:VimuxHeight", 20))
88+
let g:VimuxRunnerType = "pane"
89+
elseif _VimuxRunnerType() == "pane"
90+
call system("tmux break-pane -d -t ".g:VimuxRunnerIndex)
91+
let g:VimuxRunnerType = "window"
92+
endif
93+
endif
94+
endfunction
95+
8396
function! VimuxZoomRunner()
8497
if exists("g:VimuxRunnerIndex")
8598
if _VimuxRunnerType() == "pane"

0 commit comments

Comments
 (0)