When working with vim, I jump between files with:
What I need is a bit different...
From the file I am in where I jumped to with g-f:
What is the easiest way to reopen the previous file?
All of the mentioned above do not help much if you have lots of changes made since switching files. Jumping back to previous tag will not work either, ofc.
Can any of the gurus here provide me with some insight?
You can return to the previous buffer using Ctrl-^ or Ctrl-o.
More info
Or if you don't want to save your current changes, do a :tabnew
and "2Ctrl-o".
ctrl-^ (or ctrl-shift-6 on U.S. keyboard layout.) is actually the shortcut for :e#
.
See :h alternate-file
or :h ctrl-^
for further info.
This makes it possible to swap between the two most recently edited files with the same command, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With