Files
dotfiles/.config/nvim/lua/plugins/fugitive.lua
Felix Nehrke 2f23034101 Improve descriptions of key-mappings in neovim and align git-shortcuts
I struggle to remember certain shortcuts sometimes. In these cases I
rely on the "whichkey" plugin which shows a short description of for
each possible keystroke in vim. Though I was lazy and didn't maintain
these everywhere, so this change fixes that. Hopefully I can remeber all
the keys better now.

Furthermore this change contains some slight remappings regarding the
git-keymappings. I used fugitive for most of that in the past, but I saw
more potential using telescope in certain cases, especially navigating
the history.
2025-09-14 20:18:35 +02:00

31 lines
957 B
Lua

local cmd = function (cmd)
return function () vim.cmd(cmd) end
end
return {
{
"tpope/vim-fugitive",
lazy = false,
keys = {
{ "<Leader>gb", cmd("G blame"), desc = "Git blame" },
{ "<Leader>gll", cmd("G log --graph --format='%h (%ar) %s :: %aN <%aE>'"), desc = "Git log" },
{ "<Leader>glf", cmd("G log --graph --format='%h (%ar) %s :: %aN <%aE>' %"), desc = "Git log for current file" },
{ "<Leader>glq", cmd("0Gclog -- %"), desc = "Quicklist revisions of the current file" },
{ "<Leader>go", cmd("GBrowse"), desc = "Open file in Browser in Remote-Repo"}
},
},
-- Github integration for :GBrowse
{ "tpope/vim-rhubarb" },
-- Gitea integration for :GBrowse
{
"borissov/fugitive-gitea",
config = function()
vim.g.fugitive_gitea_domains = { "https://gitea.nehrke.info" }
end
},
-- Gitlab integration for :GBrowse
{ "shumphrey/fugitive-gitlab.vim" },
-- Bitbucket integration for :GBrowse
{ "tommcdo/vim-fubitive" },
}