4
votes

I occasionally like to map vim keys to search and then do something. I've been doing this for decades, but when I do it now, it takes over a second each time I use the mapped key.

I believe the cause is this, response from ":map" in vim:

n  gx            <Plug>NetrwBrowseX
n  <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR>

What are these mappings for, and how can I get rid of them?

The map I'm adding today is

:map g nz.

Simply so every time I find the searched term, it's centered in the screen so I can quickly compare contexts.

1
This looks like a case of recursive vs non-recursive mapping. Could you show us an example of conflicting mapping? - romainl
edited and added, showing the obvious conflict. - Jeff Learman

1 Answers

2
votes

Try nunmap gx.

From the source code netrw.vim:

" s:NetrwBrowseX:  (implements "x") executes a special "viewer" script or program for the {{{2
"              given filename; typically this means given their extension.
"              0=local, 1=remote
fun! netrw#NetrwBrowseX(fname,remote)