Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VimuxSetRunner to allow defining any panel as runner #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/vimux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -69,6 +70,7 @@ Furthermore there are several handy commands all starting with 'Vimux':
- |VimuxCloseRunner|
- |VimuxInspectRunner|
- |VimuxInterruptRunner|
- |VimuxSetRunner|
- |VimuxPromptCommand|
- |VimuxClearRunnerHistory|
- |VimuxZoomRunner|
Expand Down Expand Up @@ -211,7 +213,15 @@ inFile: If 1 the filename will be appended to the command
" Push the repository of the currently opened file
nnoremap <leader>gp :call VimuxRunCommandInDir("git push", 0)<CR>
<
------------------------------------------------------------------------------
*VimuxSetRunner*
VimuxSetRunner~

Define which pane to use as Runner.
>
" Set pane with index 3 as runner
:call VimuxSetRunner(3)
<
==============================================================================
MISC (3) *VimuxMisc*

Expand Down Expand Up @@ -240,6 +250,9 @@ Full Keybind Example~

" Zoom the runner pane (use <bind-key> z to restore runner pane)
map <Leader>vz :call VimuxZoomRunner()<CR>

" prompts for new runner index
map <leader>vs :VimuxSetRunner(input('Runner index: '))<CR>
>

------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions plugin/vimux.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ command VimuxInterruptRunner :call VimuxInterruptRunner()
command -nargs=? VimuxPromptCommand :call VimuxPromptCommand(<args>)
command VimuxClearRunnerHistory :call VimuxClearRunnerHistory()
command VimuxTogglePane :call VimuxTogglePane()
command -nargs=? VimuxSetRunner :call VimuxSetRunner(<args>)

function! VimuxRunCommandInDir(command, useFile)
let l:file = ""
Expand Down Expand Up @@ -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)
Expand Down