Giter Club home page Giter Club logo

Comments (9)

kristijanhusak avatar kristijanhusak commented on April 28, 2024 2

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

from nvim-tree.lua.

stsewd avatar stsewd commented on April 28, 2024 1

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.

from nvim-tree.lua.

kyazdani42 avatar kyazdani42 commented on April 28, 2024

well netrw opens automatically and it can conflict with other trees. I'll try and see if i can come up with a solution.

from nvim-tree.lua.

kyazdani42 avatar kyazdani42 commented on April 28, 2024

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

from nvim-tree.lua.

stsewd avatar stsewd commented on April 28, 2024

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.

from nvim-tree.lua.

kyazdani42 avatar kyazdani42 commented on April 28, 2024

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 ?

from nvim-tree.lua.

stsewd avatar stsewd commented on April 28, 2024

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.

from nvim-tree.lua.

kyazdani42 avatar kyazdani42 commented on April 28, 2024

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.

from nvim-tree.lua.

kyazdani42 avatar kyazdani42 commented on April 28, 2024

i'll add that then :)

from nvim-tree.lua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.