V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
windcode
V2EX  ›  Neovim

写了一个代码行复制的 NeoVim 插件,用于快速与同事共享代码

  •  
  •   windcode · Jan 8, 2025 · 1448 views
    This topic created in 478 days ago, the information mentioned may be changed or developed.

    最近写了一个实用的 Neovim 插件( copypath.nvim ),解决了开发者常见的痛点:如何快速与同事共享代码位置?

    https://github.com/elliotxx/copypath.nvim

    主要特点:

    • 在 Git 存储库中时,按 Y 复制带有行号的 GitHub/GitLab URL ,例如 https://github.com/user/repo/blob/main/file.lua#L42

    • 回退到 Git 存储库外部的相对路径 + 行号,例如 src/file.lua:42

    • 自动 SSH/HTTPS URL 转换,例如 git@host:org/repo => https://host/org/repo

    使用 lazy.nvim 安装:

    { 'elliotxx/copypath.nvim' }
    
    2 replies    2025-01-22 18:36:19 +08:00
    fang2hou
        1
    fang2hou  
       Jan 22, 2025
    这个功能目前在用 lazy.nvim 作者 folke 的 snacks.nvim

    https://github.com/folke/snacks.nvim/blob/main/docs/gitbrowse.md

    snacks 还能支持 visual 模式的多行 link 复制和直接在浏览器打开。
    windcode
        2
    windcode  
    OP
       Jan 22, 2025
    @houshuu Get ✅ snacks 我也在用,不过没发现这个插件,多谢反馈
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2112 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 00:33 · PVG 08:33 · LAX 17:33 · JFK 20:33
    ♥ Do have faith in what you're doing.