7

I am just getting into rails.vim as my ROR IDE and I am really liking it. 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)? I'm looking for some functionality like that of CTRL-TAB in visual studio.

Matthew
  • 12,892
  • 6
  • 42
  • 45

2 Answers2

11

This isn't actually related to Rails.vim plugin. Add the following line to your .vimrc file

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.

This is how I've mapped my leader:

let mapleader = ","
Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
Sunny
  • 1,973
  • 2
  • 17
  • 22
2

To go back just hit ctrl+o in command mode, ctrl+i to go forward in opened file history.

Abhishek
  • 6,912
  • 14
  • 59
  • 85
Eugene Petrov
  • 1,578
  • 1
  • 10
  • 22