コードを読むときに使ってるツール(自分メモ)

自分は ack というツールを使ってる.
URL: http://betterthangrep.com/

$ cd ruby-1.9.3-p194
$ ack require
common.mk
832:       $(srcdir)/lib/rubygems/defaults.rb $(srcdir)/lib/rubygems/custom_require.rb \

cont.c
533: * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
803: *  after having <code>require</code>d <i>continuation</i>. They hold
812: *     require "continuation"
828: *     require "continuation"
853: *  the associated block. You need to <code>require
1375: *  always return false. You need to <code>require 'fiber'</code>
1414: *  <code>Fiber.yield</code>. You need to <code>require 'fiber'</code>
1451: *  Returns the current fiber. You need to <code>require 'fiber'</code>
...

Ubuntu のパッケージで使う場合 ack-grep とか書くことになって面倒なので alias で ack にしてる.それも面倒なので install のページにあるようにインストールしてる.

http://betterthangrep.com/install/

curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 !#:3 

あと vim 内でも使えるように ack.vim とか使ってる.Ubuntu などで apt から入れた場合はREADMEに書いてある通りの設定を .vimrc にもしとく.

https://github.com/mileszs/ack.vim

let g:ackprg="ack-grep -H --nocolor --nogroup --column"

あとは下記にように書けば動く.検索した場所にフォーカスしてくれたりして便利.

:Ack ほげ

以上メモ.