Add overseer and dap
This commit is contained in:
154
.config/nvim/lua/plugins/dap.lua
Normal file
154
.config/nvim/lua/plugins/dap.lua
Normal file
@@ -0,0 +1,154 @@
|
||||
return {
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = {
|
||||
"-i",
|
||||
"dap"
|
||||
}
|
||||
}
|
||||
dap.adapters.python = function(cb, config)
|
||||
if config.request == 'attach' then
|
||||
local port = (config.connect or config).port
|
||||
local host = (config.connect or config).host or '127.0.0.1'
|
||||
cb({
|
||||
type = 'server',
|
||||
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
|
||||
host = host,
|
||||
options = {
|
||||
source_filetype = 'python'
|
||||
}
|
||||
})
|
||||
else
|
||||
cb({
|
||||
type = 'executable',
|
||||
command = 'python',
|
||||
args = {
|
||||
'-m',
|
||||
'debugpy.adapter'
|
||||
},
|
||||
options = {
|
||||
source_filetype = 'python'
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false
|
||||
}
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false
|
||||
}
|
||||
}
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = "Launch file",
|
||||
|
||||
program = "${file}",
|
||||
pythonPath = function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
|
||||
return cwd .. '/venv/bin/python'
|
||||
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
|
||||
return cwd .. '/.venv/bin/python'
|
||||
else
|
||||
return '/usr/bin/python'
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>db", "<cmd>DapToggleBreakpoint<cr>", {
|
||||
desc = "Toggle breakpoint"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<cr>", {
|
||||
desc = "Continue"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>dt", "<cmd>DapTerminate<cr>", {
|
||||
desc = "Terminate"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>di", "<cmd>DapStepInto<cr>", {
|
||||
desc = "Step into"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>dn", "<cmd>DapStepOver<cr>", {
|
||||
desc = "Step over"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>do", "<cmd>DapStepOut<cr>", {
|
||||
desc = "Step out"
|
||||
})
|
||||
vim.keymap.set("n", '<Leader>dh', function() require('dap.ui.widgets').hover() end, {
|
||||
desc = "Hover"
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio"
|
||||
},
|
||||
config = function()
|
||||
require("dapui").setup({
|
||||
controls = {
|
||||
enabled = false
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
{
|
||||
id = "scopes",
|
||||
size = 0.33
|
||||
},
|
||||
{
|
||||
id = "breakpoints",
|
||||
size = 0.33
|
||||
},
|
||||
{
|
||||
id = "stacks",
|
||||
size = 0.33
|
||||
}
|
||||
},
|
||||
position = "left",
|
||||
size = 60
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{
|
||||
id = "repl",
|
||||
size = 1
|
||||
}
|
||||
},
|
||||
position = "bottom",
|
||||
size = 15
|
||||
}
|
||||
}
|
||||
})
|
||||
vim.keymap.set("n", "<leader>du", function() require("dapui").toggle() end, {
|
||||
desc = " Toggle UI"
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
28
.config/nvim/lua/plugins/overseer.lua
Normal file
28
.config/nvim/lua/plugins/overseer.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
"stevearc/overseer.nvim",
|
||||
config = function()
|
||||
require("overseer").setup({
|
||||
templates = {
|
||||
"builtin",
|
||||
"user.cmake_generate",
|
||||
"user.cmake_build",
|
||||
"user.cmake_clean",
|
||||
"user.cmake_test",
|
||||
"user.python_run"
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>oo", function() require("overseer").toggle() end, {
|
||||
desc = "Toggle"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>or", ":OverseerRun<CR>", {
|
||||
desc = "Run"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>oq", ":OverseerQuickAction<CR>", {
|
||||
desc = "Quick Action"
|
||||
})
|
||||
vim.keymap.set("n", "<leader>of", ":OverseerQuickAction open float<CR>", {
|
||||
desc = "Open Float"
|
||||
})
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user