- Mastering Vim
- Ruslan Osipov
- 199字
- 2021-06-10 18:51:31
ack
On Linux, you can use Vim in conjunction with ack to search through code bases. ack is the spiritual successor of grep, and is focused on working with code. Install it using your favorite package manager; here's an example of using apt-get:
$ sudo apt-get install ack-grep
For example, you can now use ack from the command line to search for all Python files recursively (starting in the current directory) containing the word Animal:
$ ack --python Animal
The preceding code will produce output similar to grep:
Vim has a plugin that integrates the result of ack in Vim's quickfix window (see the Quickfix List section in Chapter 5, Build, Test, and Execute, to learn more about quickfix). The plugin is available from https://github.com/mileszs/ack.vim. After installation, you will be able to execute :Ack from Vim:
:Ack --python Animal
This will run ack and populate the quickfix window (see the preceding section, as well as Quickfix List in Chapter 5, Build, Test, and Execute, for more information about a quickfix window) with the output:
- 深入核心的敏捷開發:ThoughtWorks五大關鍵實踐
- 精通JavaScript+jQuery:100%動態網頁設計密碼
- 造個小程序:與微信一起干件正經事兒
- Learn Programming in Python with Cody Jackson
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Learning Salesforce Einstein
- 劍指大數據:企業級數據倉庫項目實戰(在線教育版)
- SQL 經典實例
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Java EE 程序設計
- Server Side development with Node.js and Koa.js Quick Start Guide
- Mathematica Data Visualization
- Java程序員面試筆試真題庫
- 數據結構和算法(Python和C++語言描述)
- Visual Basic從入門到精通(第5版)