How do I move the cursor just after each search match instead of at match start?
Answer
/pattern/e+1<CR>
Explanation
Most Vim searches place the cursor at the start of the match. For many editing workflows, that is inconvenient: you often want to append text after a token, add punctuation, or trigger a motion relative to the match end. Search offsets let you keep one search pattern but control exactly where the cursor lands.
How it works
/patternperforms a forward search/echanges the cursor target from match start to match end+1moves one character beyond that end position- Combined as
/pattern/e+1, eachnrepeat lands just after the match, ready for append-oriented edits
Example
Given:
item_1 item_2 item_3
Run:
/item_/e+1
The cursor lands immediately after item_ in each match cycle, which is useful when you want to append or tweak the suffix quickly across repeated occurrences.
Tips
- Use
/ewithout+1to land exactly on the final character of the match - Negative offsets are valid too (for example
/pattern/e-2) - This combines well with
cgnand dot-repeat workflows when editing many similar matches