Post - Netrw and Jumps

I want to get away from using splits in vim because largely they are unnecessary and you can’t really look at two things at once.1 So I wanted to limit my split usage to things like commit messages and help menu. I was annoyed when I would open netrw with :Ex and then was not able to jump back to my previous file with <c-o> if I decided not to open a new file.

So here’s the solution. Make a ftplugin/netrw.vim that looks like

noremap <buffer> <C-O> <CMD>e#<CR>

Boom, you can jump back to the file from whence you came.

  1. Yeah the one exception to this is merge conflicts and diffs

    ↩︎