Skip to content

Commit 3967826

Browse files
committed
Merge pull request #18 from tonyskn/closeRunnerOnly
Add `CloseVimTmuxRunner` command
2 parents c853343 + 5975817 commit 3967826

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.mkd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ Move into the tmux runner pane created by `RunVimTmuxCommand` and enter copy mod
5656
map <Leader>ri :InspectVimTmuxRunner<CR>
5757
```
5858

59+
### CloseVimTmuxRunner
60+
Close the tmux runner created by `RunVimTmuxCommand`
61+
62+
```viml
63+
" Close vim tmux runner opened by RunVimTmuxCommand
64+
map <Leader>rq :CloseVimTmuxRunner<CR>
65+
```
66+
5967
### CloseVimTmuxPanes
6068
Close all other tmux panes in the current window.
6169

@@ -90,6 +98,9 @@ map <Leader>ri :InspectVimTmuxRunner<CR>
9098
" Close all other tmux panes in current window
9199
map <Leader>rx :CloseVimTmuxPanes<CR>
92100
101+
" Close vim tmux runner opened by RunVimTmuxCommand
102+
map <Leader>rq :CloseVimTmuxRunner<CR>
103+
93104
" Interrupt any command running in the runner pane
94105
map <Leader>rs :InterruptVimTmuxRunner<CR>
95106
```

plugin/vimux.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ if !has("ruby")
88
end
99

1010
command RunLastVimTmuxCommand :call RunLastVimTmuxCommand()
11+
command CloseVimTmuxRunner :call CloseVimTmuxRunner()
1112
command CloseVimTmuxPanes :call CloseVimTmuxPanes()
1213
command CloseVimTmuxWindows :call CloseVimTmuxWindows()
1314
command InspectVimTmuxRunner :call InspectVimTmuxRunner()
@@ -50,6 +51,11 @@ function CloseVimTmuxWindows()
5051
echoerr "CloseVimTmuxWindows is deprecated, use CloseVimTmuxPanes"
5152
endfunction
5253

54+
function CloseVimTmuxRunner()
55+
ruby CurrentTmuxSession.new.close_runner_pane
56+
call ClearVimTmuxWindow()
57+
endfunction
58+
5359
function CloseVimTmuxPanes()
5460
ruby CurrentTmuxSession.new.close_other_panes
5561
call ClearVimTmuxWindow()
@@ -169,6 +175,10 @@ class TmuxSession
169175
_move_up_pane
170176
end
171177

178+
def close_runner_pane
179+
_run("kill-pane -t #{target(:pane => runner_pane)}")
180+
end
181+
172182
def close_other_panes
173183
if _run("list-panes").split("\n").length > 1
174184
_run("kill-pane -a")

0 commit comments

Comments
 (0)