From 784b2834c70f2c8c5759a78db7b875cac39c2126 Mon Sep 17 00:00:00 2001 From: jaspertandy Date: Wed, 10 Mar 2021 14:11:59 +0000 Subject: [PATCH 1/3] Preference to allow up-arrow --- plugin/vimux.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 23c94f3..c6cd9c9 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,12 @@ endfunction function! VimuxPromptCommand(...) let command = a:0 ==# 1 ? a:1 : '' - let l:command = input(VimuxOption('VimuxPromptString'), command, 'shellcmd') + if VimuxOption('VimuxCommandShell') + let l:cancelreturn = 'shellcmd' + else + let l:cancelreturn = v:false + endif + let l:command = input(VimuxOption('VimuxPromptString'), command, l:cancelreturn) if VimuxOption('VimuxExpandCommand') let l:command = join(map(split(l:command, ' '), 'expand(v:val)'), ' ') endif From 59b1d28f80e7aa78efc08faad030db4d34befd83 Mon Sep 17 00:00:00 2001 From: jaspertandy Date: Wed, 10 Mar 2021 14:16:02 +0000 Subject: [PATCH 2/3] Needs no argument rather than a blank argument --- plugin/vimux.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index c6cd9c9..a269e5c 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -177,11 +177,10 @@ endfunction function! VimuxPromptCommand(...) let command = a:0 ==# 1 ? a:1 : '' if VimuxOption('VimuxCommandShell') - let l:cancelreturn = 'shellcmd' + let l:command = input(VimuxOption('VimuxPromptString'), command, 'shellcmd') else - let l:cancelreturn = v:false + let l:command = input(VimuxOption('VimuxPromptString'), command) endif - let l:command = input(VimuxOption('VimuxPromptString'), command, l:cancelreturn) if VimuxOption('VimuxExpandCommand') let l:command = join(map(split(l:command, ' '), 'expand(v:val)'), ' ') endif From a70218b30ca9a75268698130bca8c4cfd119b20b Mon Sep 17 00:00:00 2001 From: jaspertandy Date: Thu, 18 Mar 2021 13:47:41 +0000 Subject: [PATCH 3/3] Update documentation for g:VimuxCommandShell --- doc/vimux.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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: