Git Product home page Git Product logo

Comments (3)

fidgetingbits avatar fidgetingbits commented on June 24, 2024 1

I think it should be easy to implement as long as we have a way to open the default browser that works on linux/windows/osx.

Maybe using something like https://github.com/chrishrb/gx.nvim?

The gx mapping is already a default builtin that is cross-platform. In t and nt mode we could just have cursorless issue a gx on the target and it's up to the user to manually install gx.nvim or not if they want something fancier. Could be listed as a recommended plugin or something.

From :help gx:

gx			Opens the current filepath or URL (decided by
			|<cfile>|, 'isfname') at cursor using the system
			default handler, by calling |vim.ui.open()|.

							*v_gx*
{Visual}gx		Opens the selected text using the system default
			handler, by calling |vim.ui.open()|.

From :help vim.ui.open():

vim.ui.open({path})                                            *vim.ui.open()*
    Opens `path` with the system default handler (macOS `open`, Windows
    `explorer.exe`, Linux `xdg-open`, …), or returns (but does not show) an
    error message on failure.

    Expands "~/" and environment variables in filesystem paths.

    Examples: >lua
        -- Asynchronous.
        vim.ui.open("https://neovim.io/")
        vim.ui.open("~/path/to/file")
        -- Synchronous (wait until the process exits).
        local cmd, err = vim.ui.open("$VIMRUNTIME")
        if cmd then
          cmd:wait()
        end
<

    Parameters: ~
      • {path}  (`string`) Path or URL to open

    Return (multiple): ~
        (`vim.SystemObj?`) Command object, or nil if not found.
        (`string?`) Error message on failure, or nil on success.

    See also: ~
      • |vim.system()|

For being able to jump to definition (which is outside the scope of terminal side I think?) you'd have to do some more complicated target pre-parsing to see if it is a URL, path, or a follow-able symbol I guess.

from cursorless.

pokey avatar pokey commented on June 24, 2024

note that it should also jump to definition if you use it to target an identifier

from cursorless.

saidelike avatar saidelike commented on June 24, 2024

I think it should be easy to implement as long as we have a way to open the default browser that works on linux/windows/osx.

Maybe using something like https://github.com/chrishrb/gx.nvim?

from cursorless.

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.