Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add VimuxPromptString

  • Loading branch information...
commit 201964f0467f0be56bd3b98b603a0a03aa94d771 1 parent d6eb9e5
John Krueger authored
Showing with 17 additions and 6 deletions.
  1. +11 −0 doc/vimux.txt
  2. +6 −6 plugin/vimux.vim
View
11 doc/vimux.txt
@@ -291,6 +291,17 @@ The keys sent to the runner pane before running a command. By default it sends
Default: "q C-u"
+------------------------------------------------------------------------------
+ *VimuxPromptString*
+2.5 g:VimuxPromptString~
+
+The string presented in the vim command line when Vimux is invoked. Be sure
+to put a space at the end of the string to allow for distinction between
+the prompt and your input.
+
+ let g:VimuxPromptString = ""
+
+Default: "Command? "
==============================================================================
vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl:
View
12 plugin/vimux.vim
@@ -154,7 +154,11 @@ endfunction
function VimuxPromptCommand()
- let l:command = input("Command? ")
+ if exists("g:VimuxPromptString")
+ let l:command = input(g:VimuxPromptString)
+ elseif
+ let l:command = input("Command? ")
+ endif
call VimuxRunCommand(l:command)
endfunction
@@ -315,14 +319,10 @@ class TmuxSession
end
def _send_command(command, target, auto_return = true)
- _run("send-keys -t #{target} \"#{_escape_command(command)}\"")
+ _run("send-keys -t #{target} \"#{command.gsub('"', '\"')}\"")
_run("send-keys -t #{target} Enter") if auto_return
end
- def _escape_command(command)
- command.gsub('"', '\"').gsub('$', '\$')
- end
-
def _run(command)
`tmux #{command}`
end
Please sign in to comment.
Something went wrong with that request. Please try again.