Skip to content

Commit 201964f

Browse files
committed
add VimuxPromptString
1 parent d6eb9e5 commit 201964f

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

doc/vimux.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ The keys sent to the runner pane before running a command. By default it sends
291291

292292
Default: "q C-u"
293293

294+
------------------------------------------------------------------------------
295+
*VimuxPromptString*
296+
2.5 g:VimuxPromptString~
297+
298+
The string presented in the vim command line when Vimux is invoked. Be sure
299+
to put a space at the end of the string to allow for distinction between
300+
the prompt and your input.
301+
302+
let g:VimuxPromptString = ""
303+
304+
Default: "Command? "
294305

295306
==============================================================================
296307
vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl:

plugin/vimux.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ endfunction
154154

155155

156156
function VimuxPromptCommand()
157-
let l:command = input("Command? ")
157+
if exists("g:VimuxPromptString")
158+
let l:command = input(g:VimuxPromptString)
159+
elseif
160+
let l:command = input("Command? ")
161+
endif
158162
call VimuxRunCommand(l:command)
159163
endfunction
160164

@@ -315,14 +319,10 @@ class TmuxSession
315319
end
316320

317321
def _send_command(command, target, auto_return = true)
318-
_run("send-keys -t #{target} \"#{_escape_command(command)}\"")
322+
_run("send-keys -t #{target} \"#{command.gsub('"', '\"')}\"")
319323
_run("send-keys -t #{target} Enter") if auto_return
320324
end
321325

322-
def _escape_command(command)
323-
command.gsub('"', '\"').gsub('$', '\$')
324-
end
325-
326326
def _run(command)
327327
`tmux #{command}`
328328
end

0 commit comments

Comments
 (0)