From 19735c1469cd82dc6834f1ad326b6e32236dc048 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Wed, 30 Nov 2022 17:31:12 -0600 Subject: feat(nvim): add setup for c --- nvim/.config/nvim/lua/tobyvin/autocmds.lua | 2 +- nvim/.config/nvim/lua/tobyvin/lsp/configs.lua | 20 +--------- nvim/.config/nvim/lua/tobyvin/plugins/dap.lua | 2 +- .../nvim/lua/tobyvin/plugins/dap/configs.lua | 43 +++++++++++++++++----- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/nvim/.config/nvim/lua/tobyvin/autocmds.lua b/nvim/.config/nvim/lua/tobyvin/autocmds.lua index c322739..ba02592 100644 --- a/nvim/.config/nvim/lua/tobyvin/autocmds.lua +++ b/nvim/.config/nvim/lua/tobyvin/autocmds.lua @@ -34,7 +34,7 @@ vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("FileType", { group = vim.api.nvim_create_augroup("tobyvin_tabstop", { clear = true }), - pattern = { "sh", "zsh", "xml", "html", "xhtml", "css", "scss", "javascript", "lua", "dart", "markdown" }, + pattern = { "c", "sh", "zsh", "xml", "html", "xhtml", "css", "scss", "javascript", "lua", "dart", "markdown" }, callback = function(args) vim.bo[args.buf].tabstop = 2 end, diff --git a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua index bb4daf1..381664a 100644 --- a/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua +++ b/nvim/.config/nvim/lua/tobyvin/lsp/configs.lua @@ -6,25 +6,7 @@ local configs = { cssls = {}, cssmodules_ls = {}, stylelint_lsp = {}, - ccls = {}, -} - -configs.pylsp = { - settings = { - pylsp = { - plugins = { - autopep8 = { - enabled = false, - }, - yapf = { - enabled = false, - }, - pylint = { - enabled = true, - }, - }, - }, - }, + clangd = {}, } configs.gopls = { diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/dap.lua b/nvim/.config/nvim/lua/tobyvin/plugins/dap.lua index 9126e33..4ae19b6 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/dap.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/dap.lua @@ -65,7 +65,7 @@ M.hover.setup() for name, config in pairs(M.configs) do if dap.configurations[name] == nil then - dap.configurations[name] = make_config(config) + dap.configurations[name] = config end end diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/dap/configs.lua b/nvim/.config/nvim/lua/tobyvin/plugins/dap/configs.lua index ba38b54..4b5d7b9 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/dap/configs.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/dap/configs.lua @@ -12,7 +12,7 @@ local select_executable = function(cwd) local command, args for finder, finder_args in pairs(finders) do - if vim.fn.executable("fdfind") == 1 then + if vim.fn.executable(finder) == 1 then command = finder args = finder_args end @@ -20,6 +20,7 @@ local select_executable = function(cwd) if command == nil then vim.notify("Failed to locate finder tool", vim.log.levels.ERROR, { title = "[dap.configs] select_executable" }) + return end local items = Job:new({ @@ -57,17 +58,39 @@ M.lua = { } M.c = { - name = "Launch file", - type = "codelldb", - request = "launch", - program = select_executable, - cwd = "${workspaceFolder}", - stopOnEntry = false, - runInTerminal = false, + { + name = "Launch c file", + type = "codelldb", + request = "launch", + program = select_executable, + cwd = "${workspaceFolder}", + stopOnEntry = false, + runInTerminal = false, + }, } -M.cpp = M.c +M.cpp = { + { + name = "Launch c++ file", + type = "codelldb", + request = "launch", + program = select_executable, + cwd = "${workspaceFolder}", + stopOnEntry = false, + runInTerminal = false, + }, +} -M.rust = M.c +M.rust = { + { + name = "Launch rust file", + type = "codelldb", + request = "launch", + program = select_executable, + cwd = "${workspaceFolder}", + stopOnEntry = false, + runInTerminal = false, + }, +} return M -- cgit v1.2.3-70-g09d2