From 157010c499aeda8d2eda6bf85e41c88031026c6a Mon Sep 17 00:00:00 2001 From: Felipe Contreras Salinas Date: Sat, 13 Jul 2024 21:35:24 -0400 Subject: [PATCH] move lsp to autostart and fix neotest startup --- .gitmodules | 7 +++++-- init.lua | 10 +++------- pack/general/opt/nvim-nio | 1 + pack/general/{opt => start}/lsp_lines.nvim | 0 pack/general/{opt => start}/nvim-lspconfig | 0 5 files changed, 9 insertions(+), 9 deletions(-) create mode 160000 pack/general/opt/nvim-nio rename pack/general/{opt => start}/lsp_lines.nvim (100%) rename pack/general/{opt => start}/nvim-lspconfig (100%) diff --git a/.gitmodules b/.gitmodules index de40046..f0fc9f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,7 +7,7 @@ url = https://github.com/rktjmp/lush.nvim branch = main [submodule "pack/general/start/nvim-lspconfig"] - path = pack/general/opt/nvim-lspconfig + path = pack/general/start/nvim-lspconfig url = https://github.com/neovim/nvim-lspconfig branch = master [submodule "pack/general/start/nvim-treesitter"] @@ -126,7 +126,7 @@ url = https://github.com/chrisgrieser/nvim-spider branch = main [submodule "pack/general/opt/lsp_lines.nvim"] - path = pack/general/opt/lsp_lines.nvim + path = pack/general/start/lsp_lines.nvim url = https://git.sr.ht/~whynothugo/lsp_lines.nvim [submodule "pack/general/opt/lsp-timeout.nvim"] path = pack/general/opt/lsp-timeout.nvim @@ -152,3 +152,6 @@ [submodule "pack/general/start/conform.nvim"] path = pack/general/start/conform.nvim url = https://github.com/stevearc/conform.nvim +[submodule "pack/general/opt/nvim-nio"] + path = pack/general/opt/nvim-nio + url = https://github.com/nvim-neotest/nvim-nio diff --git a/init.lua b/init.lua index 4611b87..4005b45 100644 --- a/init.lua +++ b/init.lua @@ -176,7 +176,7 @@ require("nvim-treesitter.configs").setup({ }, highlight = { enable = true, indent = true }, playground = { - enable = true, + enable = false, disable = {}, updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code persist_queries = false, -- Whether the query persists across vim sessions @@ -282,10 +282,6 @@ cmp.setup({ }), }) ---- LSP ---- -vim.cmd("packadd nvim-lspconfig") -vim.cmd("packadd lsp_lines.nvim") --- vim.cmd("packadd lsp-timeout.nvim") - local lsp = require("lspconfig") -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer @@ -303,7 +299,7 @@ local on_lsp_attach = function(_client, _bufnr) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) vim.keymap.set("n", "]d", vim.diagnostic.goto_next) vim.keymap.set("n", "q", vim.diagnostic.setloclist) - -- vim.keymap.segcjk("n", "", function() + -- vim.keymap.set("n", "", function() -- vim.lsp.buf.format({ async = true }) -- end) end @@ -369,7 +365,6 @@ for server, add_to_config in pairs(servers) do end lsp[server].setup(config) end -vim.cmd("LspStart") ---- lsp_lines require("lsp_lines").setup() @@ -684,6 +679,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { return end vim.g.neotest_loaded = true + vim.cmd("packadd nvim-nio") vim.cmd("packadd neotest") vim.cmd("packadd neotest-rust") diff --git a/pack/general/opt/nvim-nio b/pack/general/opt/nvim-nio new file mode 160000 index 0000000..a428f30 --- /dev/null +++ b/pack/general/opt/nvim-nio @@ -0,0 +1 @@ +Subproject commit a428f309119086dc78dd4b19306d2d67be884eee diff --git a/pack/general/opt/lsp_lines.nvim b/pack/general/start/lsp_lines.nvim similarity index 100% rename from pack/general/opt/lsp_lines.nvim rename to pack/general/start/lsp_lines.nvim diff --git a/pack/general/opt/nvim-lspconfig b/pack/general/start/nvim-lspconfig similarity index 100% rename from pack/general/opt/nvim-lspconfig rename to pack/general/start/nvim-lspconfig