Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set the cursor at the end of the string found?

Tags:

vim

search

I'm using VIM 7.1

When I search a string in file, the cursor is moved to the beginning of the string found in the text.

Can the cursor be moved at the end instead of the start of the string ?

String where I'm looking for the search

I want cursor at the g of king when I look for king

  • I tried to go to previous result :N

  • I tried to search with ?

like image 530
Luc M Avatar asked Dec 22 '22 06:12

Luc M


1 Answers

Use /king/e. The e means put the cursor at the end of the match. :help search-offset for more info.

like image 134
Geoff Reedy Avatar answered May 19 '23 15:05

Geoff Reedy