Skip to content

Commit cf6b8c0

Browse files
committed
Merge pull request #96 from jdavis/patch-1
Add documentation for VimuxRunnerType config variable
2 parents a04b079 + 94b8b93 commit cf6b8c0

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

doc/vimux.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ VimuxOpenPane~
110110

111111
This will either open a new pane or use the nearest pane and set it as the
112112
vimux runner pane for the other vimux commands. You can control if this command
113-
uses the nearest pane or always creates a new one with g:VimuxUseNearestPane
113+
uses the nearest pane or always creates a new one with g:VimuxUseNearest
114114

115115
------------------------------------------------------------------------------
116116
*VimuxPromptCommand*
@@ -282,12 +282,13 @@ Options:
282282
Default: "v"
283283

284284
------------------------------------------------------------------------------
285-
*VimuxConfiguration_use_nearest_pane*
286-
2.3 g:VimuxUseNearestPane~
285+
*VimuxConfiguration_use_nearest*
286+
2.3 g:VimuxUseNearest
287287

288-
Use exising pane (not used by vim) if found instead of running split-window.
288+
Use exising pane or window (not used by vim) if found instead of running
289+
split-window.
289290

290-
let VimuxUseNearestPane = 1
291+
let VimuxUseNearest = 1
291292

292293
Default: 1
293294

@@ -314,5 +315,20 @@ the prompt and your input.
314315

315316
Default: "Command? "
316317

318+
------------------------------------------------------------------------------
319+
*VimuxRunnerType*
320+
2.6 g:VimuxRunnerType~
321+
322+
The type of view object Vimux should use for the runner. For reference, a
323+
tmux session is a group of windows, and a window is a layout of panes.
324+
325+
let g:VimuxRunnerType = "window"
326+
327+
Options:
328+
"pane": for panes
329+
"window": for windows
330+
331+
Default: "pane"
332+
317333
==============================================================================
318334
vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl:

plugin/vimux.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ function! _VimuxTmuxWindowIndex()
156156
endfunction
157157

158158
function! _VimuxNearestIndex()
159-
let panes = split(system("tmux list-"._VimuxRunnerType()."s"), "\n")
159+
let views = split(system("tmux list-"._VimuxRunnerType()."s"), "\n")
160160

161-
for pane in panes
162-
if match(pane, "(active)") == -1
163-
return split(pane, ":")[0]
161+
for view in views
162+
if match(view, "(active)") != -1
163+
return split(view, ":")[0]
164164
endif
165165
endfor
166166

0 commit comments

Comments
 (0)