diff options
author | Squibid <me@zacharyscheiman.com> | 2024-11-19 13:47:23 -0600 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-11-19 13:47:23 -0600 |
commit | 54d41440435b7f64d501a74e754dfc0b652f6712 (patch) | |
tree | 6a9b6ac6d9aa12cd81416d792ed4615d12e80852 /lua/conf/plugins/dap.lua | |
parent | 1969dc328921495939f0ac3c7e3c378f4f50bc47 (diff) | |
download | nvim-54d41440435b7f64d501a74e754dfc0b652f6712.tar.gz nvim-54d41440435b7f64d501a74e754dfc0b652f6712.tar.bz2 nvim-54d41440435b7f64d501a74e754dfc0b652f6712.zip |
add nvim-dap and dap-virtual-text interface
Diffstat (limited to '')
-rw-r--r-- | lua/conf/plugins/dap.lua | 47 |
1 files changed, 47 insertions, 0 deletions
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', '<Leader>ec', dap.continue) + map('n', '<Leader>eb', require("dap.breakpoints").toggle) + map('n', '<Leader>e]', dap.step_over) + map('n', '<Leader>e[', dap.step_back) + map('n', '<Leader>eR', dap.restart) + end +} |