nixos-configuration/users/jrpotter/neovim/config/lang/cxx.lua

38 lines
808 B
Lua
Raw Permalink Normal View History

local M = {}
function M.nvim_dap()
2024-03-05 03:10:57 +00:00
local dap = require("dap")
local key = "codelldb"
dap.adapters[key] = {
2024-03-05 03:10:57 +00:00
type = "server",
port = "${port}",
executable = {
2024-03-05 03:10:57 +00:00
command = "codelldb",
args = { "--port", "${port}" },
},
}
local config = {
2024-03-05 03:10:57 +00:00
name = "Launch Executable",
type = key,
2024-03-05 03:10:57 +00:00
request = "launch",
program = function()
2024-03-05 03:10:57 +00:00
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
2024-03-05 03:10:57 +00:00
cwd = "${workspaceFolder}",
}
dap.configurations.c = dap.configurations.c or {}
table.insert(dap.configurations.c, config)
dap.configurations.cpp = dap.configurations.cpp or {}
table.insert(dap.configurations.cpp, config)
end
function M.nvim_lspconfig()
2024-03-05 03:10:57 +00:00
require("utils.lsp").setup(require("lspconfig").clangd) {}
end
return M