6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

最新vim.railsのコマンドの記述方法

Posted at

これまでは任意のジャンプコマンドについて、以下のように記述することが出来ました。以下は、":Rbbmodel"や":Rbbview"として、backbone.jsのコードへジャンプ出来るようにした例です。

.vimrc
autocmd User Rails Rnavcommand bbmodel app/assets/javascripts/backbone/models -suffix=.js.coffee -glob=*
autocmd User Rails Rnavcommand bbview app/assets/javascripts/backbone/views -suffix=.js.coffee -glob=**/*

2013-04-01リリースの5.0からはrails_projectionsを利用するように変更されてます。
http://www.vim.org/scripts/script.php?script_id=1567

.vimrc
let g:rails_projections = {
        \ "app/assets/javascripts/models/*.js.coffee": {
        \   "command": "bbmodel"},
        \ "app/assets/javascripts/views/**/*.js.coffee": {
        \   "command": "bbview"}
        \ }

ただし、ちょっと試した感じ、上のようにしてもViewsへうまくジャンプ出来ませんでした…。やり方が分かり次第追記したいと思います。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?