An open API service indexing awesome lists of open source software.

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.

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"})
```