- 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:
- DevOps for Networking
- Raspberry Pi 2 Server Essentials
- Bootstrap 4:Responsive Web Design
- 精通Python設計模式(第2版)
- Linux操作系統基礎案例教程
- PHP 7+MySQL 8動態網站開發從入門到精通(視頻教學版)
- Learning R for Geospatial Analysis
- Scratch趣味編程:陪孩子像搭積木一樣學編程
- Web性能實戰
- OpenCV 3計算機視覺:Python語言實現(原書第2版)
- 寫給大家看的Midjourney設計書
- R的極客理想:量化投資篇
- Visual Basic 程序設計實踐教程
- C語言程序設計教程
- Mastering Object:Oriented Python(Second Edition)