Thu, 16 May 2024 14:37:26 -0500
normalize config.util.autocmd
1165 | 1 | return { |
2 | { | |
3 | "mfussenegger/nvim-dap", | |
4 | dependencies = { | |
5 | { | |
6 | "rcarriga/nvim-dap-ui", | |
7 | dependencies = { "nvim-neotest/nvim-nio" }, | |
8 | -- stylua: ignore | |
9 | keys = { | |
10 | { "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, | |
11 | { "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, | |
12 | }, | |
13 | opts = { | |
14 | controls = { | |
15 | icons = { | |
16 | disconnect = "[d]", | |
17 | pause = "[p]", | |
18 | play = "[c]", | |
19 | run_last = "[l]", | |
20 | step_back = "[u]", | |
21 | step_into = "[i]", | |
22 | step_out = "[O]", | |
23 | step_over = "[o]", | |
24 | terminate = "[t]", | |
25 | } | |
26 | } | |
27 | }, | |
28 | config = function(_, opts) | |
29 | local dap = require("dap") | |
30 | local dapui = require("dapui") | |
31 | dapui.setup(opts) | |
32 | dap.listeners.after.event_initialized["dapui_config"] = function() | |
33 | dapui.open({}) | |
34 | end | |
35 | dap.listeners.before.event_terminated["dapui_config"] = function() | |
36 | dapui.close({}) | |
37 | end | |
38 | dap.listeners.before.event_exited["dapui_config"] = function() | |
39 | dapui.close({}) | |
40 | end | |
41 | end, | |
42 | }, | |
43 | { "theHamsta/nvim-dap-virtual-text", config = true }, | |
44 | { "leoluz/nvim-dap-go", config = true }, | |
45 | { "suketa/nvim-dap-ruby", config = true }, | |
46 | }, | |
47 | ||
48 | -- stylua: ignore | |
49 | keys = { | |
50 | { "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" }, | |
51 | { "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" }, | |
52 | { "<leader>dc", function() require("dap").continue() end, desc = "Continue" }, | |
53 | { "<leader>da", function() require("dap").continue({ before = vim.fn.input("Args: ") }) end, desc = "Run with Args" }, | |
54 | { "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" }, | |
55 | { "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" }, | |
56 | { "<leader>di", function() require("dap").step_into() end, desc = "Step Into" }, | |
57 | { "<leader>dj", function() require("dap").down() end, desc = "Down" }, | |
58 | { "<leader>dk", function() require("dap").up() end, desc = "Up" }, | |
59 | { "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" }, | |
60 | { "<leader>dO", function() require("dap").step_out() end, desc = "Step Out" }, -- switched o/O from lazyvim | |
61 | { "<leader>do", function() require("dap").step_over() end, desc = "Step Over" }, | |
62 | { "<leader>dp", function() require("dap").pause() end, desc = "Pause" }, | |
63 | { "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, | |
64 | { "<leader>ds", function() require("dap").session() end, desc = "Session" }, | |
65 | { "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" }, | |
66 | { "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" }, | |
67 | }, | |
68 | }, | |
69 | } |