summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/configs/lspconfig.lua
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2025-02-13 14:13:49 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2025-02-13 14:13:49 +0530
commit8a2e1006b3b272126332aa064f3ad95387129544 (patch)
tree944c80ac612a65980d94a54ba11b6c7102037ecf /.config/nvim/lua/configs/lspconfig.lua
parentdcbb16d8b08ff5956abef5e6478b59df2e93ad35 (diff)
downloaddotfiles-8a2e1006b3b272126332aa064f3ad95387129544.tar.gz
dotfiles-8a2e1006b3b272126332aa064f3ad95387129544.tar.bz2
dotfiles-8a2e1006b3b272126332aa064f3ad95387129544.zip
new dot filesHEADmaster
Diffstat (limited to '.config/nvim/lua/configs/lspconfig.lua')
-rw-r--r--.config/nvim/lua/configs/lspconfig.lua67
1 files changed, 67 insertions, 0 deletions
diff --git a/.config/nvim/lua/configs/lspconfig.lua b/.config/nvim/lua/configs/lspconfig.lua
new file mode 100644
index 0000000..34c2fb5
--- /dev/null
+++ b/.config/nvim/lua/configs/lspconfig.lua
@@ -0,0 +1,67 @@
+-- load defaults i.e lua_lsp
+require("nvchad.configs.lspconfig").defaults()
+
+local lspconfig = require "lspconfig"
+
+-- EXAMPLE
+local servers = { "html", "cssls" }
+local nvlsp = require "nvchad.configs.lspconfig"
+local spell_words = {}
+
+-- lsps with default config
+for _, lsp in ipairs(servers) do
+ lspconfig[lsp].setup {
+ on_attach = nvlsp.on_attach,
+ on_init = nvlsp.on_init,
+ capabilities = nvlsp.capabilities,
+ }
+end
+
+lspconfig.ltex.setup({
+ settings = {
+ ltex = {
+ language = "en-US",
+ enabled = true,
+ dictionary = {
+ ["en-US"] = spell_words,
+ },
+ },
+ },
+})
+
+lspconfig.eslint.setup({
+ on_attach = function(client, bufnr)
+ vim.api.nvim_create_autocmd("BufWritePre", {
+ buffer = bufnr,
+ command = "EslintFixAll",
+ })
+ end,
+})
+
+lspconfig.rust_analyzer.setup {
+ -- server-specific settings. See ':help lspconfig-setup'
+ settings = {
+ ['rust_analyzer'] = {},
+ },
+}
+
+lspconfig.basedpyright.setup {
+ cmd = { "basedpyright-langserver", "--stdio" },
+ filetypes = { "python" },
+ settings = {
+ basedpright = {
+ analysis = {
+ autoSearchPaths = true,
+ diagnosticMode = "openFilesOnly",
+ uuseLibraryCodeForTypes = true
+ },
+ },
+ },
+}
+
+-- configuring single server, example: typescript
+-- lspconfig.tsserver.setup {
+-- on_attach = nvlsp.on_attach,
+-- on_init = nvlsp.on_init,
+-- capabilities = nvlsp.capabilities,
+-- }