diff --git a/lua/barink/keys.lua b/lua/barink/keys.lua index 7579ba8..930d945 100644 --- a/lua/barink/keys.lua +++ b/lua/barink/keys.lua @@ -28,7 +28,7 @@ vim.keymap.set('i', '', ':m .-2==gi', {noremap = true}) -- Diagnostics ! vim.keymap.set('n', '', function() require('trouble').toggle() end ) -vim.keymap.set('n', '', function () vim.diagnostic.open_float() end ) +vim.keymap.set('n', 'd', function () vim.diagnostic.open_float() end ) vim.keymap.set('n', 'dn', function () vim.diagnostic.goto_next() end ) vim.keymap.set('n', 'dp', function () vim.diagnostic.goto_prev() end ) diff --git a/lua/barink/plugins/dap.lua b/lua/barink/plugins/dap.lua index 8689e2d..a7ddf18 100644 --- a/lua/barink/plugins/dap.lua +++ b/lua/barink/plugins/dap.lua @@ -28,8 +28,38 @@ return { request = 'launch'; name = "Launch file"; program = "java ${file}"; + }} + dap.configurations.go = { + { + type = "delve", + name = "Debug", + request = "launch", + program = "${file}" }, + { + type = "delve", + name = "Debug test", -- configuration for debugging test files + request = "launch", + mode = "test", + program = "${file}" + }, + -- works with go.mod packages and sub packages + { + type = "delve", + name = "Debug test (go.mod)", + request = "launch", + mode = "test", + program = "./${relativeFileDirname}" + } } + dap.adapters.delve = { + type = 'server', + port = '${port}', + executable = { + command = 'dlv', + args = {'dap', '-l', '127.0.0.1:${port}'}, + } + } end } }