Configure gitbrowse correctly (add keybindings)
This commit is contained in:
parent
47863ba002
commit
a18ba1da61
1 changed files with 31 additions and 9 deletions
|
|
@ -1,17 +1,39 @@
|
|||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
'folke/snacks.nvim',
|
||||
opts = {
|
||||
gitbrowse = {
|
||||
config = function(opts, defaults)
|
||||
opts.url_patterns["bitbucket%.org"] = {
|
||||
branch = "/src/{branch}",
|
||||
file = "/src/{branch}/{file}#lines-{line_start}:{line_end}",
|
||||
permalink = "/src/{commit}/{file}#lines-{line_start}:{line_end}",
|
||||
commit = "/commits/{commit}",
|
||||
}
|
||||
opts.what = "permalink"
|
||||
url_patterns = {
|
||||
['bitbucket%.org'] = {
|
||||
branch = '/src/{branch}',
|
||||
file = '/src/{branch}/{file}#lines-{line_start}:{line_end}',
|
||||
permalink = '/src/{commit}/{file}#lines-{line_start}:{line_end}',
|
||||
commit = '/commits/{commit}',
|
||||
},
|
||||
},
|
||||
what = 'permalink',
|
||||
},
|
||||
},
|
||||
|
||||
keys = {
|
||||
{
|
||||
'<leader>gB',
|
||||
function()
|
||||
Snacks.gitbrowse()
|
||||
end,
|
||||
desc = '[B]rowse Git URL',
|
||||
},
|
||||
{
|
||||
'<leader>gY',
|
||||
function()
|
||||
Snacks.gitbrowse {
|
||||
open = function(url)
|
||||
vim.fn.setreg('+', url)
|
||||
end,
|
||||
notify = false,
|
||||
}
|
||||
end,
|
||||
desc = '[Y]ank Git URL',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue