Nvim: some code prettifying

This commit is contained in:
Marko Korhonen 2024-08-08 11:47:17 +03:00
parent 5baa4af474
commit 4046ef4e48
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
3 changed files with 27 additions and 28 deletions

View file

@ -1,6 +1,4 @@
local k = function(lhs, rhs, opts)
vim.keymap.set("", lhs, rhs, opts)
end
local k = vim.keymap.set
--- @type LazyPluginSpec
return {
@ -20,17 +18,17 @@ return {
local opts
-- Hunk navigation
k("[h", gs.prev_hunk, { desc = "Previous hunk" })
k("]h", gs.next_hunk, { desc = "Next hunk" })
k("n", "[h", gs.prev_hunk, { desc = "Previous hunk" })
k("n", "]h", gs.next_hunk, { desc = "Next hunk" })
-- Hunk actions
opts = { desc = "Hunk" }
k("<leader>grh", gs.reset_hunk, opts)
k("<leader>gah", gs.stage_hunk, opts)
k("n", "<leader>grh", gs.reset_hunk, opts)
k("n", "<leader>gah", gs.stage_hunk, opts)
-- Buffer actions
opts = { desc = "Buffer" }
k("<leader>gab", gs.stage_buffer, opts)
k("<leader>grb", gs.reset_buffer, opts)
k("n", "<leader>gab", gs.stage_buffer, opts)
k("n", "<leader>grb", gs.reset_buffer, opts)
end,
}