From 54d41440435b7f64d501a74e754dfc0b652f6712 Mon Sep 17 00:00:00 2001 From: Squibid Date: Tue, 19 Nov 2024 13:47:23 -0600 Subject: add nvim-dap and dap-virtual-text interface --- lua/conf/plugins/dap.lua | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lua/conf/plugins/dap.lua (limited to 'lua/conf/plugins/dap.lua') diff --git a/lua/conf/plugins/dap.lua b/lua/conf/plugins/dap.lua new file mode 100644 index 0000000..fdcd152 --- /dev/null +++ b/lua/conf/plugins/dap.lua @@ -0,0 +1,47 @@ +local misc = require('core.misc') +local map = misc.map + +return { 'mfussenegger/nvim-dap', + requires = { + 'williamboman/mason.nvim', + 'nvim-telescope/telescope.nvim' + }, + disable = vim.version().minor < 8, + branch = '0.8.0', + function() + + local dap = require("dap") + + local codelldb_port = 13000 + dap.adapters.codelldb = { + type = 'server', + host = '127.0.0.1', + port = codelldb_port, + executable = { + command = require('mason-registry').get_package('codelldb'):get_install_path()..'/codelldb', + args = { '--port', codelldb_port } + } + } + + dap.configurations.c = { + { + name = 'LLDB: Launch', + type = 'codelldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd()..'/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + console = 'integratedTerminal' + } + } + + map('n', 'ec', dap.continue) + map('n', 'eb', require("dap.breakpoints").toggle) + map('n', 'e]', dap.step_over) + map('n', 'e[', dap.step_back) + map('n', 'eR', dap.restart) + end +} -- cgit v1.2.1