Adding DAP!
This commit is contained in:
parent
b11ee41a48
commit
ab7bac5d96
@ -22,6 +22,9 @@ require('lazy').setup({
|
|||||||
require('plugins/mason'),
|
require('plugins/mason'),
|
||||||
require('plugins/gruvbox'),
|
require('plugins/gruvbox'),
|
||||||
require('plugins/comment'),
|
require('plugins/comment'),
|
||||||
|
require('plugins/dap'),
|
||||||
|
require('plugins/dap-python'),
|
||||||
|
-- require('plugins/inc-rename'),
|
||||||
require('plugins/treesitter'),
|
require('plugins/treesitter'),
|
||||||
require('plugins/vim-gitgutter'),
|
require('plugins/vim-gitgutter'),
|
||||||
require('plugins/luasnip'),
|
require('plugins/luasnip'),
|
||||||
|
|||||||
6
nvim/lua/plugins/dap-python.lua
Normal file
6
nvim/lua/plugins/dap-python.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
'mfussenegger/nvim-dap-python',
|
||||||
|
config = function()
|
||||||
|
require('dap-python').setup('~/.virtualenvs/debugpy/bin/python')
|
||||||
|
end,
|
||||||
|
}
|
||||||
100
nvim/lua/plugins/dap.lua
Normal file
100
nvim/lua/plugins/dap.lua
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
return {
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
'rcarriga/nvim-dap-ui',
|
||||||
|
config = function()
|
||||||
|
require('dapui').setup({
|
||||||
|
-- icons
|
||||||
|
mappings = {
|
||||||
|
open = 'o',
|
||||||
|
remove = 'd',
|
||||||
|
edit = 'e',
|
||||||
|
repl = 'r',
|
||||||
|
toggle = 't',
|
||||||
|
},
|
||||||
|
layouts = {
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
'scopes',
|
||||||
|
'watches',
|
||||||
|
},
|
||||||
|
size = 0.33,
|
||||||
|
position = 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
'terminal',
|
||||||
|
'breakpoints',
|
||||||
|
},
|
||||||
|
size = 0.2,
|
||||||
|
position = 'bottom',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
floating = {
|
||||||
|
max_height = nil,
|
||||||
|
max_width = nil,
|
||||||
|
border = 'single',
|
||||||
|
mappings = {
|
||||||
|
close = { 'q', '<Esc>' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
windows = { indent = 1 },
|
||||||
|
render = {
|
||||||
|
max_type_length = nil,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
|
config = function()
|
||||||
|
require('nvim-dap-virtual-text').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local dap, dapui = require('dap'), require('dapui')
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.after.event_terminated['dapui_config'] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.fn.sign_define('DapBreakpoint', { text = '🐞', texthl = '', lineh = '', numhl = '' })
|
||||||
|
vim.fn.sign_define('DapStopped', { text = '⮞' })
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>b', function() require('dap').toggle_breakpoint() end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>dh',
|
||||||
|
function() require('dap.ui.widgets').hover() end,
|
||||||
|
mode = 'n', 'v'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<F5>', function() require('dap').continue() end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<F8>', function() require('dap').terminate() end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<F10>', function() require('dap').step_over() end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<F11>', function() require('dap').step_into() end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<F12>', function() require('dap').step_out() end
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -90,6 +90,7 @@ return {
|
|||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'williamboman/mason-lspconfig.nvim'
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user