Wednesday, October 9, 2013

Re: Access recent searches when in command mode

>I do a lot of pattern-matching searches using the / search command. Then when I've settled on the correct regular expression that grabs just the right group of characters I want, I go :s/ to start a substitution command. Now I'm in the middle of the substitution command and I have to re-enter my complex regular expression that's in my search history from before. Is there an easy way to yank it so Ii don't to re-type it?

This is my solution (in ~/.vimrc):

" Switch between command line commands
cmap <silent> <c-g> <c-f>:call cmdline#switch('g')<cr>

defined in:
https://github.com/kurkale6ka/vim/blob/master/autoload/cmdline.vim

Dimitar Dimitrov

No comments: