Search code examples
vimvim-plugin

What is NetrwBrowseX and what are the related vim mappings for?


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.


Solution

  • 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)