https://github.com/johnsaigle/github-permalink.nvim
Highlight specific line ranges, generate GitHub permalink.
https://github.com/johnsaigle/github-permalink.nvim
github neovim nvim vim
Last synced: 9 months ago
JSON representation
Highlight specific line ranges, generate GitHub permalink.
- Host: GitHub
- URL: https://github.com/johnsaigle/github-permalink.nvim
- Owner: johnsaigle
- Archived: true
- Created: 2025-01-14T16:51:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-28T20:47:47.000Z (over 1 year ago)
- Last Synced: 2025-10-04T01:37:54.329Z (9 months ago)
- Topics: github, neovim, nvim, vim
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-permalink.nvim
A Neovim plugin that generates GitHub permalinks from your visual selections. Select code in your editor and quickly create shareable GitHub links that highlight specific line ranges.
## Installation
Using [lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
{
'johnsaigle/github-link.nvim',
}
```
## Usage
1. Select lines in visual mode
2. Run `:GitHubPermalink`
3. A GitHub permalink will be copied to your clipboard in the format:
`https://github.com/org/repo/blob/commit-hash/path/to/file#L1-L5`
### Configuring a keymap
```lua
require('github-permalink').setup({})
-- Using clears the highlight after generating the link.
vim.keymap.set("x", "gl", ":GitHubPermalink", { desc = "[G]itHub Perma[L]ink"})
```