From d78cd0f8e17b277f35e4df3fdb683761f5801937 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Tue, 19 Aug 2014 08:55:31 +0200 Subject: [PATCH 1/3] Predefined command option for VimuxPromptCommand Added the possibility to specify a predefined command which can be edited or completed in the prompt line. --- plugin/vimux.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 4a4acce..3aaba22 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -11,7 +11,7 @@ command VimuxInspectRunner :call VimuxInspectRunner() command VimuxScrollUpInspect :call VimuxScrollUpInspect() command VimuxScrollDownInspect :call VimuxScrollDownInspect() command VimuxInterruptRunner :call VimuxInterruptRunner() -command VimuxPromptCommand :call VimuxPromptCommand() +command -nargs=? VimuxPromptCommand :call VimuxPromptCommand() command VimuxClearRunnerHistory :call VimuxClearRunnerHistory() command VimuxTogglePane :call VimuxTogglePane() @@ -37,6 +37,7 @@ function! VimuxRunCommand(command, ...) let g:VimuxLastCommand = a:command call VimuxSendKeys(resetSequence) + echo a:command call VimuxSendText(a:command) if l:autoreturn == 1 @@ -131,8 +132,8 @@ function! VimuxClearRunnerHistory() endif endfunction -function! VimuxPromptCommand() - let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? ")) +function! VimuxPromptCommand(command, ...) + let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "),a:command) call VimuxRunCommand(l:command) endfunction From a772fce3e239e1b4adf17e587d7f075d1f310701 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Tue, 19 Aug 2014 10:02:25 +0200 Subject: [PATCH 2/3] Removed Debug Output Removed debug output of command which was still in there --- plugin/vimux.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 3aaba22..566a8f4 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -37,7 +37,6 @@ function! VimuxRunCommand(command, ...) let g:VimuxLastCommand = a:command call VimuxSendKeys(resetSequence) - echo a:command call VimuxSendText(a:command) if l:autoreturn == 1 From 5a530ca8e40957351324313ef963a5456acc68f0 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Wed, 20 Aug 2014 07:47:21 +0200 Subject: [PATCH 3/3] Updated documentation for VimuxPromptCommand Added description for VimuxPromptCommand optional parameter. --- doc/vimux.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/vimux.txt b/doc/vimux.txt index b9bf364..b0ad5e0 100644 --- a/doc/vimux.txt +++ b/doc/vimux.txt @@ -117,10 +117,12 @@ uses the nearest pane or always creates a new one with g:VimuxUseNearest VimuxPromptCommand~ Prompt for a command and run it in a small horizontal split bellow the current -pane. +pane. A parameter can be supplied to predefine a command or a part of the +command which can be edited in the prompt. > " Prompt for a command to run map map vp :VimuxPromptCommand + map vm :VimuxPromptCommand("make ") < ------------------------------------------------------------------------------