summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2024-10-21 08:47:03 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2024-10-21 08:47:03 -0400
commit4d3dfee821bb27134de59e61195ba1833a4277a2 (patch)
tree2157f54dc54ca74ecbbf885fcb73b848e119e6e7 /.config/nvim
parent82e0d1170bc73979ceb05e33e4fe35f3bfb4e499 (diff)
Nvim plugin config files
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/after/plugin/mason.lua1
-rw-r--r--.config/nvim/after/plugin/nvim-dap-lldb.lua34
2 files changed, 35 insertions, 0 deletions
diff --git a/.config/nvim/after/plugin/mason.lua b/.config/nvim/after/plugin/mason.lua
new file mode 100644
index 0000000..ac26661
--- /dev/null
+++ b/.config/nvim/after/plugin/mason.lua
@@ -0,0 +1 @@
+require("mason").setup()
diff --git a/.config/nvim/after/plugin/nvim-dap-lldb.lua b/.config/nvim/after/plugin/nvim-dap-lldb.lua
new file mode 100644
index 0000000..83425fa
--- /dev/null
+++ b/.config/nvim/after/plugin/nvim-dap-lldb.lua
@@ -0,0 +1,34 @@
+local dap = require('dap')
+dap.adapters.lldb = {
+ type = 'executable',
+ command = '/opt/homebrew/opt/llvm/bin/lldb-dap', -- adjust as needed, must be absolute path
+ name = 'lldb'
+}
+
+local dap = require('dap')
+dap.configurations.c = {
+ {
+ 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,
+ },
+}