Skip to content

Commit

Permalink
feat: dap keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
willruggiano committed Aug 2, 2023
1 parent 842a771 commit f4602be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
29 changes: 25 additions & 4 deletions plugins/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ return function()
vim.notify("Failed to load .vscode/launch.json", vim.log.levels.DEBUG)
end

vim.api.nvim_create_user_command("Debug", function()
dap.continue()
end, { desc = "Start debugger" })

vim.g.dap_virtual_text = true

local dapui = require "dapui"
Expand Down Expand Up @@ -109,4 +105,29 @@ return function()
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end

local nnoremaps = require("bombadil.lib.keymap").nnoremaps
local prefix = "<space>d"
nnoremaps {
[prefix .. "bt"] = {
dap.toggle_breakpoint,
{ desc = "[dap] Toggle breakpoint" },
},
[prefix .. "c"] = {
dap.continue,
{ desc = "[dap] Continue" },
},
[prefix .. "e"] = {
dapui.eval,
{ desc = "[dap] Evaluate expression" },
},
[prefix .. "so"] = {
dap.step_over,
{ desc = "[dap] Step over" },
},
[prefix .. "si"] = {
dap.step_into,
{ desc = "[dap] Step into" },
},
}
end
2 changes: 1 addition & 1 deletion plugins/iron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ return function()
command = { "ts-node" },
},
},
repl_open_cmd = view.split.vertical "40%",
repl_open_cmd = view.split "30%",
},
}
end
4 changes: 0 additions & 4 deletions plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ return function()
end,
{ buffer = bufnr, desc = "Format" },
},
["<space>d"] = {
vim.diagnostic.setloclist,
{ buffer = bufnr, desc = "Diagnostics" },
},
["<leader><leader>l"] = {
vim.diagnostic.open_float,
{ buffer = bufnr, desc = "Line diagnostics" },
Expand Down

0 comments on commit f4602be

Please sign in to comment.