I am a Solivagant
Lofter    Posts     新文章     文章管理     新日记     日记管理

[Linux] 文档编辑搜索

  

  1. vim filename
  2. press /
  3. type words which you want to search
  4. press Enter

 

Q: How can I search only for word, excluding searches for word1 and word2?

 

A: like this:

/\<word\>

\< means beginning of a word, and \> means the end of a word,

VIM provides a shortcut for this. If you already have word on screen and you want to find other instances of it, you can put the cursor on the word and press '*' to search forward in the file or '#' to search backwards.

 

ref:https://stackoverflow.com/questions/458915/searching-word-in-vim 

posted @ 2018-07-19 15:31  宛如ZZ  阅读(403)  评论(0编辑  收藏  举报