How can I search a word after selecting it in visual mode in Vim?

后端 未结 4 640
遇见更好的自我
遇见更好的自我 2021-01-26 02:22

Suppose I have selected a word in visual mode. Now I want to search that word in the document.

How can I do that?

Thanks in advance.

4条回答
  •  失恋的感觉
    2021-01-26 02:35

    If it's just a single word, you don't even have to select it. Just place the cursor on the word and press * (or # to search backwards). Note that this search will only match the whole word. To allow a search for foo to match foobar, use g* or g#.

提交回复
热议问题