From febc9ee925beb5be64f8249b3d63cc851758467f Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 15:24:11 -0400 Subject: [PATCH] feat(nvim): disable rust extra, manually configure lsp --- user/modules/nvim/lazyvim.json | 2 +- user/modules/nvim/lua/config/lazy.lua | 3 ++- user/modules/nvim/lua/plugins/lsp.lua | 35 +++++++++++++++++++++------ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/user/modules/nvim/lazyvim.json b/user/modules/nvim/lazyvim.json index 971da55..f03853f 100644 --- a/user/modules/nvim/lazyvim.json +++ b/user/modules/nvim/lazyvim.json @@ -1,6 +1,6 @@ { "extras": [ - "lazyvim.plugins.extras.lang.rust" + ], "news": { "NEWS.md": "3314" diff --git a/user/modules/nvim/lua/config/lazy.lua b/user/modules/nvim/lua/config/lazy.lua index 6f29dbd..9b0516e 100644 --- a/user/modules/nvim/lua/config/lazy.lua +++ b/user/modules/nvim/lua/config/lazy.lua @@ -11,7 +11,8 @@ require("lazy").setup({ -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins", opts = { colorscheme = "gruvbox" } }, -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.rust" }, -- { import = "lazyvim.plugins.extras.lang.json" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins diff --git a/user/modules/nvim/lua/plugins/lsp.lua b/user/modules/nvim/lua/plugins/lsp.lua index dde9307..64090b9 100644 --- a/user/modules/nvim/lua/plugins/lsp.lua +++ b/user/modules/nvim/lua/plugins/lsp.lua @@ -1,17 +1,30 @@ return { { "neovim/nvim-lspconfig", - ---@class PluginLspOpts opts = { - ---@type lspconfig.options - ---@diagnostic disable-next-line: missing-fields servers = { - ---@diagnostic disable-next-line: missing-fields - tsserver = {}, - ---@diagnostic disable-next-line: missing-fields - eslint = {}, - nil_ls = {}, + rust_analyzer = {}, + taplo = { + keys = { + { + "K", + function() + if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then + require("crates").show_popup() + else + vim.lsp.buf.hover() + end + end, + desc = "Show Crate Documentation", + }, + }, + }, }, + -- setup = { + -- rust_analyzer = function() + -- return true + -- end, + -- }, }, }, { @@ -64,4 +77,10 @@ return { { "rush-rs/tree-sitter-asm", }, + { + "imsnif/kdl.vim", + }, + { + "andreshazard/vim-freemarker", + }, }