Giter Club home page Giter Club logo

gx.nvim's People

Contributors

chemiseblanc avatar chrishrb avatar christianmoesl avatar ckolkey avatar dsully avatar fbuchlak avatar jockem avatar jstnas avatar leiserfg avatar mawkler avatar piersolenski avatar reegnz avatar snelling-a avatar sportshead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gx.nvim's Issues

Weird text after gx

Not sure what is happening but when I press gx over any link I'm getting this thing on my screen:
image

[Feature Request] Open multiple links when in visual selection mode

It'd be awesome if gx.nvim supported a way to open multiple links when using visual selection.

When you select 5 links, open all 5. I haven't yet thought about if it should open only if each line contains only a link, or to try and find all the links in all the text (as in, if links are between text).

https://mylink1.com
https://mylink2.com
https://mylink3.com
https://mylink4.com

vs

Hello and welcome to https://mylink1.com. Here you will find some good stuff. https://mylink2.com
At our HQ website, https://mylink3.com, We welcome any new visitors with a registration step redirect to https://mylink4.com

Regards,

Add Option to Keep Focus on Neovim

With netrw gx, following an internet url, the new window doesn't get focused but with this plugin it does. Would like an option to not lose focus of neovim and manually navigate to the internet window.

Allow selecting handler if there are multiple handlers matching

Right now the first handler that matches in the handlers table is accepted and no other handlers are evaluated.
There might be some cases where there's overlap between handlers and multiple handlers are capable of handling a URL.

The https://github.com/rmagatti/gx-extended.nvim plugin handled this by presenting the user with a popup where you could select which handler you'd want to use if there's multiple matches.

Would be great if this feature could be adopted.

[feature request] add jump to file

thanks for your useful plugin first! Nowadays I encounter this situation

Error: error occured in dts build
    at Worker.<anonymous> (/Users/shellraining/Documents/learnsth/vitepress/sugar-blog/node_modules/.pnpm/[email protected][email protected]/node_modules/tsup/dist/index.js:2294:26)

when I press gf, it not jump beacuse :2294:26, can you enhance this plugin to support?

Handler for Rust's Cargo

Similar to package.json it would be nice to support Ruts's cargo dependencies. Opening in either crates.io or docs.rs

Encoded square brackets don't seem to be recognized as part of a URL

When I push a new branch to a repo from nvim's terminal emulator, git gives me a URL to create an MR:

To create a merge request for <branch-name>, visit:
  https://company.example.com/team-name/repo-name/-/merge_requests/new?merge_request%5Bsource_branch%5D=branch-name

If I manually copy-paste the link into my browser the %5B and %5D get replaced by [ and ] respectively. But if I use gx.nvim to open the link the URL seems to get cut off before the first square bracket. To use the example above, this is what opens in the browser:

https://company.example.com/team-name/repo-name/-/merge_requests/new?merge_request

Markdown links only open if the cursor is on the url itself

I'm not sure if this is intentional, but currently markdown links only open if the cursor is over the url itself, rather than if it is anywhere within the boundaries of the markdown link syntax. It would be awesome if you could open the link wherever the cursor is placed, especially for longer worded links, and with url concealing being a feature!

[gx does nothing here](https://www.gx-works-here.com/).

gx.nvim doesn't respect fragments in URLs

Whenever you try to open a URL with a fragment (a hash sign #) gx.nvim opens it without the fragment in it.

Here's an example for clarity:

A URL like:
https://flask.palletsprojects.com/en/2.2.x/testing/#tests-that-depend-on-an-active-context

gx.nvim opens as:
https://flask.palletsprojects.com/en/2.2.x/testing/

bug: github handler doesn't handle `org/repo#issue`

Opening a github url like org/repo#issue instead tries to open the current git remote URL (and fails due to #45).
for example:

> git remote -v
origin  https://github.com/sindrets/diffview.nvim.git (fetch) [blob:none]
origin  https://github.com/sindrets/diffview.nvim.git (push)

pressing gx on neovim/neovim#23943 results in the choice between searching the string or opening
https://github.com/sindrets/diffview.nvim.git (fetch)/issues/23943

Instead, this should open https://github.com/neovim/neovim/issues/23943

fugitive compatibility

gx replaces Netrw very nicely, but fugitive uses it for opening github in the browser. Fortunately, it can also use a :Browse <url> command, so exposing one will fix the problem.

detach browser process

Thank you for the awesome plugin. I use surf browser. It launches a new browser on each xdg-open and plenary throws error 'xdg-open ...' was unable to complete in 5000 ms. I would like to get rid of this message. Should I maybe somehow modify application entry to detach xdg-open?
My configuration of the plugin is basically default:

{
	"chrishrb/gx.nvim",
	keys = { { "gx", "<cmd>Browse<cr>", mode = { "n", "x" } } },
	cmd = { "Browse" },
	init = function ()
		vim.g.netrw_nogx = 1
	end,
	dependencies = { 'nvim-lua/plenary.nvim' },
	opts = {
		handler_options = {
			search_engine = "https://search.disroot.org/?q=",
		},
	},
}

Allow custom keymap

Right now it's hardcoded to gx, but I use mini.nvim which by default binds gx to exchanging text objects. I can remap its gx, but I find that I used that much more than opening links, so I'd like to keep it and just remap this to gX or something else instead.

'gx' blocks NeoVim on Linux

On Linux, the standard behaviour of xdg-open is to block, which means that when gx.nvim uses os.execute to call this and open a URL, the whole of the NeoVim interface blocks. This is actually quite annoying if you're for example looking up a URL to copy some text into it, or compare with a file, or somesuch. (On Mac, this doesn't happen).

You might instead want to consider using vim.fn.jobstart to run the process, with detach = true, which, although xdg-open will block, won't block NeoVim itself by running it in the background. This is what I did in my own config for gx until recently when gx.nvim came along. You can find an example of how I implemented it here: https://github.com/andrewferrier/dotfiles/blob/6e8e16c6faa6f3a3f5789e03d30c2e8efa254063/common/.config/nvim/plugin/improve-gx.lua#L5 (ignore the open-file script, that's a wrapper I have around opening files/URLs - imagine it's xdg-open instead).

Really enjoying using gx.nvim, thanks for the great plugin!

Support for Mac Deep links

Hi, I have a use case that I can't find in the documentation or in the issues:

Support for Mac Deep links like message:%3C....%3E.

Have you in program to support them?

I'm trying the plugin, and it works like a charm for all the rest ๐Ÿ’š.
Thank you!

bug: git handler does not remove `.git` from the end of https urls

When I do gx on a comment like -- Fixes 42, the plugin tries to open https://github.com/sportshead/init.lua.git/issues/42, which is a 404. I have my remotes set like this:

$ git remote -v
origin	https://github.com/sportshead/init.lua.git (fetch)
origin	https://github.com/sportshead/init.lua.git (push)

It seems like the regex for http urls is a bit broad:

local _, _, url = string.find(result[1], "origin\t(.*)%s")

A regex like ^origin\t(.*)(%.git)? would probably work better for this.

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.