neovim-config/lua/plugins/fugitive.lua

38 lines
1.1 KiB
Lua
Raw Normal View History

2023-12-01 20:26:02 +00:00
return {
"tpope/vim-fugitive",
dependencies = {
"tpope/vim-rhubarb",
},
2023-12-01 20:26:02 +00:00
keys = {
2023-12-01 20:26:03 +00:00
{ "<leader>gx", [[<Cmd>G<CR>]], desc = "Toggle [G]it status window" },
{ "<leader>gs", [[<Cmd>Git<CR>]], desc = "Toggle [G]it [S]tatus window" },
2023-12-01 20:26:02 +00:00
{
"<leader>gfd",
[[<Cmd>Gdiffsplit<CR>]],
2023-12-01 20:26:03 +00:00
desc = "[G]it [D]iff current file against index with [F]ugitive",
2023-12-01 20:26:02 +00:00
},
2023-12-01 20:26:03 +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-12-01 20:26:02 +00:00
{
"<leader>gh",
[[<Cmd>Git diff --cached<CR>]],
2023-12-01 20:26:03 +00:00
desc = "[G]it diff current staged changes",
2023-12-01 20:26:02 +00:00
},
{
"<leader>go",
"<cmd>GBrowse<CR>",
2023-12-01 20:26:03 +00:00
desc = "[B]rowse [G]it URL for fugitive object under cursor",
2023-12-01 20:26:02 +00:00
},
{
"<leader>go",
":'<,'>GBrowse<CR>",
mode = "v",
2023-12-01 20:26:03 +00:00
desc = "[B]rowse [G]it URL for selected lines",
silent = true,
2023-12-01 20:26:02 +00:00
},
},
}