From 0470d5cb3fda2416c5e6d11dbd789086ba4f4572 Mon Sep 17 00:00:00 2001 From: Chris Toomey Date: Fri, 22 Mar 2013 14:48:03 -0400 Subject: [PATCH] Add CtrlD send sequence --- doc/vim-tmux-runner.txt | 9 +++++++++ plugin/vim-tmux-runner.vim | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/doc/vim-tmux-runner.txt b/doc/vim-tmux-runner.txt index 92ffe5a..7a45139 100644 --- a/doc/vim-tmux-runner.txt +++ b/doc/vim-tmux-runner.txt @@ -20,6 +20,7 @@ CONTENTS *vtr-contents* 2.10 ............................... |VtrReattachRunner| 2.11 ............................... |VtrClearRunner| 2.12 ............................... |VtrFlushCommand| + 2.13 ............................... |VtrSendCtrlD| 3. Configuration ................... |VTR-Configuration| 3.1 ................................ |VtrPercentage| 3.2 ................................ |VtrOrientation| @@ -205,6 +206,14 @@ move the prompt up to hide any previous command output. Flush the previous run command variable. After running this command, the next run of |VtrSendCommandToRunner| will again prompt for the command to run. +------------------------------------------------------------------------------ + *VtrSendCtrlD* +2.12 VtrSendCtrlD~ + +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. + ============================================================================== CONFIGURATION (3) *VTR-Configuration* diff --git a/plugin/vim-tmux-runner.vim b/plugin/vim-tmux-runner.vim index 6c35729..8d254d8 100644 --- a/plugin/vim-tmux-runner.vim +++ b/plugin/vim-tmux-runner.vim @@ -330,6 +330,10 @@ function! s:SendTextToRunner(text) call s:SendEnterSequence() endfunction +function! s:SendCtrlD() + call s:SendKeys('') +endfunction + function! VtrSendCommand(command) call s:EnsureRunnerPane() let escaped_command = shellescape(a:command) @@ -349,6 +353,7 @@ function! s:DefineCommands() command! VtrReattachRunner call s:ReattachPane() command! VtrClearRunner call s:SendClearSequence() command! VtrFlushCommand call s:FlushCommand() + command! VtrSendCtrlD call s:SendCtrlD() endfunction function! s:DefineKeymaps()