If I search for 'string'; I want to find exactly 'string' as a word; and not 'qstring', 'sostring' etc.
Here are the options in my .vimrc
set ic
set showmatch
set smartcase
set incsearch
In normal mode, press / to start a search, then type the pattern ( \<i\> ), then press Enter. If you have an example of the word you want to find on screen, you do not need to enter a search pattern. Simply move the cursor anywhere within the word, then press * to search for the next occurrence of that whole word.
To select all in Vim, use ggVG. To go to normal mode, hit the ESC key first. Then, using the gg keys, we'll jump to the beginning of the file. Then, with the V key, enable the visual mode, and last, with the G key, choose from the beginning to the conclusion of the file.
Maybe this regexp will help you: "\<string\>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With