Skip to content

Commit 71f28c8

Browse files
authored
Merge pull request #174 from mvanderkamp/split-extra-args
2 parents ef5622f + 48b541b commit 71f28c8

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

doc/vimux.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,5 +375,17 @@ redefine this if you're using something like tmate.
375375

376376
Default: "tmux"
377377

378+
------------------------------------------------------------------------------
379+
*VimuxOpenExtraArgs*
380+
2.8 g:VimuxOpenExtraArgs~
381+
382+
Allows addtional arguments to be passed to the tmux command that opens the
383+
runner. Make sure that the arguments specified are valid depending on whether
384+
you're using panes or windows, and your version of tmux.
385+
386+
let g:VimuxOpenExtraArgs = "-c #{pane_current_path}"
387+
388+
Default: "tmux"
389+
378390
==============================================================================
379391
vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl:

plugin/vimux.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ endif
1414

1515
command -nargs=* VimuxRunCommand :call VimuxRunCommand(<args>)
1616
command VimuxRunLastCommand :call VimuxRunLastCommand()
17+
command VimuxOpenRunner :call VimuxOpenRunner()
1718
command VimuxCloseRunner :call VimuxCloseRunner()
1819
command VimuxZoomRunner :call VimuxZoomRunner()
1920
command VimuxInspectRunner :call VimuxInspectRunner()
@@ -80,12 +81,13 @@ function! VimuxOpenRunner()
8081
if _VimuxOption("g:VimuxUseNearest", 1) == 1 && nearestIndex != -1
8182
let g:VimuxRunnerIndex = nearestIndex
8283
else
84+
let extraArguments = _VimuxOption("g:VimuxOpenExtraArgs", "")
8385
if _VimuxRunnerType() == "pane"
8486
let height = _VimuxOption("g:VimuxHeight", 20)
8587
let orientation = _VimuxOption("g:VimuxOrientation", "v")
86-
call _VimuxTmux("split-window -p ".height." -".orientation)
88+
call _VimuxTmux("split-window -p ".height." -".orientation." ".extraArguments)
8789
elseif _VimuxRunnerType() == "window"
88-
call _VimuxTmux("new-window")
90+
call _VimuxTmux("new-window ".extraArguments)
8991
endif
9092

9193
let g:VimuxRunnerIndex = _VimuxTmuxIndex()

0 commit comments

Comments
 (0)