diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 993a330..cbab769 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -40,4 +40,4 @@ "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }, "window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" } -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index aa8ec4d..8489cff 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -67,8 +67,21 @@ return { { "hrsh7th/cmp-nvim-lsp" }, { "williamboman/mason-lspconfig.nvim" }, { "williamboman/mason.nvim" }, + { "VonHeikemen/lsp-zero.nvim", } }, config = function() + local lsp_zero = require('lsp-zero') + + local lsp_attach = function(client, bufnr) + -- this is where you enable features that only work + -- if there is a language server active in the file + end + + lsp_zero.extend_lspconfig({ + sign_text = true, + lsp_attach = lsp_attach, + }) + require('mason').setup({}) require('mason-lspconfig').setup({ -- Replace the language servers listed here @@ -82,28 +95,26 @@ return { }, handlers = { function(server_name) - require('lspconfig')[server_name].setup({}) + lsp_config = {} + + if server_name == "pylsp" then + lsp_config = { + settings = { + pylsp = { + plugins = { + mypy = { enabled = true }, + black = { enabled = true }, + isort = { enabled = true, profile = "black" }, + }, + }, + }, + } + end + + require('lspconfig')[server_name].setup(lsp_config) end, } }) - - local nvim_lsp = require("lspconfig") - - nvim_lsp.lua_ls.setup({}) - nvim_lsp.gopls.setup({}) - nvim_lsp.dartls.setup({}) - nvim_lsp.ts_ls.setup({}) - nvim_lsp.pylsp.setup({ - settings = { - pylsp = { - plugins = { - mypy = { enabled = true }, - black = { enabled = true }, - isort = { enabled = true, profile = "black" }, - }, - }, - }, - }) - end, + end }, } diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index db31433..a96b9fe 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -148,27 +148,28 @@ return { event = "VeryLazy", opts = { plugins = { spelling = true }, - defaults = { - mode = { "n", "v" }, - ["g"] = { name = "+goto" }, - ["gz"] = { name = "+surround" }, - ["]"] = { name = "+next" }, - ["["] = { name = "+prev" }, - ["b"] = { name = "+buffer" }, - ["c"] = { name = "+colors" }, - ["l"] = { name = "+lsp" }, - ["f"] = { name = "+file/find" }, - ["g"] = { name = "+git" }, - ["h"] = { name = "+harpoon" }, - ["u"] = { name = "+ui" }, - ["w"] = { name = "+windows" }, - ["x"] = { name = "+diagnostics/quickfix" }, - }, }, config = function(_, opts) local wk = require("which-key") - wk.setup(opts) - wk.register(opts.defaults) + wk.add( + { + mode = { "n", "v" }, + { "b", group = "buffer" }, + { "c", group = "colors" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "h", group = "harpoon" }, + { "l", group = "lsp" }, + { "u", group = "ui" }, + { "w", group = "windows" }, + { "x", group = "diagnostics/quickfix" }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gz", group = "surround" }, + } + + ) end, }, {