add with configuration for python
This commit is contained in:
parent
3745d242ba
commit
ae6f1fbd81
3 changed files with 72 additions and 2 deletions
49
init.lua
49
init.lua
|
|
@ -254,6 +254,24 @@ require('lazy').setup({
|
|||
build = ':TSUpdate',
|
||||
},
|
||||
|
||||
{
|
||||
-- Debug Adapter Protocol client
|
||||
'mfussenegger/nvim-dap',
|
||||
},
|
||||
{
|
||||
-- python specific debugger
|
||||
'mfussenegger/nvim-dap-python',
|
||||
},
|
||||
|
||||
{
|
||||
-- DAP UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
||||
-- These are some example plugins that I've included in the kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them.
|
||||
|
|
@ -586,7 +604,11 @@ local servers = {
|
|||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
require('neodev').setup()
|
||||
-- enable type checking for nvim-dap-ui to get type checking, documentation and autocompletion
|
||||
-- for all API functions
|
||||
require('neodev').setup({
|
||||
library = { plugins = { "nvim-dap-ui" }, types = true },
|
||||
})
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
|
@ -662,5 +684,30 @@ cmp.setup {
|
|||
},
|
||||
}
|
||||
|
||||
-- python debugger
|
||||
require('dap-python').setup('/Users/stephenleece/.asdf/shims/python')
|
||||
-- require('dap-python').test_runner = "pytest"
|
||||
|
||||
-- configure dap ui
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.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 ='', linehl ='', numhl =''})
|
||||
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
|
||||
vim.keymap.set('n', '<F5>', require 'dap'.continue)
|
||||
vim.keymap.set('n', '<F10>', require 'dap'.step_over)
|
||||
vim.keymap.set('n', '<F11>', require 'dap'.step_into)
|
||||
vim.keymap.set('n', '<F12>', require 'dap'.step_out)
|
||||
vim.keymap.set('n', '<leader>b', require 'dap'.toggle_breakpoint)
|
||||
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue