A code search tool similar to ack
and the_silver_searcher(ag)
. It supports multi platforms and multi encodings.
- It searches code about 3–5× faster than
ack
. - It searches code as fast as
the_silver_searcher(ag)
. - It ignores file patterns from your
.gitignore
and.hgignore
. - It searches
UTF-8
,EUC-JP
andShift_JIS
files. - It provides binaries for multi platform (Mac OS X, Windows, Linux).
ack go 6.24s user 1.06s system 99% cpu 7.304 total
ag go 0.88s user 1.39s system 221% cpu 1.027 total
pt go 1.05s user 1.03s system 195% cpu 1.066 total
$ go get github.com/monochromegane/the_platinum_searcher
$ cd $GOPATH/src/github.com/monochromegane/the_platinum_searcher
$ go build -o ../../../../bin/pt
Download from following urls.
- Mac OS X(x86 64bit)
- Mac OS X(x86 32bit)
- Windows(x86 64bit)
- Windows(x86 32bit)
- Linux(x86 64bit)
- Linux(x86 32bit)
$ # Recursively searchs for PATTERN in current directory.
$ pt PATTERN
$ # You can specified PATH and some OPTIONS.
$ pt OPTIONS PATTERN PATH
You can use pt with Unite.vim.
nnoremap <silent> ,g :<C-u>Unite grep:. -buffer-name=search-buffer<CR>
if executable('pt')
let g:unite_source_grep_command = 'pt'
let g:unite_source_grep_default_opts = '--nogroup --nocolor'
let g:unite_source_grep_recursive_opt = ''
endif
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request