chore(git): 将 fugitive 键位集中至 pack.lua 并启用懒加载
This commit is contained in:
parent
f4316308c4
commit
dd29f692ee
10
lua/pack.lua
10
lua/pack.lua
@ -410,6 +410,16 @@ lazy.on_keys("fugitive", "<leader>gd", "n", load_fugitive, function()
|
||||
vim.cmd("Gvdiffsplit")
|
||||
end, { desc = "Git diff 分割" })
|
||||
|
||||
-- <leader>gB — 整文件 blame(使用 fugitive 的 :Git blame)
|
||||
lazy.on_keys("fugitive", "<leader>gB", "n", load_fugitive, function()
|
||||
vim.cmd("Git blame")
|
||||
end, { desc = "Blame 整个文件" })
|
||||
|
||||
-- <leader>gD — 查看当前文件的 git 历史
|
||||
lazy.on_keys("fugitive", "<leader>gD", "n", load_fugitive, function()
|
||||
vim.cmd("Git log -p -- %")
|
||||
end, { desc = "查看文件 Git 历史" })
|
||||
|
||||
-- ---------------------------------------------------------------------------
|
||||
-- mini.completion — 自动补全(InsertEnter 懒加载)
|
||||
-- ---------------------------------------------------------------------------
|
||||
|
||||
@ -187,13 +187,3 @@ vim.keymap.set("n", "<leader>ghp", preview_hunk, { desc = "预览 hunk" })
|
||||
|
||||
-- <leader>ghb — 查看当前行 blame
|
||||
vim.keymap.set("n", "<leader>ghb", blame_line, { desc = "Blame 当前行" })
|
||||
|
||||
-- <leader>gB — 整文件 blame(使用 fugitive 的 :Git blame)
|
||||
vim.keymap.set("n", "<leader>gB", function()
|
||||
vim.cmd("Git blame")
|
||||
end, { desc = "Blame 整个文件" })
|
||||
|
||||
-- <leader>gD — 查看当前文件的 git 历史
|
||||
vim.keymap.set("n", "<leader>gD", function()
|
||||
vim.cmd("Git log -p -- %")
|
||||
end, { desc = "查看文件 Git 历史" })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user