SkillAgentSearch skills...

Gitlink.nvim

Goto/Copy File's Online Link

Install / Use

/learn @wsdjeg/Gitlink.nvim
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

gitlink.nvim

A Lua plugin for Neovim to generate and open permalink of current file in browser or copy the link to clipboard.

Run Tests GitHub License GitHub Issues or Pull Requests GitHub commit activity GitHub Release luarocks

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Features

  • 🚀 Generate permalink for current file at current line
  • 📋 Copy link to clipboard
  • 🌐 Open link directly in browser
  • 🔍 Auto-detect Git platform from remote URL
  • 🔗 Support both HTTPS and SSH remote URLs

Requirements

  • Neovim >= 0.10.0
  • Git

Installation

Using lazy.nvim

{
    'wsdjeg/gitlink.nvim',
    keys = {
        { '<leader>gy', function() require('gitlink').copy() end, desc = 'Copy git link' },
        { '<leader>gY', function() require('gitlink').open() end, desc = 'Open git link in browser' },
    },
}

Using nvim-plug

require('plug').add({
    {
        'wsdjeg/gitlink.nvim',
    },
})

Usage

-- Copy git link to clipboard
vim.keymap.set('n', '<leader>gy', function()
    require('gitlink').copy()
end, { silent = true, desc = 'Copy git link' })

-- Open git link in browser
vim.keymap.set('n', '<leader>gY', function()
    require('gitlink').open()
end, { silent = true, desc = 'Open git link in browser' })

| Function | Description | | --------------------------- | --------------------------- | | require('gitlink').copy() | Copy permalink to clipboard | | require('gitlink').open() | Open permalink in browser |

Configuration

require('gitlink').setup()

Supported Platforms

| Platform | URL Format | Custom Domain Support | | --------- | ------------------------------------------ | ------------------------------- | | GitHub | {url}/blob/{commit}/{path}#L{line} | No | | GitLab | {url}/-/blob/{commit}/{path}#L{line} | Yes (matches gitlab. pattern) | | Bitbucket | {url}/src/{commit}/{path}#lines-{line} | No | | Gitee | {url}/blob/{commit}/{path}#L{line} | No | | Codeberg | {url}/src/commit/{commit}/{path}#L{line} | No |

Credits

Self-Promotion

Like this plugin? Star the repository on GitHub.

Love this plugin? Follow me on GitHub.

License

This project is licensed under the GPL-3.0 License.

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated24d ago
Forks0

Languages

Lua

Security Score

85/100

Audited on Mar 5, 2026

No findings