diff options
-rw-r--r-- | lua/conf/plugins/dap-virtual-text.lua | 9 | ||||
-rw-r--r-- | lua/conf/plugins/dap.lua | 47 |
2 files changed, 56 insertions, 0 deletions
diff --git a/lua/conf/plugins/dap-virtual-text.lua b/lua/conf/plugins/dap-virtual-text.lua new file mode 100644 index 0000000..9225272 --- /dev/null +++ b/lua/conf/plugins/dap-virtual-text.lua @@ -0,0 +1,9 @@ +return { 'theHamsta/nvim-dap-virtual-text', + requires = { + 'mfussenegger/nvim-dap', + 'nvim-treesitter/nvim-treesitter' + }, + function() + require("nvim-dap-virtual-text").setup {} + end +} 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 +} |