Bohdan's terminal configuration

refactored lspconfig

bpavuk 4d0ce07d a203bad3

Changed files
+28 -35
nvim
.config
nvim
lua
configs
+28 -35
nvim/.config/nvim/lua/configs/lspconfig.lua
··· 1 - local configs = require "nvchad.configs.lspconfig" 1 + require("nvchad.configs.lspconfig").defaults() 2 2 3 3 local servers = { 4 - html = { 5 - filetypes = { "html", "htmldjango", "superhtml" } 4 + "html", 5 + "cssls", 6 + "somesass_ls", 7 + "bashls", 8 + "clangd", 9 + "slint_lsp", 10 + "pyright", 11 + } 12 + vim.lsp.enable(servers) 13 + 14 + vim.lsp.config('html', { 15 + filetypes = { "html", "htmldjango", "superhtml" } 16 + }) 17 + vim.lsp.config('somesass_ls', { 18 + root_dir = function(...) 19 + return require("lspconfig.util").root_pattern ".git"(...) 20 + end, 21 + init_options = { 22 + workspace = root_dir, 6 23 }, 7 - cssls = {}, 8 - somesass_ls = { 9 - root_dir = function(...) 10 - return require("lspconfig.util").root_pattern ".git"(...) 11 - end, 12 - init_options = { 13 - workspace = root_dir, 14 - }, 15 - }, 16 - bashls = {}, 17 - clangd = {}, 24 + }) 18 25 19 - slint_lsp = {}, 20 - 21 - pyright = { 22 - settings = { 23 - python = { 24 - analysis = { 25 - autoSearchPaths = true, 26 - typeCheckingMode = "basic", 27 - }, 26 + vim.lsp.config('pyright', { 27 + settings = { 28 + python = { 29 + analysis = { 30 + autoSearchPaths = true, 31 + typeCheckingMode = "basic", 28 32 }, 29 33 }, 30 34 }, 31 - 32 - asm_lsp = {}, 33 - rnix = {}, 34 - } 35 - 36 - for name, opts in pairs(servers) do 37 - opts.on_init = configs.on_init 38 - opts.on_attach = configs.on_attach 39 - opts.capabilities = configs.capabilities 40 - 41 - require("lspconfig")[name].setup(opts) 42 - end 35 + })