Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

searching in vim editor

Tags:

vim

this is a simple query about the searching in vim editor.

consider that i searched for a string like "str" with

/str

now after this search i wanted to search for "strcat" like

/strcat

but, the point in here is that i dont want to type entire /str again.... just wanted to add the new text to /str. that is when we made the first search we type /str and for the second search i just wanted to type cat for searching the entire /strcat.

can any of you vi guru's tell me if it is possible for us to do some search like this in vi.

thanks in advance

like image 322
kernel_os Avatar asked Feb 27 '26 04:02

kernel_os


1 Answers

The / key begins a search string. up arrow recalls the previous line(s). Therefore,

/ up-arrow cat

will resume your search.

like image 99
Andy Finkenstadt Avatar answered Mar 01 '26 19:03

Andy Finkenstadt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!