add nvim-dap and dap-virtual-text interface
This commit is contained in:
9
lua/conf/plugins/dap-virtual-text.lua
Normal file
9
lua/conf/plugins/dap-virtual-text.lua
Normal file
@ -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
|
||||
}
|
47
lua/conf/plugins/dap.lua
Normal file
47
lua/conf/plugins/dap.lua
Normal file
@ -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
|
||||
}
|
Reference in New Issue
Block a user