If I am searching for a word inside a file, if I do not hit ENTER after the search pattern, my vi loses the current match and jumps back to where it was.
I have
set hlsearch
set incsearch
in .vimrc
.
Therefore, the moment I start typing word
, vi jumps to the first occurrence and highlights that. However, this tricks me into believing that it really jumped there, so almost by instinct, I hit ESC and do whatever I was supposed to do at that point.
But that cancels my search and puts me back to where I was, which I find slightly annoying.
Can I make vi to jump there right away?
I have not yet thought through if this could have other less agreeable consequences... But I am willing to find out if it's possible.
/
is essentially an ex-command, which requires Enter to terminate. If you turn offincsearch
the behavior is perhaps more intuitive (Enter to move), though of courseincsearch
is quite handy, tooincsearch
- I just only recently enabled it. Without it, as you are suggesting, the default behavior seems rather transparent and indeed intuitive.