浙江省高等学校教师教育理论培训

微信搜索“教师资格证岗前培训”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Search for visually selected text - Vim Tips Wiki

 


Search for visually selected text

 



Edit

 



 


 

Tip 171 Printable Monobook Previous Next

created 2001 · complexity basic · author Raymond Li · version 6.0

 


With this tip, you can select some text, then press a key to search for the next occurrence of the text. Two alternative methods are presented.

Features

  • Press * to search forwards for selected text, or # to search backwards.
  • As normal, press n for next search, or N for previous.
  • Handles multiline selection and search.
  • Whitespace in the selection matches any whitespace when searching (searching for "hello world" will also find "hello" at the end of a line, with "world" at the start of the next line).
  • Each search is placed in the search history allowing you to easily repeat previous searches.
  • No registers are changed.

Place the following mappings in your vimrc:

posted on 2012-04-25 22:37  lexus  阅读(240)  评论(0编辑  收藏  举报