From ae8eadd6da86f77b643d87e2a70c0567a319ea8e Mon Sep 17 00:00:00 2001 From: Vinicius Gerevini Date: Thu, 21 Feb 2019 15:21:56 +1100 Subject: [PATCH] added VimuxSetRunner to allow defining any panel as runner --- doc/vimux.txt | 13 +++++++++++++ plugin/vimux.vim | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/doc/vimux.txt b/doc/vimux.txt index a469d49..b25ab3f 100644 --- a/doc/vimux.txt +++ b/doc/vimux.txt @@ -16,6 +16,7 @@ CONTENTS *vimux-contents* 2.6 .............................. |VimuxClearRunnerHistory| 2.7 .............................. |VimuxZoomRunner| 2.8 .............................. |VimuxRunCommandInDir| + 2.9 .............................. |VimuxSetRunner| 3. Misc ............................ |VimuxMisc| 3.1 Example Keybinding............ |VimuxExampleKeybinding| 3.2 Tslime Replacement............ |VimuxTslimeReplacement| @@ -69,6 +70,7 @@ Furthermore there are several handy commands all starting with 'Vimux': - |VimuxCloseRunner| - |VimuxInspectRunner| - |VimuxInterruptRunner| + - |VimuxSetRunner| - |VimuxPromptCommand| - |VimuxClearRunnerHistory| - |VimuxZoomRunner| @@ -211,7 +213,15 @@ inFile: If 1 the filename will be appended to the command " Push the repository of the currently opened file nnoremap gp :call VimuxRunCommandInDir("git push", 0) < +------------------------------------------------------------------------------ + *VimuxSetRunner* +VimuxSetRunner~ +Define which pane to use as Runner. +> + " Set pane with index 3 as runner + :call VimuxSetRunner(3) +< ============================================================================== MISC (3) *VimuxMisc* @@ -240,6 +250,9 @@ Full Keybind Example~ " Zoom the runner pane (use z to restore runner pane) map vz :call VimuxZoomRunner() + + " prompts for new runner index + map vs :VimuxSetRunner(input('Runner index: ')) > ------------------------------------------------------------------------------ diff --git a/plugin/vimux.vim b/plugin/vimux.vim index bd3a2db..dbdb9fe 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -14,6 +14,7 @@ command VimuxInterruptRunner :call VimuxInterruptRunner() command -nargs=? VimuxPromptCommand :call VimuxPromptCommand() command VimuxClearRunnerHistory :call VimuxClearRunnerHistory() command VimuxTogglePane :call VimuxTogglePane() +command -nargs=? VimuxSetRunner :call VimuxSetRunner() function! VimuxRunCommandInDir(command, useFile) let l:file = "" @@ -145,6 +146,12 @@ function! VimuxPromptCommand(...) call VimuxRunCommand(l:command) endfunction +function! VimuxSetRunner(...) + if exists("a:1") + let g:VimuxRunnerIndex = a:1 + endif +endfunction + function! _VimuxTmux(arguments) let l:command = _VimuxOption("g:VimuxTmuxCommand", "tmux") return system(l:command." ".a:arguments)