Go to last file with rails.vim

I just fall into rails.vim as my ROR IDE, and I really like it. The only thing I don’t know how to do this, what I would like is to go back to the last file that I edited.

For example, if I edit a single file, say, view, and I use :Rcontroller to jump over the corresponding controller, is there a way to quickly return to the model (without :Rmodel )? I am looking for some features like CTRL-TAB in visual studio.

+7
source share
2 answers

This is actually not related to the Rails.vim plugin. Add the following line to the .vimrc file

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

Assuming the <Leader> maps to <Leader> you can just press ,p to go to the previous file.

Here's how I matched my leader:

 let mapleader = "," 
+11
source

To return, just press ctrl + o in command mode, ctrl + i to go to the open file history.

+2
source

All Articles