neovim-config/lua/plugins/fugitive.lua

37 lines
1.2 KiB
Lua
Raw Normal View History

2023-11-27 06:55:56 +00:00
return {
"tpope/vim-fugitive",
dependencies = {
"tpope/vim-rhubarb",
},
2023-11-27 06:55:56 +00:00
keys = {
{ "<leader>gx", [[<Cmd>G<CR>]], { desc = "Toggle [G]it status window" } },
{ "<leader>gs", [[<Cmd>Git<CR>]], { desc = "Toggle [G]it [S]tatus window" } },
2023-11-27 06:55:56 +00:00
{
"<leader>gfd",
[[<Cmd>Gdiffsplit<CR>]],
{ desc = "[G]it [D]iff current file against index with [F]ugitive" },
2023-11-27 06:55:56 +00:00
},
{ "<leader>gc", [[<Cmd>Git commit<CR>]], { desc = "[G]it [C]ommit" } },
{ "<leader>gb", [[<Cmd>Git blame -C<CR>]], { desc = "[G]it [B]lame" } },
{ "<leader>gp", [[<Cmd>Git push<CR>]], { desc = "[G]it [P]ush" } },
{ "<leader>gf", [[<Cmd>Git push --force<CR>]], { desc = "[G]it [F]orce push" } },
{ "<leader>gu", [[<Cmd>Git pull<CR>]], { desc = "[G]it p[U]ll" } },
2023-11-27 06:55:56 +00:00
{
"<leader>gh",
[[<Cmd>Git diff --cached<CR>]],
{ desc = "[G]it diff current staged changes" },
2023-11-27 06:55:56 +00:00
},
{
"<leader>go",
"<cmd>GBrowse<CR>",
{ desc = "[B]rowse [G]it URL for fugitive object under cursor" },
2023-11-27 06:55:56 +00:00
},
{
"<leader>go",
":'<,'>GBrowse<CR>",
mode = "v",
{ desc = "[B]rowse [G]it URL for selected lines", silent = true },
2023-11-27 06:55:56 +00:00
},
},
}