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?
Add a comment
|
1 Answer
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!).
-
That is a lot keystroke, I want one key, no command. How can I map these procedure to one key?– AhmadCommented Apr 23, 2021 at 15:45
-
-
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