From 597581715c4d2cf6e9263c8b3991392f99a853ef Mon Sep 17 00:00:00 2001 From: tonyskn Date: Sat, 5 May 2012 19:08:16 +0200 Subject: [PATCH] Add `CloseVimTmuxRunner` command Closes runner pane only, leaving any other panes in current window intact. --- README.mkd | 11 +++++++++++ plugin/vimux.vim | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/README.mkd b/README.mkd index ebdc255..97db503 100644 --- a/README.mkd +++ b/README.mkd @@ -56,6 +56,14 @@ Move into the tmux runner pane created by `RunVimTmuxCommand` and enter copy mod map ri :InspectVimTmuxRunner ``` +### CloseVimTmuxRunner +Close the tmux runner created by `RunVimTmuxCommand` + +```viml +" Close vim tmux runner opened by RunVimTmuxCommand +map rq :CloseVimTmuxRunner +``` + ### CloseVimTmuxPanes Close all other tmux panes in the current window. @@ -90,6 +98,9 @@ map ri :InspectVimTmuxRunner " Close all other tmux panes in current window map rx :CloseVimTmuxPanes +" Close vim tmux runner opened by RunVimTmuxCommand +map rq :CloseVimTmuxRunner + " Interrupt any command running in the runner pane map rs :InterruptVimTmuxRunner ``` diff --git a/plugin/vimux.vim b/plugin/vimux.vim index b30b46f..94bbaec 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -8,6 +8,7 @@ if !has("ruby") end command RunLastVimTmuxCommand :call RunLastVimTmuxCommand() +command CloseVimTmuxRunner :call CloseVimTmuxRunner() command CloseVimTmuxPanes :call CloseVimTmuxPanes() command CloseVimTmuxWindows :call CloseVimTmuxWindows() command InspectVimTmuxRunner :call InspectVimTmuxRunner() @@ -50,6 +51,11 @@ function CloseVimTmuxWindows() echoerr "CloseVimTmuxWindows is deprecated, use CloseVimTmuxPanes" endfunction +function CloseVimTmuxRunner() + ruby CurrentTmuxSession.new.close_runner_pane + call ClearVimTmuxWindow() +endfunction + function CloseVimTmuxPanes() ruby CurrentTmuxSession.new.close_other_panes call ClearVimTmuxWindow() @@ -169,6 +175,10 @@ class TmuxSession _move_up_pane end + def close_runner_pane + _run("kill-pane -t #{target(:pane => runner_pane)}") + end + def close_other_panes if _run("list-panes").split("\n").length > 1 _run("kill-pane -a")