Select Word Vim - And i can use ? You should see the selected text highlighted. /\<<strong>word</strong>\> \< means beginning of a word, and \> means the end of a word, adding @roe's comment: Vim provides a shortcut for this. I'm aware that i can use / followed by a regex to search something. Asked 14 years, 7 months ago. There are three ways that you can select text: And i can use n and n to repeat the search forward and backward. Web when you combine it with :h expand() it allows you to get the word under your cursor. Web in vim, viw (view inside word) enters visual mode and selects the word under the cursor, though in vi typical usage pattern, you'd rather do things like diw (delete inside word), or ciw (change inside word) to change it rather than first select it and do something on it.
Suppose we want to select a word without surrounding white spaces, use the text object iw for inner word using visual mode: Asked 14 years, 7 months ago. Change w to w to switch to whitespace delimited words, i to a ( view a. Web in vim, viw (view inside word) enters visual mode and selects the word under the cursor, though in vi typical usage pattern, you'd rather do things like diw (delete inside word), or ciw (change inside word) to change it rather than first select it and do something on it. You can try this command to understand how it works::echo expand('') Web when you combine it with :h expand() it allows you to get the word under your cursor. /\<<strong>word</strong>\> \< means beginning of a word, and \> means the end of a word, adding @roe's comment: And i can use n and n to repeat the search forward and backward. You should see the selected text highlighted. And i can use ? Get out of insert mode, hit one of the options below, and then move up or down a few lines. Modified 2 years, 7 months ago. There are three ways that you can select text: Web how to search for selected text in vim? Vim provides a shortcut for this. I'm aware that i can use / followed by a regex to search something. Understanding the above vim tip. Got to normal mode by pressing esc. This will select the inner word. Type viw at the beginning of a word.