3

I remapped my hjkl keys to ijkl, but in netrw, "i" switches view styles.

How to change this? Is it possible to change this?

4

If you want your cursor to move left when pressing i in the built-in file browser netrw, then try adding the following code in your $MYVIMRC file :

augroup netrw_mapping
    autocmd!
    autocmd filetype netrw call NetrwMapping()
augroup END

function! NetrwMapping()
    noremap <buffer> i h
endfunction

The reason why your custom mapping didn't have the expected result, is probably because netrw set up mappings that are local to the buffer (using the <buffer> option), which means they override your global mappings.

The previous code adds an autocommand that automatically calls a function whenever you enter a buffer whose filetype is netrw. The function then sets up your mapping using the <buffer> option, which means it should be able to override the local mapping previously done by netrw.

I found the workaround from this post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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