Skip to content

Commit b7b205c

Browse files
committed
feat(fugitive): update key mappings for Git commands
- Simplified key mappings for Git push commands. - Updated key mapping for opening Git status. - Added new key mappings for Git log and branches. - Improved documentation for Git command key bindings.
1 parent 60e6b68 commit b7b205c

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

after/ftplugin/fugitive.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ local function k(mode, lhs, rhs, opts)
77
end
88

99
k("n", "<leader>ar", ":CopilotCodeReview<cr>", { desc = "Code Review" })
10-
k("n", "<leader>hps", ":Git push<cr>", { desc = "push" })
11-
k("n", "<leader>hpf", ":Git push --force-with-lease<cr>", { desc = "push --force-with-lease" })
12-
k("n", "<leader>hpu", ":Git push -u origin HEAD<cr>", { desc = "push -u origin HEAD" })
10+
k("n", "<leader>hp", ":Git push<cr>", { desc = "push" })
11+
k("n", "<leader>hP", ":Git push --force-with-lease<cr>", { desc = "push --force-with-lease" })
12+
k("n", "<leader>hu", ":Git push -u origin HEAD<cr>", { desc = "push -u origin HEAD" })

lua/plugins/fugitive.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ return {
2020
end
2121

2222
local mappings = {
23-
{ "<leader>hh", open_git_status, "status" },
23+
{ "<leader>hH", open_git_status, "status" },
2424
}
2525

2626
return vim.fn.get_lazy_keys_conf(mappings, "Git")

lua/plugins/snacks.picker.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ return {
130130
{ "<leader>uu", snacks.picker.undo, "Undotree" },
131131

132132
-- git
133-
{ "<leader>hbr", snacks.picker.git_branches, "Git: Branches" },
134-
{ "<leader>hlf", snacks.picker.git_log_file, "Git: Log file" },
135-
{ "<leader>hlg", snacks.picker.git_log, "Git: Log" },
136-
{ "<leader>hll", snacks.picker.git_log_line, "Git: Log line" },
133+
{ "<leader>hh", snacks.picker.git_status, "Git: Status" },
134+
{ "<leader>hb", snacks.picker.git_branches, "Git: Branches" },
135+
{ "<leader>hf", snacks.picker.git_log_file, "Git: Log file" },
136+
{ "<leader>hg", snacks.picker.git_log, "Git: Log" },
137+
{ "<leader>hl", snacks.picker.git_log_line, "Git: Log line" },
137138

138139
-- neovim
139140
{ "<leader>nH", snacks.picker.highlights, "Highlights" },

readme.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,14 @@ Random features added.
339339
- `gh` stage hunk
340340
- `gH` reset hunk
341341
- `<leader>hd` diff hunk
342-
- `<leader>hh` status
343-
- `<leader>hlg` log
344-
- `<leader>hlf` log file
345-
- `<leader>hll` log line
346-
- `<leader>hpf` push --force-with-lease
347-
- `<leader>hps` push
348-
- `<leader>hpu` push -set-upstream origin HEAD
342+
- `<leader>hh` pick git files
343+
- `<leader>hH` status
344+
- `<leader>hg` log
345+
- `<leader>hf` log file
346+
- `<leader>hl` log line
347+
- `<leader>hF` push --force-with-lease
348+
- `<leader>hp` push
349+
- `<leader>hu` push -set-upstream origin HEAD
349350
- `<leader>hxb` open blame in browser
350351
- `<leader>hxf` open file in browser
351352

0 commit comments

Comments
 (0)