2

I use the following vimrc configuration to navigate between panes:

" easier window navigation
nnoremap <C-j> <C-W><C-J>
nnoremap <C-k> <C-W><C-K>
nnoremap <C-l> <C-W><C-L>
nnoremap <C-h> <C-W><C-H>

This works fine with the exception when I'm in a :Explore window to do some file exploration.

All bindings besides <C-l> still work. But trying to navigate to the right with <C-l> stops working. I than have to use <C-W><C-l> to get out of the pane.

What do I possible have to add or deactivate to make this work?

LeoR
  • 666
  • 1
  • 6
  • 20

1 Answers1

3

As can be seen in :help netrw-browse-maps, the Netrw buffer has its own buffer-local mapping to <C-l> that overrides yours.

You can override Netrw's mapping with :help netrw-usermaps but it is at the cost of losing the ability to refresh the listing:

let g:Netrw_UserMaps = [["<C-l>","MoveCursorToWindowOnTheRight"]]
function! MoveCursorToWindowOnTheRight(islocal)
    return "wincmd l"
endfunction
romainl
  • 186,200
  • 21
  • 280
  • 313
  • Since I do exactly as mentioned in the documentation "One may also refresh a local directory by using ':e .'" (I do have a separate mapping for that), the mentioned solution fixes the problem for me without a loss in perceived functionality. – LeoR Jun 19 '22 at 14:08