Skip to content

Commit d78cd0f

Browse files
committed
Predefined command option for VimuxPromptCommand
Added the possibility to specify a predefined command which can be edited or completed in the prompt line.
1 parent 1c3ca9e commit d78cd0f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/vimux.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ command VimuxInspectRunner :call VimuxInspectRunner()
1111
command VimuxScrollUpInspect :call VimuxScrollUpInspect()
1212
command VimuxScrollDownInspect :call VimuxScrollDownInspect()
1313
command VimuxInterruptRunner :call VimuxInterruptRunner()
14-
command VimuxPromptCommand :call VimuxPromptCommand()
14+
command -nargs=? VimuxPromptCommand :call VimuxPromptCommand(<args>)
1515
command VimuxClearRunnerHistory :call VimuxClearRunnerHistory()
1616
command VimuxTogglePane :call VimuxTogglePane()
1717

@@ -37,6 +37,7 @@ function! VimuxRunCommand(command, ...)
3737
let g:VimuxLastCommand = a:command
3838

3939
call VimuxSendKeys(resetSequence)
40+
echo a:command
4041
call VimuxSendText(a:command)
4142

4243
if l:autoreturn == 1
@@ -131,8 +132,8 @@ function! VimuxClearRunnerHistory()
131132
endif
132133
endfunction
133134

134-
function! VimuxPromptCommand()
135-
let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "))
135+
function! VimuxPromptCommand(command, ...)
136+
let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "),a:command)
136137
call VimuxRunCommand(l:command)
137138
endfunction
138139

0 commit comments

Comments
 (0)