pt is a code search tool similar to ack and the_silver_searcher(ag). It supports multi platforms and multi encodings.
特点
- 它搜索代码的速度是 ack 的3-5倍;
- 它搜索代码的速度和 ag 一样快;
- 它忽略 .gitignore 中定义的文件;
- 它搜索 UTF-8,EUC-JP,Shift_JIS 文件;
- 提供多个操作系统平台的运行文件(macOS,Windows,Linux);
速度
ack < ag < pt
安装
- 点击这里 下载所需的二进制执行文件;
- 将可执行文件的目录加入 PATH 环境变量;
- emacs 从 MELPA 安装 pt.el;
- spacemacs 在 dotspacemacs-additional-packages 配置中增加 pt;
使用
命令行
1
2
3
4
5$ # Recursively searches for PATTERN in current directory.
$ pt PATTERN
$ # You can specify PATH and some OPTIONS.
$ pt OPTIONS PATTERN PATHspacemacs
M-x pt-regexp or M-x projectile-pt