简体   繁体   English

在新的 window 中打开 rails.vim 相关文件

[英]Opening a rails.vim related file in a new window

I like rails.vim support for going to the corresponding file.我喜欢 rails.vim 支持转到相应的文件。 For example, if I'm in the Product model, I can type :Econtroller to open the ProductsController in the same window.例如,如果我在 Product model 中,我可以键入:Econtroller以打开相同 window 中的 ProductsController。

I want to open the controller in either a newly created window or else in a different, but existing window.我想在新创建的 window 或不同但现有的 window 中打开 controller。

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.例如,要打开一个文件,您可以输入:e filename以在相同的 window 中打开,并输入:sp filename以在新的 window 中打开。 I want the :sp version of :Econtroller , etc.我想要:sp版本的:Econtroller等。

Instead of :Econtroller type :EScontroller to open in a new split.而不是:Econtroller类型:EScontroller在新拆分中打开。 There are several more commands in the docs.文档中有更多命令。

After checking the third time, I found the answer in plain sight in the docs .第三次检查后,我在docs中一目了然地找到了答案。 see :help rails-type-navigation请参阅:help rails-type-navigation

You can use the mapping defined by the plugin.您可以使用插件定义的映射。 In particular to open a new window, you can use ctrl w + f .特别要开一个新的window,可以使用ctrl w + f See:help rails-gf for docs.有关文档,请参阅:help rails-gf。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM