fix: modify nvim config
This commit is contained in:
@@ -18,6 +18,27 @@ return {
|
||||
sign_priority = 6,
|
||||
update_debounce = 200,
|
||||
status_formatter = nil, -- Use default
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "<leader>gj", gs.next_hunk, "Next Hunk")
|
||||
map("n", "<leader>gh", gs.prev_hunk, "Prev Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<leader>gp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||
end,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,15 +18,15 @@ return {
|
||||
end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
{
|
||||
"<leader>sr",
|
||||
function()
|
||||
require("telescope.builtin").oldfiles({
|
||||
cwd = vim.loop.cwd()
|
||||
})
|
||||
end,
|
||||
desc = "Find Recent File",
|
||||
},
|
||||
-- {
|
||||
-- "<leader>sr",
|
||||
-- function()
|
||||
-- require("telescope.builtin").oldfiles({
|
||||
-- cwd = vim.loop.cwd()
|
||||
-- })
|
||||
-- end,
|
||||
-- desc = "Find Recent File",
|
||||
-- },
|
||||
{
|
||||
";f",
|
||||
function()
|
||||
|
||||
Reference in New Issue
Block a user