This extension provides a convenient interface for finding and executing previous instructions given in the command line.
Is different to what sgur
provides, because this extension respects the order when presenting options, and
it doesn't use :silent
when invoking commands.
Just put the file in the proper autoload
directory, like CtrlP does. Or use a
plugin manager like Pathogen.
To load this extension into ctrlp, add this to your vimrc:
let g:ctrlp_extensions = ['commandline']
If you have other extensions (for example, 'mixed'):
let g:ctrlp_extensions = [
\ 'mixed',
\ 'commandline',
\ ]
You can either run Ctrl-P and switch to command mode, or add the following to your .vimrc
command! CtrlPCommandLine call ctrlp#init(ctrlp#commandline#id())
and use :CtrlPCommandLine
. Alternatively, the following mapping will
replace <C-f>
in command mode:
cnoremap <silent> <C-f> <C-c>:call ctrlp#init(ctrlp#commandline#id())<CR>