From 17780f8e10d62748f4edd9e40f7657959066f738 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Mon, 19 Feb 2024 00:58:48 -0300 Subject: [PATCH] feat: actually configure dap :) --- programs/neovim/user/dap/adapters.lua | 10 ---------- programs/neovim/user/dap/configurations.lua | 12 ------------ programs/neovim/user/init.lua | 21 +++++++++++++++++++++ programs/neovim/user/options.lua | 2 -- 4 files changed, 21 insertions(+), 24 deletions(-) delete mode 100644 programs/neovim/user/dap/adapters.lua delete mode 100644 programs/neovim/user/dap/configurations.lua diff --git a/programs/neovim/user/dap/adapters.lua b/programs/neovim/user/dap/adapters.lua deleted file mode 100644 index 58e9968..0000000 --- a/programs/neovim/user/dap/adapters.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - codelldb = { - type = "server", - port = "${port}", - executable = { - command = "codelldb", - args = { "--port", "${port}" }, - }, - }, -} diff --git a/programs/neovim/user/dap/configurations.lua b/programs/neovim/user/dap/configurations.lua deleted file mode 100644 index f086a28..0000000 --- a/programs/neovim/user/dap/configurations.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - rust = { - { - name = "Launch file", - type = "codelldb", - request = "launch", - program = function() return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - }, - }, -} diff --git a/programs/neovim/user/init.lua b/programs/neovim/user/init.lua index c88b123..1c3ec03 100644 --- a/programs/neovim/user/init.lua +++ b/programs/neovim/user/init.lua @@ -100,5 +100,26 @@ return { -- ["~/%.config/foo/.*"] = "fooscript", -- }, -- } + local dap = require "dap" + + dap.adapters.codelldb = { + port = "${port}", + type = "server", + executable = { + command = "codelldb", + args = { "--port", "${port}" }, + }, + } + + dap.configurations.rust = { + { + name = "Launch file", + type = "codelldb", + request = "launch", + program = function() return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + }, + } end, } diff --git a/programs/neovim/user/options.lua b/programs/neovim/user/options.lua index 1f3eb5a..37b0b40 100644 --- a/programs/neovim/user/options.lua +++ b/programs/neovim/user/options.lua @@ -7,8 +7,6 @@ return { spell = false, -- sets vim.opt.spell signcolumn = "auto", -- sets vim.opt.signcolumn to auto wrap = false, -- sets vim.opt.wrap - autochdir = true, -- automatically change the current directory - autowrite = true, -- write file on modification grepprg = "rg --vimgrep", -- use ripgrep on grep actions }, g = {