简体   繁体   English

使用rails.vim转到上一个文件

[英]Go to last file with rails.vim

I am just getting into rails.vim as my ROR IDE and I am really liking it. 我刚刚进入rails.vim作为我的ROR IDE,我真的很喜欢它。 The only thing I don't know how to do, that I wish I could, is hop back to the last file I was editing. 我唯一不知道怎么做,我希望能做到的,就是回到我正在编辑的最后一个文件。

For example, if I am editing one file, say a view and I use :Rcontroller to hop over the the corresponding controller, is there a way to quickly go back to the model (without :Rmodel )? 例如,如果我正在编辑一个文件,说一个视图,我使用:Rcontroller跳过相应的控制器,有没有办法快速返回到模型(没有:Rmodel )? I'm looking for some functionality like that of CTRL-TAB in visual studio. 我正在寻找像Visual Studio中的CTRL-TAB一样的功能。

This isn't actually related to Rails.vim plugin. 这实际上与Rails.vim插件无关。 Add the following line to your .vimrc file .vimrc添加到.vimrc文件中

map <Leader>p <C-^> " Go to previous file

Assuming <Leader> is mapped to , then you can just press ,p to go to the previous file. 假设<Leader>映射到,则可以按,p转到上一个文件。

This is how I've mapped my leader: 这就是我如何映射我的领导者:

let mapleader = ","

要返回只需在命令模式下按ctrl + octrl + i将在打开的文件历史记录中前进。

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

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