Add zoom runner command and map

This commit is contained in:
Chris Toomey 2014-04-11 13:35:32 -04:00
parent 191d9d843c
commit cf0b282fe2
3 changed files with 19 additions and 2 deletions

View File

@ -26,7 +26,7 @@ VTR, check [the included doc file][].
## Installation
The easiest way to install VTR is to add the git repo as a bundle, then use
The easiest way to install VTR is to add the git repo as a bundle, then use
[Pathogen][], [Vundle][] or similar plugin management option to add it to Vim's
runtime path.

View File

@ -21,6 +21,7 @@ CONTENTS *vtr-contents*
2.11 ............................... |VtrClearRunner|
2.12 ............................... |VtrFlushCommand|
2.13 ............................... |VtrSendCtrlD|
2.14 ............................... |VtrZoomRunnerPane|
3. Configuration ................... |VTR-Configuration|
3.1 ................................ |VtrPercentage|
3.2 ................................ |VtrOrientation|
@ -217,6 +218,15 @@ Send Ctrl-D key sequence to the runner without resetting the current command.
This is useful if you are repeatedly running a script in the debugger and
regularly need to kill the repl.
------------------------------------------------------------------------------
*VtrZoomRunnerPane*
2.12 VtrZoomRunnerPane~
Zoom the runner pane using the native zooming functionality from tmux 1.8.
This will cause the runner pane to temporarily occupy the entire tmux window.
This is useful for temporarily viewing the pane in a larger context, ie to see
a long bracktrace.
==============================================================================
CONFIGURATION (3) *VTR-Configuration*

View File

@ -127,6 +127,12 @@ function! s:FocusRunnerPane()
call s:FocusTmuxPane(s:runner_pane)
endfunction
function! s:ZoomRunnerPane()
call s:EnsureRunnerPane()
let targeted_cmd = s:TargetedTmuxCommand("resize-pane -Z", s:runner_pane)
call s:SendTmuxCommand(targeted_cmd)
endfunction
function! s:SendTmuxCommand(command)
let prefixed_command = "tmux " . a:command
return system(prefixed_command)
@ -389,6 +395,7 @@ function! s:DefineCommands()
command! VtrFlushCommand call s:FlushCommand()
command! VtrSendCtrlD call s:SendCtrlD()
command! VtrAttachToPane call s:AttachToPane()
command! VtrZoomRunnerPane call s:ZoomRunnerPane()
endfunction
function! s:DefineKeymaps()
@ -402,9 +409,9 @@ function! s:DefineKeymaps()
nmap ,kr :VtrKillRunner<cr>
nmap ,fr :VtrFocusRunner<cr>
nmap ,dr :VtrDetachRunner<cr>
nmap ,ar :VtrReattachRunner<cr>
nmap ,cr :VtrClearRunner<cr>
nmap ,fc :VtrFlushCommand<cr>
nmap ,zr :VtrZoomRunnerPane<cr>
endif
endfunction