Since you said you're learning vim, I'd point you to learn your way through autocmd
. Take a look at this.
I myself am pretty beginner at vimming, so if the solution doesn't work don't think you couldn't pull it off, it's probably because my solution is wrong. But try this anyway.
Put these lines in your .vimrc
:
augroup FiletypeSpecificMappings
autocmd FileType netrw noremap <buffer> j j
autocmd FileType netrw noremap <buffer> k k
autocmd FileType netrw noremap <buffer> h h
autocmd FileType netrw noremap <buffer> l l
augroup END
Here if netrw
is opened its local buffer will have the above key mappings, not any other buffers. I searched for ways to compress these four lines into one but couldn't find any.