Set up lazygit integration
This commit is contained in:
parent
a18ba1da61
commit
cc74b77c17
3 changed files with 17 additions and 0 deletions
54
home/dot_config/nvim/lua/custom/plugins/snacks.lua
Normal file
54
home/dot_config/nvim/lua/custom/plugins/snacks.lua
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
return {
|
||||
{
|
||||
'folke/snacks.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
opts = {
|
||||
gitbrowse = {
|
||||
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',
|
||||
},
|
||||
lazygit = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
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',
|
||||
},
|
||||
{
|
||||
'<leader>gg',
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = 'Lazy[g]it (Root Dir)',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
Loading…
Add table
Add a link
Reference in a new issue