diff --git a/doc/vimux.txt b/doc/vimux.txt index b137d67..f0788ad 100644 --- a/doc/vimux.txt +++ b/doc/vimux.txt @@ -431,5 +431,21 @@ Caution: It is probably best not to mix this with |VimuxRunnerName|. < Default: 0 +------------------------------------------------------------------------------ + *VimuxCommandShell* +4.12 g:VimuxCommandShell~ + +Set this option to `1` or `v:true` to enable shell completion in +VimuxPromptCommand +Set this option to `0` or `v:false` to enable vim command editing in +VimuxPromptCommand + +Enabling shell completion blocks the ability to use up-arrow to cycle through +previously-run commands in VimuxPromptCommand. +> + let g:VimuxCommandShell = 0 +< +Default: 1 + ============================================================================== vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl: diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 23c94f3..a269e5c 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -16,6 +16,7 @@ let g:VimuxTmuxCommand = get(g:, 'VimuxTmuxCommand', 'tmux') let g:VimuxUseNearest = get(g:, 'VimuxUseNearest', v:true) let g:VimuxExpandCommand = get(g:, 'VimuxExpandCommand', v:false) let g:VimuxCloseOnExit = get(g:, 'VimuxCloseOnExit', v:false) +let g:VimuxCommandShell = get(g:, 'VimuxCommandShell', v:true) function! VimuxOption(name) abort return get(b:, a:name, get(g:, a:name)) @@ -175,7 +176,11 @@ endfunction function! VimuxPromptCommand(...) let command = a:0 ==# 1 ? a:1 : '' - let l:command = input(VimuxOption('VimuxPromptString'), command, 'shellcmd') + if VimuxOption('VimuxCommandShell') + let l:command = input(VimuxOption('VimuxPromptString'), command, 'shellcmd') + else + let l:command = input(VimuxOption('VimuxPromptString'), command) + endif if VimuxOption('VimuxExpandCommand') let l:command = join(map(split(l:command, ' '), 'expand(v:val)'), ' ') endif