Added snacks gitbrowse to open the current file in a github repo (or

copy the url of that)
This commit is contained in:
2025-04-24 13:06:38 +03:00
parent fbbc9cb6d1
commit 81da838549
3 changed files with 32 additions and 3 deletions

View File

@@ -3,6 +3,14 @@ vim.loader.enable()
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
_G.dd = function(...)
Snacks.debug.inspect(...)
end
_G.bt = function()
Snacks.debug.backtrace()
end
vim.print = _G.dd
require('options')
vim.schedule(function()
require('keymaps')

View File

@@ -5,7 +5,7 @@ return {
{ '<leader>gb', '<cmd>Neogit branch<cr>' },
{ '<leader>gs', '<cmd>Neogit<cr>' },
{ '<leader>gL', '<cmd>Neogit log<cr>' },
{ '<leader>gc', '<cmd>Neogit commit<cr>' },
-- { '<leader>gc', '<cmd>Neogit commit<cr>' },
{ '<leader>gp', '<cmd>Neogit push<cr>' },
{ '<leader>gP', '<cmd>Neogit pull<cr>' },
{ '<leader>gr', '<cmd>Neogit rebase<cr>' },

View File

@@ -24,25 +24,46 @@ return {
},
},
keys = {
{
'<leader>go',
function()
Snacks.gitbrowse.open()
end,
desc = '[G]it [O]pen',
},
{
'<leader>gc',
function()
Snacks.gitbrowse.open({
open = function(url)
vim.fn.setreg('+', url)
end,
})
end,
desc = '[G]it [O]pen',
},
{
'<leader>si',
function()
Snacks.image.hover()
end,
desc = '[S]how [I]mage',
},
{
'<leader>nd',
function()
Snacks.notifier.hide()
end,
desc = '[N]otifications [D]ismiss All',
desc = '[N]otification [D]ismiss All',
},
{
'<leader>nh',
function()
Snacks.notifier.show_history()
end,
desc = '[N]otifications [D]ismiss All',
desc = '[N]otification [H]istory',
},
},
}