1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
return {
"leoluz/nvim-dap-go",
dependencies = { "mfussenegger/nvim-dap" },
opts = true,
config = function()
local dap, dapui = require("dap"), require("dapui")
dap.adapters.go = {
type = "server",
port = "${port}",
executable = {
command = "dlv",
args = { "dap", "-l", "127.0.0.1:${port}" },
},
}
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
vim.fn.sign_define(
"DapBreakpoint",
{ text = "🐞", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapBreakpointCondition",
{ text = "ﳁ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapBreakpointRejected",
{ text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapLogPoint",
{ text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
)
vim.fn.sign_define(
"DapStopped",
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
)
end,
keys = {
{
"<F5>",
function()
require("dap").continue()
end,
silent = true,
},
{
"<F10>",
function()
require("dap").step_over()
end,
silent = true,
},
{
"<F11>",
function()
require("dap").step_into()
end,
silent = true,
},
{
"<F12>",
function()
require("dap").step_out()
end,
silent = true,
},
{
"<leader>dc",
function()
require("dap").continue()
end,
silent = true,
},
{
"<leader>so",
function()
require("dap").step_over()
end,
silent = true,
},
{
"<leader>si",
function()
require("dap").step_into()
end,
silent = true,
},
{
"<leader>st",
function()
require("dap").step_out()
end,
silent = true,
},
{
"<leader>b",
function()
require("dap").toggle_breakpoint()
end,
silent = true,
},
{
"<A-b>",
function()
require("dap").toggle_breakpoint()
end,
silent = true,
},
{
"<Leader>B",
function()
require("dap").set_breakpoint()
end,
silent = true,
},
{
"<Leader>lp",
function()
require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
end,
silent = true,
},
{
"<Leader>dr",
function()
require("dap").repl.open()
end,
silent = true,
},
{
"<Leader>dl",
function()
require("dap").run_last()
end,
silent = true,
},
},
}
|