- Mastering Vim
- Ruslan Osipov
- 188字
- 2021-06-10 18:51:31
Searching with / and ?
Most times one of the fastest ways to navigate somewhere is to search for a particular string. Vim allows you to search for a match by typing in / (which puts you in command-line mode) followed by a search string. Once you hit Enter, your cursor will move to the first match.
Cycling through the matches in the same buffer can be done by pressing n to go to the next match and N to the previous match.
A useful option for searching is set hlsearch (consider setting it in your .vimrc file), since it highlights every match on the screen. For example, this is how running /kind in animal_farm.py looks with hlsearch enabled:
You can clear the highlights by executing :noh.
In case you want to search backwards, replace / with ?. This will also affect the way n and N will behave, showing a next backward match, and a previous backward match respectively.
- Mastering Entity Framework Core 2.0
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- Learning Selenium Testing Tools with Python
- Learning Flask Framework
- VSTO開發入門教程
- Java面向對象程序開發及實戰
- Mastering Python High Performance
- Bootstrap 4:Responsive Web Design
- 微信小程序開發解析
- Test-Driven Machine Learning
- QGIS 2 Cookbook
- Learning TypeScript
- LabVIEW數據采集(第2版)
- Learning Puppet
- Python Natural Language Processing