Add shortcut ":Gc" to vim for simple fast commits

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.
This commit is contained in:
2026-01-14 01:21:00 +01:00
parent cdb55adf2b
commit 9d13d42cbd

View File

@@ -13,6 +13,10 @@ return {
{ "<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" },