From eb5aa5bbc1eef562b68b82b428bd567e0ac19335 Mon Sep 17 00:00:00 2001 From: Ethan Holz Date: Wed, 5 Aug 2026 14:47:26 -0600 Subject: [PATCH] refactor: move remaining lsp config to init.lua --- init.lua | 39 ++++++++++++++++++++++++++++++++++++++- lua/lsp.lua | 37 ------------------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 lua/lsp.lua diff --git a/init.lua b/init.lua index 8067ce4..472ec97 100644 --- a/init.lua +++ b/init.lua @@ -167,7 +167,6 @@ if cwd:sub(1, #conform_folder) ~= conform_folder then end require("mappings") -require("lsp") vim.cmd("set completeopt+=noselect") vim.lsp.enable({ "lua_ls", @@ -187,6 +186,32 @@ vim.lsp.enable({ "yamlls", "harper_ls", }) +vim.g.rustaceanvim = { + server = { + on_attach = function(client, _) + client.server_capabilities.workspace.didChangeWatchedFiles = { + dynamicRegistration = false, + } + end, + default_settings = { + ["rust-analyzer"] = { + files = { + watcherExclude = { + "**/.direnv/**", + }, + excludeDirs = { + ".direnv", + ".github", + }, + }, + cargo = { + features = "all", + }, + }, + }, + }, +} + vim.api.nvim_create_autocmd("LspAttach", { callback = function(ev) local client = vim.lsp.get_client_by_id(ev.data.client_id) @@ -196,6 +221,18 @@ vim.api.nvim_create_autocmd("LspAttach", { end, }) +vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) +vim.api.nvim_create_autocmd("LspAttach", { + group = "LspAttach_inlayhints", + callback = function(event) + local client = vim.lsp.get_client_by_id(event.data.client_id) + -- Enable for all clients except for lua_ls + if client and client.name ~= "lua_ls" then + vim.lsp.inlay_hint.enable(true) + end + end, +}) + vim.api.nvim_create_autocmd({ "FileType" }, { group = vim.api.nvim_create_augroup("edit_text", { clear = true }), pattern = { "gitcommit", "markdown", "txt" }, diff --git a/lua/lsp.lua b/lua/lsp.lua deleted file mode 100644 index 31a0c99..0000000 --- a/lua/lsp.lua +++ /dev/null @@ -1,37 +0,0 @@ -vim.g.rustaceanvim = { - server = { - on_attach = function(client, _) - client.server_capabilities.workspace.didChangeWatchedFiles = { - dynamicRegistration = false, - } - end, - default_settings = { - ["rust-analyzer"] = { - files = { - watcherExclude = { - "**/.direnv/**", - }, - excludeDirs = { - ".direnv", - ".github", - }, - }, - cargo = { - features = "all", - }, - }, - }, - }, -} - -vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) -vim.api.nvim_create_autocmd("LspAttach", { - group = "LspAttach_inlayhints", - callback = function(event) - local client = vim.lsp.get_client_by_id(event.data.client_id) - -- Enable for all clients except for lua_ls - if client and client.name ~= "lua_ls" then - vim.lsp.inlay_hint.enable(true) - end - end, -}) -- 2.51.2