- 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:
- Go Web編程
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- Twilio Best Practices
- 我的第一本算法書
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- Julia機器學習核心編程:人人可用的高性能科學計算
- 編寫高質量代碼:改善C程序代碼的125個建議
- Instant QlikView 11 Application Development
- Java Web應用開發技術與案例教程(第2版)
- 快速念咒:MySQL入門指南與進階實戰
- TradeStation交易應用實踐:量化方法構建贏家策略(原書第2版)
- 網站構建技術
- Salesforce Reporting and Dashboards
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- Python入門很輕松(微課超值版)