Skip to content

Navigation Menu

Sign in
Sign up

Using vim and vim-rails with Packwerk #422

Unanswered
stuartpalmer asked this question in Q&A
Discussion options

We have started using Packwerk in our project, but now my vim-rails plugin doesn't work very well as it only tracks one pack at a time (e.g. the gf command). Also, my silver searcher (Ag) now has limited usefulness as there are many app and spec directories.

We have one top-level foundation pack (packs/foundation) and a number of other project packs (packs/project_group/project). Has anyone had luck guiding vim as to your directory structure?

You must be logged in to vote

Replies: 1 comment

Comment options

From vim-rails FAQ section:

Can I use rails.vim to edit Rails engines?

It's not supported, but if you touch config/environment.rb in the root of the engine, things should mostly work.

The Rails application detection logic indeed relies on the file to exist. Following Tim's answer above, in a Rails app with a bunch of top-level packs, I created a blank config/environment.rb file in a pack and changed directory to the pack before starting vim for different vim-rails commands like :A to work. I wasn't able to get gf to work on a class the pack definitely contained.

Maybe a command to dynamically set the b:rails_root variable depending on the current active buffer could be a workaround?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /