How do I access the alternate file register?
Answer
"# register
Explanation
The # register contains the name of the alternate file — the previously edited file in the current window. You can use it in commands and paste it.
How it works
"#stores the alternate filename"#ppastes the alternate filename<C-r>#inserts it in insert/command mode<C-^>switches to the alternate file
Example
While editing main.go after previously editing utils.go, "#p inserts utils.go.
Tips
:e #opens the alternate file:lsshows#next to the alternate buffer- Useful in scripts and mappings that reference the previous file
<C-^>is the fastest way to toggle between two files- The alternate file is set when you switch buffers