How to back to editing file after :Ex

Viewed 79

I'm editing a new file in NeoVim and I don't remember the path of the directory I want to save my file to, so I want to look at the directory tree before saving. I do this by typing :Ex, which takes me to Netrw.

I'm done looking at the directory tree and I want to go back to my file and and finish my work. However I don't know the command to get back from Netrw to the file, and none of the numerous solutions I looked up online worked. The help file didn't help either. The intuitive command would be :q, which works fine for help but doesn't work for this situation. I have also tried q, Q, gq, gQ, :visual and :vi as suggested by people online.

3 Answers

I think you can just press Ctrl-6 to go back to the previous buffer. Also check the nvim help: :help CTRL-6.

You can use those default vim mappings for that:

  • CTRL-O - Go to older cursor position in jump list
  • CTRL-I - Go to newer cursor position in jump list

So when you'll be at netrw press <C-o> couple of times and it will bring you back to the place where you started.

To read more about jump commands: :help jump-motions

Related