- 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.
- Learning Single:page Web Application Development
- 自制編譯器
- Responsive Web Design with HTML5 and CSS3
- 小程序,巧運(yùn)營(yíng):微信小程序運(yùn)營(yíng)招式大全
- C語(yǔ)言程序設(shè)計(jì)
- C語(yǔ)言程序設(shè)計(jì)
- Android群英傳
- HTML5開發(fā)精要與實(shí)例詳解
- Android Game Programming by Example
- Hacking Android
- jQuery Mobile Web Development Essentials(Second Edition)
- 3D Printing Designs:The Sun Puzzle
- 詩(shī)意的邊緣
- Access 2016數(shù)據(jù)庫(kù)應(yīng)用與開發(fā):實(shí)戰(zhàn)從入門到精通(視頻教學(xué)版)
- Swift從入門到精通 (移動(dòng)開發(fā)叢書)