From bd00a689b8b3f270af7fb1d60aa65dfb2a8b749d Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 31 May 2025 01:03:21 +0200 Subject: [PATCH] Moved LSP configs to new lsp/ folder, moved lsp config to seperate fiel, and simplified mason tool installer config --- nvim/dot-config/nvim/init.lua | 33 +--- nvim/dot-config/nvim/lsp/clangd.lua | 3 + nvim/dot-config/nvim/lsp/jsonls.lua | 8 + nvim/dot-config/nvim/lsp/lua_ls.lua | 8 + nvim/dot-config/nvim/lsp/rust_analyzer.lua | 9 ++ nvim/dot-config/nvim/lsp/typos_lsp.lua | 5 + nvim/dot-config/nvim/lsp/yamlls.lua | 8 + nvim/dot-config/nvim/lua/autocmds.lua | 90 ----------- nvim/dot-config/nvim/lua/lsp.lua | 150 ++++++++++++++++++ nvim/dot-config/nvim/lua/options.lua | 35 ---- nvim/dot-config/nvim/lua/plugins/conform.lua | 60 +++---- .../nvim/lua/plugins/mason-tool-installer.lua | 109 ++++--------- .../nvim/lua/plugins/schema-companion.lua | 14 +- .../nvim/lua/plugins/schemastore.lua | 20 --- .../nvim/lua/plugins/treesitter.lua | 17 +- nvim/dot-config/nvim/lua/tools/format.lua | 19 --- nvim/dot-config/nvim/lua/tools/highlight.lua | 16 -- nvim/dot-config/nvim/lua/tools/lsp.lua | 45 ------ 18 files changed, 270 insertions(+), 379 deletions(-) create mode 100644 nvim/dot-config/nvim/lsp/clangd.lua create mode 100644 nvim/dot-config/nvim/lsp/jsonls.lua create mode 100644 nvim/dot-config/nvim/lsp/lua_ls.lua create mode 100644 nvim/dot-config/nvim/lsp/rust_analyzer.lua create mode 100644 nvim/dot-config/nvim/lsp/typos_lsp.lua create mode 100644 nvim/dot-config/nvim/lsp/yamlls.lua create mode 100644 nvim/dot-config/nvim/lua/lsp.lua delete mode 100644 nvim/dot-config/nvim/lua/tools/format.lua delete mode 100644 nvim/dot-config/nvim/lua/tools/highlight.lua delete mode 100644 nvim/dot-config/nvim/lua/tools/lsp.lua diff --git a/nvim/dot-config/nvim/init.lua b/nvim/dot-config/nvim/init.lua index 0cdd76d..35b57e2 100644 --- a/nvim/dot-config/nvim/init.lua +++ b/nvim/dot-config/nvim/init.lua @@ -1,8 +1,3 @@ --- Basic vim config stuff -require("keymaps") -require("options") -require("autocmds") - -- Install lazy package manager local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then @@ -17,6 +12,13 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +-- Setup +require("keymaps") +require("options") +require("autocmds") +require("lsp") + +-- Configure plugins require("lazy").setup({ { import = "themes" }, { import = "plugins" }, @@ -37,24 +39,3 @@ require("lazy").setup({ backdrop = 100, }, }) - -local lsp = require("tools.lsp") -for _, tool in pairs(lsp) do - if type(tool) == "table" then - local name = tool[1] - - -- Apply additional config if specified - local config = tool[2] - if config ~= nil then - vim.lsp.config(name, config) - end - - -- System LSP are not managed by mason and need to be enabled manually - if - (type(tool.system) == "boolean" and tool.system and vim.fn.executable(name) > 0) - or (type(tool.system) == "string" and vim.fn.executable(tool.system) > 0) - then - vim.lsp.enable(name) - end - end -end diff --git a/nvim/dot-config/nvim/lsp/clangd.lua b/nvim/dot-config/nvim/lsp/clangd.lua new file mode 100644 index 0000000..6f0241e --- /dev/null +++ b/nvim/dot-config/nvim/lsp/clangd.lua @@ -0,0 +1,3 @@ +return { + cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" }, +} diff --git a/nvim/dot-config/nvim/lsp/jsonls.lua b/nvim/dot-config/nvim/lsp/jsonls.lua new file mode 100644 index 0000000..03e1cbb --- /dev/null +++ b/nvim/dot-config/nvim/lsp/jsonls.lua @@ -0,0 +1,8 @@ +return { + settings = { + json = { + validate = { enable = true }, + schemas = require("schemastore").json.schemas(), + }, + }, +} diff --git a/nvim/dot-config/nvim/lsp/lua_ls.lua b/nvim/dot-config/nvim/lsp/lua_ls.lua new file mode 100644 index 0000000..5289e5f --- /dev/null +++ b/nvim/dot-config/nvim/lsp/lua_ls.lua @@ -0,0 +1,8 @@ +return { + settings = { + Lua = { + workspace = { checkThirdParty = false }, + telemetry = { enable = false }, + }, + }, +} diff --git a/nvim/dot-config/nvim/lsp/rust_analyzer.lua b/nvim/dot-config/nvim/lsp/rust_analyzer.lua new file mode 100644 index 0000000..1439622 --- /dev/null +++ b/nvim/dot-config/nvim/lsp/rust_analyzer.lua @@ -0,0 +1,9 @@ +return { + settings = { + ["rust-analyzer"] = { + check = { + command = "clippy", + }, + }, + }, +} diff --git a/nvim/dot-config/nvim/lsp/typos_lsp.lua b/nvim/dot-config/nvim/lsp/typos_lsp.lua new file mode 100644 index 0000000..3fee781 --- /dev/null +++ b/nvim/dot-config/nvim/lsp/typos_lsp.lua @@ -0,0 +1,5 @@ +return { + init_options = { + diagnosticSeverity = "Hint", + }, +} diff --git a/nvim/dot-config/nvim/lsp/yamlls.lua b/nvim/dot-config/nvim/lsp/yamlls.lua new file mode 100644 index 0000000..bf2d31a --- /dev/null +++ b/nvim/dot-config/nvim/lsp/yamlls.lua @@ -0,0 +1,8 @@ +return require("schema-companion").setup_client({ + settings = { + yaml = { + schemastore = { enable = false, url = "" }, + schemas = require("schemastore").yaml.schemas(), + }, + }, +}) diff --git a/nvim/dot-config/nvim/lua/autocmds.lua b/nvim/dot-config/nvim/lua/autocmds.lua index 9e6d4f0..5cf9b1e 100644 --- a/nvim/dot-config/nvim/lua/autocmds.lua +++ b/nvim/dot-config/nvim/lua/autocmds.lua @@ -24,93 +24,3 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, { end end, }) - -local group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }) --- Setup lsp keybindings -vim.api.nvim_create_autocmd("LspAttach", { - group = group, - callback = function(event) - local map = function(keys, func, desc, mode) - mode = mode or "n" - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = desc }) - end - - -- Symbols - map("grD", vim.lsp.buf.declaration, "Goto declaration") - - local has_telescope, telescope = pcall(require, "telescope.builtin") - if has_telescope then - map("grd", telescope.lsp_definitions, "Goto definition") - - map("grt", telescope.lsp_type_definitions, "Type definition") - - map("grr", telescope.lsp_references, "Goto references") - map("gri", telescope.lsp_implementations, "Goto implementation") - map("gO", telescope.lsp_document_symbols, "Document symbols") - map("gW", telescope.lsp_dynamic_workspace_symbols, "Workspace symbols") - end - - -- Diagnostics - map("[d", function() - vim.diagnostic.jump({ count = -1 }) - end, "Go to previous diagnostic message") - map("]d", function() - vim.diagnostic.jump({ count = 1 }) - end, "Go to next diagnostic message") - map("e", vim.diagnostic.open_float, "Open floating diagnostic message") - - -- Helpers - vim.keymap.set("n", "grn", function() - return ":IncRename " .. vim.fn.expand("") - end, { buffer = event.buf, expr = true, desc = "Rename" }) - map("gra", vim.lsp.buf.code_action, "Code actions", { "n", "x" }) - - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then - map("th", function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) - end, "Inlay hints") - end - end, -}) - --- Setup cursor hover symbol highlight -vim.api.nvim_create_autocmd("LspAttach", { - group = group, - callback = function(event) - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then - local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false }) - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - buffer = event.buf, - group = lsp_hover_hl, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { - buffer = event.buf, - group = lsp_hover_hl, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd("LspDetach", { - group = vim.api.nvim_create_augroup("LspHoverHighlightDetach", { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds({ group = lsp_hover_hl, buffer = event2.buf }) - end, - }) - end - end, -}) - --- Disable lsp based syntax highlighting -vim.api.nvim_create_autocmd("LspAttach", { - group = group, - callback = function(event) - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.server_capabilities.semanticTokensProvider then - client.server_capabilities.semanticTokensProvider = nil - end - end, -}) diff --git a/nvim/dot-config/nvim/lua/lsp.lua b/nvim/dot-config/nvim/lua/lsp.lua new file mode 100644 index 0000000..9a8a713 --- /dev/null +++ b/nvim/dot-config/nvim/lua/lsp.lua @@ -0,0 +1,150 @@ +local diagnostic = require("symbols.diagnostic") +local methods = vim.lsp.protocol.Methods + +local map = function(keys, func, desc, mode, bufnr) + mode = mode or "n" + vim.keymap.set(mode, keys, func, { desc = desc, buffer = bufnr }) +end + +-- General keymaps +map("[d", function() + vim.diagnostic.jump({ count = -1 }) +end, "Go to previous diagnostic message") +map("]d", function() + vim.diagnostic.jump({ count = 1 }) +end, "Go to next diagnostic message") + +map("[e", function() + vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR }) +end, "Go to previous error message") +map("]e", function() + vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR }) +end, "Go to next error message") + +map("e", vim.diagnostic.open_float, "Open floating diagnostic message") + +map("th", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) +end, "Toggle inlay hints") + +map("gra", vim.lsp.buf.code_action, "Code actions", { "n", "x" }) +map("grD", vim.lsp.buf.declaration, "Goto declaration") +map("grd", function() + require("telescope.builtin").lsp_definitions({ jump_type = "never" }) +end, "Goto definition") + +map("grt", function() + require("telescope.builtin").lsp_type_definitions() +end, "Type definition") +map("grr", function() + require("telescope.builtin").lsp_references() +end, "Goto references") +map("gri", function() + require("telescope.builtin").lsp_implementations() +end, "Goto implementation") + +map("ss", function() + require("telescope.builtin").lsp_document_symbols() +end, "Document symbols") +map("sS", function() + require("telescope.builtin").lsp_dynamic_workspace_symbols() +end, "Workspace symbols") + +-- Provide a placeholder rename keymap, otherwise the rename appears to works until you hit enter at which point it will fail +map("grn", function() + vim.api.nvim_echo({ { "Rename are not available in current buffer" } }, true, { err = true }) +end, "Rename") + +---@param client vim.lsp.Client +---@param bufnr integer +local function on_attach(client, bufnr) + -- Setup actual rename keymap if it is available + if client:supports_method(methods.textDocument_rename, bufnr) then + vim.keymap.set("n", "grn", function() + return ":IncRename " .. vim.fn.expand("") + end, { buffer = bufnr, expr = true, desc = "Rename" }) + end + + -- Disable lsp based syntax highlighting, I don't like it + -- TODO: Switch to this once it is available + -- vim.lsp.document_color.enable(false, bufnr) + if client.server_capabilities.semanticTokensProvider then + client.server_capabilities.semanticTokensProvider = nil + end + + -- Highlight references under cursor + if client:supports_method(methods.textDocument_documentHighlight) then + local lsp_hover_hl = vim.api.nvim_create_augroup("LspHoverHighlight", { clear = false }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = bufnr, + group = lsp_hover_hl, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = bufnr, + group = lsp_hover_hl, + callback = vim.lsp.buf.clear_references, + }) + end +end + +vim.diagnostic.config({ + severity_sort = true, + signs = { + numhl = { + [vim.diagnostic.severity.ERROR] = "DiagnosticNumError", + [vim.diagnostic.severity.WARN] = "DiagnosticNumWarn", + [vim.diagnostic.severity.HINT] = "DiagnosticNumHint", + [vim.diagnostic.severity.INFO] = "DiagnosticNumInfo", + }, + text = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = "", + [vim.diagnostic.severity.HINT] = "", + [vim.diagnostic.severity.INFO] = "", + }, + }, + float = { + severity_sort = false, + header = "", + suffix = function(d) + local code = d.code and string.format(" (%s)", d.code) or "" + + return string.format("%s [%s]", code, d.source), "NormalFloat" + end, + }, + virtual_text = { + prefix = function(d) + return diagnostic[d.severity] + end, + virt_text_pos = "eol_right_align", + }, +}) + +local register_capability = vim.lsp.handlers[methods.client_registerCapability] +vim.lsp.handlers[methods.client_registerCapability] = function(err, res, ctx) + local client = vim.lsp.get_client_by_id(ctx.client_id) + if not client then + return + end + + on_attach(client, vim.api.nvim_get_current_buf()) + + return register_capability(err, res, ctx) +end + +vim.api.nvim_create_autocmd("LspAttach", { + desc = "Configure LSP keymaps", + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if not client then + return + end + + on_attach(client, args.buf) + end, +}) + +-- Manually enable rust analyzer +vim.lsp.enable("rust_analyzer") diff --git a/nvim/dot-config/nvim/lua/options.lua b/nvim/dot-config/nvim/lua/options.lua index 7fe9135..299a4e6 100644 --- a/nvim/dot-config/nvim/lua/options.lua +++ b/nvim/dot-config/nvim/lua/options.lua @@ -1,4 +1,3 @@ -local diagnostic = require("symbols.diagnostic") local window = require("symbols.window") -- Set highlight on search @@ -72,37 +71,3 @@ vim.o.foldlevelstart = 99 -- Windows borders vim.o.winborder = window.border - --- LSP config -vim.diagnostic.config({ - severity_sort = true, - signs = { - numhl = { - [vim.diagnostic.severity.ERROR] = "DiagnosticNumError", - [vim.diagnostic.severity.WARN] = "DiagnosticNumWarn", - [vim.diagnostic.severity.HINT] = "DiagnosticNumHint", - [vim.diagnostic.severity.INFO] = "DiagnosticNumInfo", - }, - text = { - [vim.diagnostic.severity.ERROR] = "", - [vim.diagnostic.severity.WARN] = "", - [vim.diagnostic.severity.HINT] = "", - [vim.diagnostic.severity.INFO] = "", - }, - }, - float = { - severity_sort = false, - header = "", - suffix = function(d) - local code = d.code and string.format(" (%s)", d.code) or "" - - return string.format("%s [%s]", code, d.source), "NormalFloat" - end, - }, - virtual_text = { - prefix = function(d) - return diagnostic[d.severity] - end, - virt_text_pos = "eol_right_align", - }, -}) diff --git a/nvim/dot-config/nvim/lua/plugins/conform.lua b/nvim/dot-config/nvim/lua/plugins/conform.lua index 0348ccc..ebf4c16 100644 --- a/nvim/dot-config/nvim/lua/plugins/conform.lua +++ b/nvim/dot-config/nvim/lua/plugins/conform.lua @@ -1,5 +1,24 @@ -- https://github.com/stevearc/conform.nvim -local slow_format_filetypes = {} +local formatters_by_ft = { + c = { "clang-format" }, + cpp = { "clang-format" }, + go = { "goimports" }, + python = { "ruff_organize_imports", "ruff_format" }, + rust = { "rustfmt" }, + javascript = { "prettierd" }, + javascriptreact = { "prettierd" }, + typescript = { "prettierd" }, + typescriptreact = { "prettierd" }, + css = { "prettierd" }, + markdown = { "prettierd" }, + yaml = { "prettierd" }, + lua = { "stylua" }, + json = { "jq" }, + toml = { "taplo" }, + -- ["*"] = { "injected" }, + ["_"] = { "trim_whitespace", "trim_newlines" }, +} + --- @module "lazy" --- @type LazySpec return { @@ -20,47 +39,14 @@ return { --- @module "conform" --- @type conform.setupOpts opts = { - formatters_by_ft = (function() - local formatters = require("tools.format") - local formatters_by_ft = {} - for lang, formatter in pairs(formatters) do - formatters_by_ft[lang] = {} - if type(formatter) == "table" then - for _, tool in ipairs(formatter) do - if type(tool) == "table" then - table.insert(formatters_by_ft[lang], tool[1]) - else - table.insert(formatters_by_ft[lang], tool) - end - end - end - end - - return formatters_by_ft - end)(), + formatters_by_ft = formatters_by_ft, notify_on_error = false, format_on_save = function(bufnr) if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end - if slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - local function on_format(err) - if err and err:match("timeout$") then - slow_format_filetypes[vim.bo[bufnr].filetype] = true - end - end - return { timeout_ms = 200, lsp_fallback = true }, on_format - end, - format_after_save = function(bufnr) - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - if not slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - return { lsp_fallback = true } + --- @type conform.FormatOpts + return { lsp_format = "fallback" } end, }, init = function() diff --git a/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua b/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua index af0ecc4..948e7fe 100644 --- a/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua +++ b/nvim/dot-config/nvim/lua/plugins/mason-tool-installer.lua @@ -1,4 +1,29 @@ --- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim +local ensure_installed = { + -- LSP + "typos_lsp", + "clangd", + "basedpyright", + "lua_ls", + { + "gopls", + condition = function() + return vim.fn.executable("go") > 0 + end, + }, + "jsonls", + "yamlls", + "taplo", + "neocmake", + -- Formatter + "clang-format", + "goimports", + "ruff", + "prettierd", + "stylua", + "jq", +} + --- @module "lazy" --- @type LazySpec return { @@ -7,82 +32,10 @@ return { dependencies = { "mason-org/mason.nvim", }, - config = function() - local lsp = require("tools.lsp") - - -- Convert lsp entries to consistent format - local tools = {} - for _, tool in pairs(lsp) do - if type(tool) == "table" then - local name = tool[1] - local entry = {} - - -- Make a copy and strip out name and lsp config - for k, v in pairs(tool) do - if k ~= 1 and k ~= 2 then - entry[k] = v - end - end - - tools[name] = entry - else - tools[tool] = {} - end - end - - -- Convert formatters to same format and merge on top of the lsps - local formatters_by_ft = require("conform").formatters_by_ft - local mapping = require("mason-conform.mapping") - for _, formatter in pairs(formatters_by_ft) do - if type(formatter) == "table" then - for _, tool in ipairs(formatter) do - local entry = {} - local name = nil - if type(tool) == "table" then - name = mapping.conform_to_package[tool[1]] - - -- Make a copy and strip out name - for k, v in pairs(tool) do - if k ~= 1 then - entry[k] = v - end - end - else - name = mapping.conform_to_package[tool] - end - - if name ~= nil then - tools[name] = vim.tbl_extend("error", tools[name] or {}, entry) - end - end - end - end - - local ensure_installed = vim.iter(tools) - :map(function(name, tool) - if type(tool) == "table" then - if tool.system then - return nil - end - - local entry = { - [1] = name, - } - - for k, v in pairs(tool) do - entry[k] = v - end - - return entry - end - return tool - end) - :totable() - - require("mason-tool-installer").setup({ - ensure_installed = ensure_installed, - auto_update = true, - debounde_hours = 24, - }) - end, + opts = { + ensure_installed = ensure_installed, + auto_update = true, + debounde_hours = 24, + start_delay = 1000, + }, } diff --git a/nvim/dot-config/nvim/lua/plugins/schema-companion.lua b/nvim/dot-config/nvim/lua/plugins/schema-companion.lua index 6e0030d..16d490e 100644 --- a/nvim/dot-config/nvim/lua/plugins/schema-companion.lua +++ b/nvim/dot-config/nvim/lua/plugins/schema-companion.lua @@ -41,19 +41,9 @@ return { init = function() vim.keymap.set( "n", - "ss", + "ys", require("telescope").extensions.schema_companion.select_schema, - { desc = "Select schema" } - ) - - vim.lsp.config( - "yamlls", - require("schema-companion").setup_client({ - single_file_support = true, - settings = { - yaml = {}, - }, - }) + { desc = "Yaml schema" } ) end, --- @module "schema-companion" diff --git a/nvim/dot-config/nvim/lua/plugins/schemastore.lua b/nvim/dot-config/nvim/lua/plugins/schemastore.lua index 6a153bd..045fb57 100644 --- a/nvim/dot-config/nvim/lua/plugins/schemastore.lua +++ b/nvim/dot-config/nvim/lua/plugins/schemastore.lua @@ -3,24 +3,4 @@ --- @type LazySpec return { "b0o/schemastore.nvim", - config = function() - vim.lsp.config("jsonls", { - settings = { - json = { - validate = { enable = true }, - schemas = require("schemastore").json.schemas(), - }, - }, - }) - - vim.lsp.config("yamlls", { - settings = { - yaml = { - -- Using the schemastore plugin for schemas. - schemastore = { enable = false, url = "" }, - schemas = require("schemastore").yaml.schemas(), - }, - }, - }) - end, } diff --git a/nvim/dot-config/nvim/lua/plugins/treesitter.lua b/nvim/dot-config/nvim/lua/plugins/treesitter.lua index 19d3bce..1eef37b 100644 --- a/nvim/dot-config/nvim/lua/plugins/treesitter.lua +++ b/nvim/dot-config/nvim/lua/plugins/treesitter.lua @@ -15,7 +15,22 @@ return { --- @module "nvim-treesitter" --- @type TSConfig opts = { - ensure_installed = require("tools.highlight"), + ensure_installed = { + "c", + "cpp", + "go", + "lua", + "python", + "rust", + "tsx", + "typescript", + "vimdoc", + "vim", + "markdown", + "markdown_inline", + "bash", + "sql", + }, highlight = { enable = true }, indent = { enable = true }, diff --git a/nvim/dot-config/nvim/lua/tools/format.lua b/nvim/dot-config/nvim/lua/tools/format.lua deleted file mode 100644 index 8ae65da..0000000 --- a/nvim/dot-config/nvim/lua/tools/format.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - c = { "clang-format" }, - cpp = { "clang-format" }, - go = { "goimports", "gofmt" }, - python = { "ruff_organize_imports", "ruff_format" }, - rust = { { "rustfmt", system = true } }, - javascript = { "prettierd" }, - javascriptreact = { "prettierd" }, - typescript = { "prettierd" }, - typescriptreact = { "prettierd" }, - css = { "prettierd" }, - markdown = { "prettierd" }, - yaml = { "prettierd" }, - lua = { "stylua" }, - json = { "jq" }, - toml = { "taplo" }, - -- ["*"] = { "injected" }, - ["_"] = { "trim_whitespace", "trim_newlines" }, -} diff --git a/nvim/dot-config/nvim/lua/tools/highlight.lua b/nvim/dot-config/nvim/lua/tools/highlight.lua deleted file mode 100644 index 076580a..0000000 --- a/nvim/dot-config/nvim/lua/tools/highlight.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "c", - "cpp", - "go", - "lua", - "python", - "rust", - "tsx", - "typescript", - "vimdoc", - "vim", - "markdown", - "markdown_inline", - "bash", - "sql", -} diff --git a/nvim/dot-config/nvim/lua/tools/lsp.lua b/nvim/dot-config/nvim/lua/tools/lsp.lua deleted file mode 100644 index e4de54e..0000000 --- a/nvim/dot-config/nvim/lua/tools/lsp.lua +++ /dev/null @@ -1,45 +0,0 @@ -return { - { - "rust_analyzer", - { - settings = { - ["rust-analyzer"] = { - check = { - command = "clippy", - }, - }, - }, - }, - system = "rust-analyzer", - }, - { "typos_lsp", { - init_options = { - diagnosticSeverity = "Hint", - }, - } }, - { "clangd", { - cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" }, - } }, - "basedpyright", - { - "lua_ls", - { - settings = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - }, - }, - }, - }, - { - "gopls", - condition = function() - return vim.fn.executable("go") > 0 - end, - }, - "jsonls", - "yamlls", - "taplo", - "neocmake", -}