Skip to content

Commit c56e3f7

Browse files
committed
Merge pull request #113 from m42e/master
Predefined command option for VimuxPromptCommand
2 parents 1c3ca9e + 5a530ca commit c56e3f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/vimux.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ uses the nearest pane or always creates a new one with g:VimuxUseNearest
117117
VimuxPromptCommand~
118118

119119
Prompt for a command and run it in a small horizontal split bellow the current
120-
pane.
120+
pane. A parameter can be supplied to predefine a command or a part of the
121+
command which can be edited in the prompt.
121122
>
122123
" Prompt for a command to run map
123124
map <Leader>vp :VimuxPromptCommand<CR>
125+
map <Leader>vm :VimuxPromptCommand("make ")<CR>
124126
<
125127

126128
------------------------------------------------------------------------------

plugin/vimux.vim

+3-3
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

@@ -131,8 +131,8 @@ function! VimuxClearRunnerHistory()
131131
endif
132132
endfunction
133133

134-
function! VimuxPromptCommand()
135-
let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "))
134+
function! VimuxPromptCommand(command, ...)
135+
let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "),a:command)
136136
call VimuxRunCommand(l:command)
137137
endfunction
138138

0 commit comments

Comments
 (0)