Skip to content

Commit

Permalink
feat(keymap): map <leader>gf to DiffviewFileHistory
Browse files Browse the repository at this point in the history
Signed-off-by: Jint-lzxy <[email protected]>
  • Loading branch information
Jint-lzxy committed Jul 8, 2024
1 parent 0373804 commit 382aa75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lua/keymap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ local plug_map = {
-- Plugin Diffview
["n|<leader>gd"] = map_cr("DiffviewOpen"):with_silent():with_noremap(),
["n|<leader>gD"] = map_cr("DiffviewClose"):with_silent():with_noremap(),
["n|<leader>gf"] = map_cr("DiffviewFileHistory %"):with_silent():with_noremap(),
["n|<leader>gF"] = map_cr("DiffviewClose"):with_silent():with_noremap(),
}

bind.nvim_load_mapping(plug_map)
2 changes: 2 additions & 0 deletions lua/modules/configs/tool/which-key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ return function()
name = "󰊢 Git",
d = "git: Show diff",
D = "git: Close diff",
f = "git: Show current file's history",
F = "git: Close current file's history",
g = "git: Toggle lazygit",
G = "git: Toggle fugitive",
},
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ editor["numToStr/Comment.nvim"] = {
}
editor["sindrets/diffview.nvim"] = {
lazy = true,
cmd = { "DiffviewOpen", "DiffviewClose" },
cmd = { "DiffviewOpen", "DiffviewFileHistory", "DiffviewClose" },
config = require("editor.diffview"),
}
editor["folke/flash.nvim"] = {
Expand Down

0 comments on commit 382aa75

Please sign in to comment.