When working in vim I have developed some pattern which fell fast and confident enough for me to being typed all the time. E.g. I catch myself often doing typing the following: `:Gw<CR>:G<CR>cc` These keystrokes safe the current file directly to the staging area of git (:Gw), then opening the fugitive-panel (:G) and finally letting me write a commit-message form there (cc). The keypart here is that I _have_ to open the fugitive-panel to perform a commit, since I don't use any abbreviation for "commit" on git itself the only other way is typing `:Gw<CR>:G commit` which is cumbersome. This change allows me to type just another short version (namely: `:Gw<CR>:Gc`) which saves 2 keystrokes and a whole panel-rendering. Though this change is experimental right now since I don't know if I really get used to it.
35 lines
1.1 KiB
Lua
35 lines
1.1 KiB
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"}
|
|
},
|
|
config = function ()
|
|
-- alias to only type :Gc to commit
|
|
vim.api.nvim_create_user_command("Gc", "G commit", {})
|
|
end
|
|
},
|
|
-- 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" },
|
|
}
|