Unexpected SPACE character while in :Explore when hitting minus key (-) in Neovim

Viewed 95

Whenever I hit the minus key (-) while in :Explore mode to go up dir there seems to be an extra <SPACE> character being added somehow.

The issue comes in when setting <SPACE> to map to <PageDown> which unexpectedly causes navigating up a directory to jump down a page. I've removed everything except :map <Space> <PageDown> from my .vimrc to try to narrow down the issue and to see if a plugin or setting was the cause. I'm using NVIM v0.4.2 installed using Homebrew.

I've used a similar setup on other machines in the past without this behavior and can't seem to pinpoint what I might be doing differently.

Thanks in advance!

1 Answers

Well, that sent me on a merry chase. I could be wrong, but I think there's a bug in netrw:

if !hasmapto('<Plug>NetrwBrowseUpDir')       |nmap <buffer> <silent> <nowait> - <Plug>NetrwBrowseUpDir |endif

See that space prior to |endif? I think that's getting sent along with the plugin command. I'll submit a patch, but in the meantime you could add this to your .nvimrc or init.vim:

nmap - <Plug>NetrwBrowseUpDir

making sure there is no stray space at the end of that line!

Related