End a vim command history search without using direction keys

Is there an option to automatically end a command currently entered with one of the history, without using the direction keys? This is the extension for this question: How do I search the history of vim commands? .

The answer was after entering :somecommand to use the <up> key. I would think that more vim-like you don’t need to raise your hand to go to the direction keys.

From :help cmdline-completion I tried, Ctrl-N , Ctrl-P , Ctrl-D , Ctrl- L without success. Here may be a related part of my vimrc.

 set completeopt=menu,longest,preview set showcmd set wildchar=<Tab> wildmenu wildmode=longest,list,full set wildcharm=<CZ> 

I know the command prompt window, called with q: or :Ctrl-F , and Ctrl-N and Ctrl-P - linearly, after entering :

+4
source share
1 answer

You can always match this with something. I once tried to use

 cnoremap <Cp> <Up> 

but this will disable the cyclization of completion, so it’s better to print something else (there is no way how pumvisible() can determine whether completion will be active in command mode).

+2
source

All Articles