Switch between the current and previous buffer
Pressing control+6
will open the alternate file for editing. The alternate
file will most likely be the previously edited file, or the previously opened
buffer. This makes for a quick and easy way to switch between the current and
previous buffer.
The below mapping will make switching between the current and previous buffer
even faster, simply by pressing space
twice (at least in my case, as my
leader key is set to space
):
nnoremap <silent> <leader><space> <C-6>
The control+6
command is equivalent to :edit #
, where #
is a placeholder
for the file name of the alternate file.