4

I have the following mappings in my .vimrc file that I use to move between windows, but when in an explore window :e of netrw plugin the shift down key will produce a warning window instead of respecting my mappings. I am assuming this mapping must be hard coded into the plugin itself. How can I remove the shift-up and shift-up mappings in the plugin.

nnoremap <silent> <S-Up> :wincmd k<CR>     
nnoremap <silent> <S-Down> :wincmd j<CR>   

The window that shows up when trying to do a shift-up or shift-down is below, which shows up in a new split which is very annoying:

**warning** (netrw) using Nexplore or <s-down> improperly; see help for netrw-starstar

As a result, my question is how can I shut off this behavior in the netrw plugin so that it respects my mappings shown above instead.

1
  • In theory netrw uses mapcheck() to prevent overriding these mappings. However it looks like there must be some type of logic bug because it doesn't seem like it is working as of netrw version 154. Dec 7, 2015 at 17:20

1 Answer 1

5

A buffer map for that is created by the plugin, so you could overwrite it again after created with an autocmd:

autocmd filetype netrw nnoremap <buffer> <s-down> :wincmd j<cr>

If using multiple times, it might be useful to create a group:

augroup netrw_maps
  autocmd!
  autocmd filetype netrw call ApplyNetrwMaps()
augroup END

function ApplyNetrwMaps()
  nnoremap <buffer> <s-up> :wincmd k<cr>
  nnoremap <buffer> <s-down> :wincmd j<cr>
  " ...
endfunction
0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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