From 293c4965df99ead3c855a425cf56cf40e3eac8f6 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr / DashieTM Date: Sat, 18 Nov 2023 00:55:43 +0100 Subject: [PATCH] chore: Remove neovim clutter --- nvim/lua/config/autocmds.lua | 19 -------- nvim/lua/config/lazy.lua | 7 ++- nvim/lua/plugins/lsp.lua | 90 ---------------------------------- nvim/lua/plugins/plugins.lua | 95 ------------------------------------ 4 files changed, 6 insertions(+), 205 deletions(-) delete mode 100644 nvim/lua/config/autocmds.lua diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua deleted file mode 100644 index d68377c..0000000 --- a/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,19 +0,0 @@ -vim.api.nvim_create_autocmd("LspAttach", { - callback = function(ev) - local client = vim.lsp.get_client_by_id(ev.data.client_id) - local function toSnakeCase(str) - return string.gsub(str, "%s*[- ]%s*", "_") - end - - if client.name == "omnisharp" then - local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers - for i, v in ipairs(tokenModifiers) do - tokenModifiers[i] = toSnakeCase(v) - end - local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes - for i, v in ipairs(tokenTypes) do - tokenTypes[i] = toSnakeCase(v) - end - end - end, -}) diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 50a2ce0..e9179d5 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -16,6 +16,7 @@ require("lazy").setup({ { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "lazyvim.plugins.extras.lang.rust" }, { import = "lazyvim.plugins.extras.lang.java" }, + { import = "lazyvim.plugins.extras.lang.go" }, { import = "lazyvim.plugins.extras.lang.clangd" }, { import = "lazyvim.plugins.extras.lang.typescript" }, { import = "lazyvim.plugins.extras.lang.python" }, @@ -24,9 +25,12 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.lang.omnisharp" }, { import = "lazyvim.plugins.extras.lang.tailwind" }, { import = "lazyvim.plugins.extras.lang.json" }, + { import = "lazyvim.plugins.extras.lang.tex" }, { import = "lazyvim.plugins.extras.util.dot" }, - { import = "lazyvim.plugins.extras.test.core" }, { import = "lazyvim.plugins.extras.ui.alpha" }, + { import = "lazyvim.plugins.extras.dap.core" }, + { import = "lazyvim.plugins.extras.test.core" }, + { import = "lazyvim.plugins.extras.ui.edgy" }, { import = "plugins" }, { import = "plugins.plugins" }, }, @@ -41,6 +45,7 @@ require("lazy").setup({ rtp = { disabled_plugins = { "gzip", + "netrw", "tarPlugin", "tohtml", "tutor", diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 603bc0a..39513fb 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -3,7 +3,6 @@ return { "neovim/nvim-lspconfig", ---@class PluginLspOpts opts = { - -- options for vim.diagnostic.config() diagnostics = { underline = true, update_in_insert = false, @@ -22,101 +21,17 @@ return { -- LSP Server Settings ---@type lspconfig.options servers = { - jsonls = {}, - tailwindcss = {}, cssls = {}, html = {}, - clangd = { - root_pattern = { - ".clangd", - ".clang-tidy", - ".clang-format", - "compile_commands.json", - "compile_flags.txt", - "configure.ac", - ".git", - "build/compile_commands.json", - }, - filetypes = { - "c", - "cpp", - "objc", - "objcpp", - "cuda", - "proto", - "cl", - }, - }, - pyright = {}, - cmake = {}, bashls = {}, ansiblels = {}, - marksman = {}, asm_lsp = {}, - omnisharp = { - handlers = { - ["textDocument/definition"] = function(...) - return require("omnisharp_extended").handler(...) - end, - }, - inlayHintsOptions = { - enableForParameters = true, - forLiteralParameters = true, - forIndexerParameters = true, - forObjectCreationParameters = true, - forOtherParameters = true, - suppressForParametersThatDifferOnlyBySuffix = false, - suppressForParametersThatMatchMethodIntent = false, - suppressForParametersThatMatchArgumentName = false, - enableForTypes = true, - forImplicitVariableTypes = true, - forLambdaParameterTypes = true, - forImplicitObjectCreation = true, - }, - enable_roslyn_analyzers = true, - organize_imports_on_format = true, - enable_import_completion = true, - }, - rnix = {}, - rust_analyzer = { - diagnostics = { - enable = true, - experimental = true, - }, - }, - tsserver = { - settings = { - typescript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - javascript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - }, - }, typst_lsp = { settings = { experimentalFormatterMode = "on", exportPdf = "onSave", }, }, - texlab = {}, ltex = { settings = { ltex = { @@ -158,11 +73,6 @@ return { }, }, }, - setup = { - jdtls = function() - return true - end, - }, }, init = function() local keys = require("lazyvim.plugins.lsp.keymaps").get() diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index c1bb195..383815f 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -168,101 +168,6 @@ return { { "mg979/vim-visual-multi", }, - { - "rouge8/neotest-rust", - }, - { - "Issafalcon/neotest-dotnet", - }, - { - "andy-bell101/neotest-java", - }, - { - "nvim-neotest/neotest-go", - }, - { - "nvim-neotest/neotest-python", - }, - { - "nvim-neotest/neotest", - dependencies = { - "rouge8/neotest-rust", - "Issafalcon/neotest-dotnet", - "andy-bell101/neotest-java", - "nvim-neotest/neotest-go", - "nvim-neotest/neotest-python", - }, - opts = { - adapters = { - ["neotest-rust"] = {}, - ["neotest-dotnet"] = {}, - ["neotest-java"] = {}, - ["neotest-go"] = {}, - ["neotest-python"] = {}, - }, - status = { virtual_text = true }, - output = { open_on_run = true }, - quickfix = { - open = function() - if require("lazyvim.util").has("trouble.nvim") then - vim.cmd("Trouble quickfix") - else - vim.cmd("copen") - end - end, - }, - }, - config = function(_, opts) - local neotest_ns = vim.api.nvim_create_namespace("neotest") - vim.diagnostic.config({ - virtual_text = { - format = function(diagnostic) - -- Replace newline and tab characters with space for more compact diagnostics - local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") - return message - end, - }, - }, neotest_ns) - - if opts.adapters then - local adapters = {} - for name, config in pairs(opts.adapters or {}) do - if type(name) == "number" then - if type(config) == "string" then - config = require(config) - end - adapters[#adapters + 1] = config - elseif config ~= false then - local adapter = require(name) - if type(config) == "table" and not vim.tbl_isempty(config) then - local meta = getmetatable(adapter) - if adapter.setup then - adapter.setup(config) - elseif meta and meta.__call then - adapter(config) - else - error("Adapter " .. name .. " does not support setup") - end - end - adapters[#adapters + 1] = adapter - end - end - opts.adapters = adapters - end - - require("neotest").setup(opts) - end, - -- stylua: ignore - keys = { - { "tT", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, - { "tt", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, - { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, - { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, - { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, - { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, - { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, - }, - }, { "barreiroleo/ltex_extra.nvim", ft = { "markdown", "tex", "typst", "typ" },