Skip to main content
Add augroup for the autocommads
Source Link
3N4N
  • 5.9k
  • 1
  • 21
  • 49

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.

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 :

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

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.

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.

fixed grammar
Source Link
3N4N
  • 5.9k
  • 1
  • 21
  • 49

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 :

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

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. If anyone did please leave some reference here.

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 my solution is wrong. But try this anyway.

Put these lines in your .vimrc :

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

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. If anyone did please leave some reference here.

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 :

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

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.

Source Link
3N4N
  • 5.9k
  • 1
  • 21
  • 49

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 my solution is wrong. But try this anyway.

Put these lines in your .vimrc :

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

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. If anyone did please leave some reference here.