10

I like rails.vim support for going to the corresponding file. For example, if I'm in the Product model, I can type :Econtroller to open the ProductsController in the same window.

I want to open the controller in either a newly created window or else in a different, but existing window.

How would I do that?

For example, to open a file, you can type :e filename to open in the same window and :sp filename to open in a new window. I want the :sp version of :Econtroller, etc.

Kyle Heironimus
  • 7,741
  • 7
  • 39
  • 51

2 Answers2

11

Instead of :Econtroller type :EScontroller to open in a new split. There are several more commands in the docs.

After checking the third time, I found the answer in plain sight in the docs. see :help rails-type-navigation

Kyle Heironimus
  • 7,741
  • 7
  • 39
  • 51
0

You can use the mapping defined by the plugin. In particular to open a new window, you can use ctrlw+f. See :help rails-gf for docs.

lucapette
  • 20,564
  • 6
  • 65
  • 59
  • This works for opening the file under the cursor, but not for opening corresponding files, like :Rcontroller does. However, it did point me back to the docs again, where I found the answer. – Kyle Heironimus Aug 17 '11 at 20:54