From ff54646761832693f3a5e64ac4f024c941cf5b03 Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sat, 11 Jan 2014 18:31:25 -0600 Subject: [PATCH 1/4] Document VimuxRunnerType option --- doc/vimux.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/vimux.txt b/doc/vimux.txt index c18d0c6..1c26054 100644 --- a/doc/vimux.txt +++ b/doc/vimux.txt @@ -314,5 +314,20 @@ the prompt and your input. Default: "Command? " +------------------------------------------------------------------------------ + *VimuxRunnerType* +2.6 g:VimuxRunnerType~ + +The type of view object Vimux should use for the runner. For reference, a +tmux session is a group of windows, and a window is a layout of panes. + + let g:VimuxRunnerType = "window" + +Options: + "pane": for panes + "window": for windows + +Default: "pane" + ============================================================================== vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl: From ba2b2050b04919168fae53e79302c17ab77f43cb Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sat, 11 Jan 2014 18:33:12 -0600 Subject: [PATCH 2/4] Change pane(s) -> view(s) for clarity Slightly pedantic but it reduces possible confusion. --- plugin/vimux.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index a5e2c7f..295a8fe 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -140,11 +140,11 @@ function! _VimuxTmuxWindowIndex() endfunction function! _VimuxNearestIndex() - let panes = split(system("tmux list-"._VimuxRunnerType()."s"), "\n") + let views = split(system("tmux list-"._VimuxRunnerType()."s"), "\n") - for pane in panes - if match(pane, "(active)") == -1 - return split(pane, ":")[0] + for view in views + if match(view, "(active)") == -1 + return split(view, ":")[0] endif endfor From 17358e51ab4617548e8a8c5fa2cf7d77a5cb0d54 Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sat, 11 Jan 2014 19:05:34 -0600 Subject: [PATCH 3/4] Should return view name if one is active --- plugin/vimux.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 295a8fe..a9244d7 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -143,7 +143,7 @@ function! _VimuxNearestIndex() let views = split(system("tmux list-"._VimuxRunnerType()."s"), "\n") for view in views - if match(view, "(active)") == -1 + if match(view, "(active)") != -1 return split(view, ":")[0] endif endfor From 94b8b938b2b0bf381e44a2ed0ee36bbb85c06dbe Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sat, 11 Jan 2014 19:28:56 -0600 Subject: [PATCH 4/4] Match VimuxUseNearest documentation option w/ code --- doc/vimux.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/vimux.txt b/doc/vimux.txt index 1c26054..8a83d0d 100644 --- a/doc/vimux.txt +++ b/doc/vimux.txt @@ -110,7 +110,7 @@ VimuxOpenPane~ This will either open a new pane or use the nearest pane and set it as the vimux runner pane for the other vimux commands. You can control if this command -uses the nearest pane or always creates a new one with g:VimuxUseNearestPane +uses the nearest pane or always creates a new one with g:VimuxUseNearest ------------------------------------------------------------------------------ *VimuxPromptCommand* @@ -282,12 +282,13 @@ Options: Default: "v" ------------------------------------------------------------------------------ - *VimuxConfiguration_use_nearest_pane* -2.3 g:VimuxUseNearestPane~ + *VimuxConfiguration_use_nearest* +2.3 g:VimuxUseNearest -Use exising pane (not used by vim) if found instead of running split-window. +Use exising pane or window (not used by vim) if found instead of running +split-window. - let VimuxUseNearestPane = 1 + let VimuxUseNearest = 1 Default: 1