0

I list files using vim ., which uses netrw. Then I select two files using md, and open them in diff mode using mf. Now how can I go back to the list of files? I use :q to exit the second file, and :E to list them again, but are there shorter ways? if not how can I define these composition of keys in netrw rc?

1 Answer 1

1

Assuming you meant md to diff, I would do <C-w>o to get back to one window and :Rex (short for :Rexplore) to go to the listing. (Don't use the window command, short for :only, if you have other windows you don't want to close!).

3
  • That is a lot keystroke, I want one key, no command. How can I map these procedure to one key?
    – Ahmad
    Commented Apr 23, 2021 at 15:45
  • I forgot to say thank anywas
    – Ahmad
    Commented Apr 23, 2021 at 15:52
  • 1
    @Ahmad I find it quite short, but if you want to make a mapping you should look at :help :map. Example: nnoremap <leader>r <C-w>o:Rexplore<CR>. Assuming your leader is backslash (the default), press backslash-r.
    – D. Ben Knoble
    Commented Apr 23, 2021 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.