mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-07-01 17:44:27 +02:00
Add files via upload
This commit is contained in:
parent
6b4a7042d6
commit
a0b818ad7f
3 changed files with 147 additions and 1 deletions
73
lua/custom/DAP/dap_config.lua
Normal file
73
lua/custom/DAP/dap_config.lua
Normal file
|
@ -0,0 +1,73 @@
|
|||
local mason_dap = require 'mason-nvim-dap'
|
||||
local dap = require 'dap'
|
||||
local ui = require 'dapui'
|
||||
local dap_virtual_text = require 'nvim-dap-virtual-text'
|
||||
|
||||
-- Dap Virtual Text
|
||||
dap_virtual_text.setup()
|
||||
|
||||
mason_dap.setup {
|
||||
ensure_installed = { 'cppdbg', 'debugpy' },
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
function(config)
|
||||
require('mason-nvim-dap').default_setup(config)
|
||||
end,
|
||||
},
|
||||
}
|
||||
-- Configurations
|
||||
dap.configurations = {
|
||||
c = {
|
||||
{
|
||||
name = 'Launch file',
|
||||
type = 'cppdbg',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopAtEntry = false,
|
||||
MIMode = 'lldb',
|
||||
},
|
||||
{
|
||||
name = 'Attach to lldbserver :1234',
|
||||
type = 'cppdbg',
|
||||
request = 'launch',
|
||||
MIMode = 'lldb',
|
||||
miDebuggerServerAddress = 'localhost:1234',
|
||||
miDebuggerPath = '/usr/bin/lldb',
|
||||
cwd = '${workspaceFolder}',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
},
|
||||
},
|
||||
python = {
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = 'Launch file',
|
||||
program = '${file}',
|
||||
pythonPath = function()
|
||||
return '/usr/bin/python3'
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- Dap UI
|
||||
|
||||
ui.setup()
|
||||
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🐞' })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue