[neovim] Add new key maps

This commit is contained in:
Daniel Carrillo 2022-10-07 19:30:29 +02:00
parent fde23b9939
commit 1ebdd0846c
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
2 changed files with 14 additions and 18 deletions

View File

@ -13,27 +13,10 @@ if not dap_install_status_ok then
return
end
dap_install.setup({})
dap_install.config("python", {})
-- add other configs here
dapui.setup({})
-- deprecated
-- sidebar = {
-- elements = {
-- {
-- id = "scopes",
-- size = 0.25, -- Can be float or integer > 1
-- },
-- { id = "breakpoints", size = 0.25 },
-- },
-- size = 40,
-- position = "right", -- Can be "left", "right", "top", "bottom"
-- },
-- tray = {
-- elements = {},
-- },
-- dapui.setup({})
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })

View File

@ -11,4 +11,17 @@ gitsigns.setup({
topdelete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
changedelete = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map({ "n", "v" }, "<leader>hs", ":Gitsigns stage_hunk<CR>")
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
map("n", "<leader>hR", gs.reset_buffer)
end,
})