I'm trying to bind the key
^ so that it runs
^ in normal mode by default, but calls the function bound to
- in netrw.
- is bound to
netrw.vim, definition here .
Here's my first attempt to bind
nnoremap <expr> ^ &ft ==? "netrw" ? "-" : "^"
This snippet will correctly detect whether the current buffer is a netrw view or not, but calls the ordinary
- command, which moves to the first non-whitespace character of the previous line.
How do I call the plugin's function directly? In the definition I linked it's script-local, so I'm not sure how get a reference to it.
The motivation for this is that I use
= to scroll pagewise, and so I need to shift around the default netrw bindings so they don't conflict.
nnoremap - <c-d> nnoremap = <c-u>