Add Go Debugger
This commit is contained in:
parent
7857039d6f
commit
a09e5f53c1
3 changed files with 67 additions and 43 deletions
|
@ -1 +1 @@
|
||||||
neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm
|
neovim lua gcc curl wget git unzip tar gzip ripgrep php composer go nodejs npm delve
|
||||||
|
|
6
.config/nvim/lua/plugins/editor/debugger/debugger_go.lua
Normal file
6
.config/nvim/lua/plugins/editor/debugger/debugger_go.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
return {
|
||||||
|
"leoluz/nvim-dap-go",
|
||||||
|
config = function()
|
||||||
|
require("dap-go").setup()
|
||||||
|
end
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
|
@ -9,21 +10,36 @@ return {
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
|
|
||||||
-- Open UI on Debugging --
|
-- Open UI on Debugging --
|
||||||
local dapui = require("dapui").setup()
|
local dapui = require("dapui")
|
||||||
|
dapui.setup({
|
||||||
|
layouts = {
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
{ id = "scopes", size = 0.65 },
|
||||||
|
{ id = "breakpoints", size = 0.35 },
|
||||||
|
},
|
||||||
|
position = "left",
|
||||||
|
size = 40,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
{ id = "repl", size = 0.5 },
|
||||||
|
{ id = "console", size = 0.5 },
|
||||||
|
},
|
||||||
|
position = "bottom",
|
||||||
|
size = 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
dap.listeners.before.attach.dapui_config = function()
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.before.launch.dapui_config = function()
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Keybinding --
|
-- Keybinding --
|
||||||
|
vim.keymap.set("n", "<Leader>dt", dapui.toggle, { desc = "Toggle Debugger UI" })
|
||||||
vim.keymap.set("n", "<Leader>db", dap.toggle_breakpoint, { desc = "Toggle Breakpoint" })
|
vim.keymap.set("n", "<Leader>db", dap.toggle_breakpoint, { desc = "Toggle Breakpoint" })
|
||||||
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "Debugger Continue" })
|
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "Debugger Continue" })
|
||||||
vim.keymap.set("n", "<Leader>dx", dap.terminate, { desc = "Debugger Terminate" })
|
vim.keymap.set("n", "<Leader>dx", dap.terminate, { desc = "Debugger Terminate" })
|
||||||
|
@ -54,4 +70,6 @@ return {
|
||||||
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
|
require("plugins.editor.debugger.debugger_go"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue