https://github.com/delphinus/rtbrowse.nvim
Browse Neovim runtime files on GitHub directly from your editor.
https://github.com/delphinus/rtbrowse.nvim
lua neovim neovim-plugin
Last synced: 29 days ago
JSON representation
Browse Neovim runtime files on GitHub directly from your editor.
- Host: GitHub
- URL: https://github.com/delphinus/rtbrowse.nvim
- Owner: delphinus
- Created: 2025-05-13T08:59:02.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-02T04:48:15.000Z (10 months ago)
- Last Synced: 2025-06-02T14:12:48.679Z (10 months ago)
- Topics: lua, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rtbrowse.nvim
Browse Neovim runtime files on GitHub directly from your editor.
https://github.com/user-attachments/assets/ccad5b02-26a1-46bb-bdbb-a0b1df697b36
## Introduction
**rtbrowse.nvim** is a Neovim plugin that lets you open the corresponding GitHub source page for any Neovim runtime file and line(s) directly from your editor. It is useful for exploring Neovim's source code, referencing documentation, or sharing links to specific lines.
If you use this plugin on files that are not Neovim runtime files, it fallbacks to another action (default: [`Snacks.gitbrowse()`](https://github.com/folke/snacks.nvim/blob/main/docs/gitbrowse.md)). So you can use this plugin without worrying about the file you are viewing.
## Installation
Use your favorite plugin manager. Example for [lazy.nvim](https://github.com/folke/lazy.nvi):
```lua
-- You need no `opts = {}`
{ "delphinus/rtbrowse.nvim" }
```
Or, setup with full configuration. See [doc](doc/rtbrowse.txt) for the detail.
```lua
{
"delphinus/rtbrowse.nvim",
-- You may use this plugin with keymaps.
keys = {
{
"gB",
function() require("rtbrowse").browse() end,
mode = { "n", "x", "o" },
},
},
-- full configuration options
opts = {
fallback = function()
-- custom fallback action
end,
get_commit = "curl", -- or "gh"
},
}
```
## Usage
To open the current runtime file on GitHub:
```vim
:lua require("rtbrowse").browse()
```
- If you have a visual selection, the selected lines will be highlighted in the GitHub link.
- If not, the current line will be used.
Example key mappings:
```vim
nnoremap gB :lua require("rtbrowse").browse()
vnoremap gB :lua require("rtbrowse").browse()
```
If the file is not a Neovim runtime file, a fallback action is triggered.