You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,15 @@
8
8
9
9
-**Open files in the browser**: Quickly open the current file in your remote Git repository's web interface.
10
10
-**Line and Range Support**: Supports opening specific lines or ranges, including multiline selections from visual mode.
11
+
-**Right-Click Menu**: Optional context menu with all browsher actions (requires [nvzone/menu](https://github.com/nvzone/menu)).
11
12
-**Customizable providers**: Support for GitHub, GitLab, Sourcehut, and the ability to specify custom git web interfaces.
12
13
-**Custom open commands**: Specify custom commands to open URLs (e.g., use a specific browser).
13
14
14
15
# 📦 Installation
15
16
Using [lazy.nvim](https://github.com/folke/lazy.nvim)
16
17
18
+
## Basic Installation
19
+
17
20
```lua
18
21
{
19
22
'claydugo/browsher.nvim',
@@ -24,6 +27,35 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim)
24
27
end
25
28
}
26
29
```
30
+
31
+
## Installation with Right-Click Menu
32
+
33
+
For a full-featured right-click menu interface, install [nvzone/menu](https://github.com/nvzone/menu) separately and enable the menu feature:
34
+
35
+
```lua
36
+
-- Add menu dependencies (optional)
37
+
{ "nvzone/volt", lazy=true },
38
+
{ "nvzone/menu", lazy=true },
39
+
40
+
-- Configure browsher with menu enabled
41
+
{
42
+
'claydugo/browsher.nvim',
43
+
event="VeryLazy",
44
+
config=function()
45
+
require('browsher').setup({
46
+
enable_menu=true,
47
+
menu_keybindings= {
48
+
keyboard="<leader>bm", -- Open menu with keyboard
49
+
mouse=true, -- Enable right-click menu
50
+
},
51
+
})
52
+
end
53
+
}
54
+
```
55
+
56
+
> [!NOTE]
57
+
> The menu feature is completely optional. If `enable_menu = true` but the menu dependencies aren't installed, browsher will display a warning and continue working normally with the standard command interface.
58
+
27
59
> [!IMPORTANT]
28
60
> Please submit a Pull Request and add to this section if you have worked through installation instructions for other plugin managers!
Use the `:Browsher` command to open the current file in your browser:
110
153
111
154
```
@@ -159,6 +202,27 @@ Select lines in visual mode and run:
159
202
:Browsher
160
203
```
161
204
205
+
## Right-Click Menu
206
+
207
+
When the menu feature is enabled, you can:
208
+
209
+
- Press `<leader>bm` (or your custom keyboard binding) to open the menu in normal or visual mode
210
+
-**Visual mode**: Select lines and right-click to open the context menu with selection-specific options
211
+
212
+
The menu provides these options:
213
+
214
+
-**📍 Open at Commit** - Submenu with HEAD, HEAD~1, HEAD~2, etc. (up to HEAD~5)
215
+
-**🌿 Open at Branch** - Open file at current branch
216
+
-**🏷️ Open at Latest Tag** - Open file at latest tag
217
+
-**🏠 Open Repository Root** - Open repository homepage
218
+
-**📋 Copy URL (Commit)** - Submenu to copy URL for specific commits
219
+
-**📋 Copy URL (Branch)** - Copy branch URL to clipboard
220
+
221
+
Navigation:
222
+
-`h` and `l` - Move between windows
223
+
-`q` - Close menu
224
+
- Press keybind or scroll and press Enter to execute
225
+
162
226
# ⚠️ Notes
163
227
164
228
***Uncommitted Changes**: If the current file has uncommitted changes, line numbers may not correspond to what's on the remote repository. By default, line numbers are omitted when there are uncommitted changes unless `allow_line_numbers_with_uncommitted_changes` is set to true.
0 commit comments