Timur Fayzrakhmanov
Timur Fayzrakhmanov

Reputation: 19577

How to go back into previously visited folder in vim :Explore?

Sometimes I need to go back into previously visited folder (not a parent folder), let's take example:

:Explore
# we at /home/project
../
./
foo/
bar/
file

# now I press -, hence go to the parent directory /home

../
./
project/

# now I press - again, hence go to the root /

../
./
bin/
boot/
etc

# and here is the question..

How to go back into initial project/ directory. I expected something like bb where b is go back to the previous state. Is the way to do it?

Upvotes: 1

Views: 201

Answers (1)

FDinoff
FDinoff

Reputation: 31419

One of the standard ways of jumping around in vim is with the jump list. From :h jumplist

                                                        jumplist
Jumps are remembered in a jump list.  With the CTRL-O and CTRL-I command you
can go to cursor positions before older jumps, and back again.  Thus you can
move up and down the list.

I recommend reading the whole section to learn more.

For your use case using <c-o> should bring you back to the previous buffer in netrw.

Upvotes: 2

Related Questions