mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-11 03:36:52 +02:00
feat: neovim
This commit is contained in:
45
home/base/server/neovim/lua/plugins/dap.lua
Normal file
45
home/base/server/neovim/lua/plugins/dap.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
keys = {
|
||||
{ "<F6>", "<cmd>lua require('dapui').toggle()<CR>", desc = "dapui_toggle" },
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = "/etc/profiles/per-user/ruixi/bin/lldb-vscode", -- adjust as needed, must be absolute path
|
||||
name = "lldb",
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- If you want to use this for Rust and C, add something like this:
|
||||
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user