52
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

macにctagsインストールして、vimでRailsのソースコード読む

インストール

$ brew install ctags

そのままだと動かないので、aliasはる
参考: https://gist.github.com/nazgob/1570678

.bashrc
alias ctags="`brew --prefix`/bin/ctags"
$ . ~/.bashrc

railsアプリのルートでタグ作成
参考: http://qiita.com/joker1007/items/9c114a37560d6a29fe81

$ ctags --langmap=RUBY:.rb --exclude="*.js"  --exclude=".git*" -R .

準備完了。後はvimで

# ジャンプしたい箇所にカーソルを当てて
Ctrl + ]

# 戻る
Ctrl + t

# 該当結果が複数ある場合に、リスト表示
:tjump

# 明示してジャンプ(例:Userモデルにジャンプ)
:tag User
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
52
Help us understand the problem. What are the problem?