Is there a reason why netrw is being disabled? gx doesn't work without it in other buffers.
well netrw opens automatically and it can conflict with other trees. I'll try and see if i can come up with a solution.
Well i'm sorry but i cannot enable the netrw, i don't really use the gx option, if you really want to use it in other buffers, feel free to implement it :) I have to disable netrw because i really have no use for it and its conflicting a lot with my workflow
Can we at least have an option for it? And btw, I'm writing a plugin to replace gx https://github.com/stsewd/gx-extended.vim if someone hits this, you can just install that plugin and gx should work just as the original gx in most cases.
if you do not disable netrw then it will open every time you do vim $DIR which will not be convenient at all. What would be your use cases to keep netrw ?
Mainly just to keep the original gx working. I don't use vim $DIR, so I'm fine if that doesn't work when enabling netrw.
well you can patch it locally if you want, but it seems weird to me that a tree viewer provides that kind of feature anyway. You could provide a global mapper with your gx plugin and not depend on the gx behaviour of netrw which would seem more adapted imo.
My plugin already maps gx globally, so I shouldn't need the original gx in most cases. But I think this should be mentioned in the docs at least, so users don't get a surprise when trying to use gx outside the tree.
i'll add that then :)
Here's a mapping that will load netrw only on demand when using gx:
nnoremap gx :call <sid>open_url()<CR>
function! s:open_url() abort
unlet! g:loaded_netrw
unlet! g:loaded_netrwPlugin
runtime! plugin/netrwPlugin.vim
return netrw#BrowseX(expand('<cfile>'), netrw#CheckIfRemote())
endfunction
Most helpful comment
Here's a mapping that will load netrw only on demand when using gx: