- 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:
- 復雜軟件設計之道:領域驅動設計全面解析與實戰
- Mastering JavaScript Object-Oriented Programming
- React Native Cookbook
- Java技術手冊(原書第7版)
- 編寫整潔的Python代碼(第2版)
- Learning Python Design Patterns(Second Edition)
- 單片機應用技術
- Serverless架構
- 深入淺出Serverless:技術原理與應用實踐
- 機器學習與R語言實戰
- Advanced Express Web Application Development
- C++程序設計教程(第2版)
- Learning Splunk Web Framework
- C++程序設計教程
- Sails.js Essentials