From 8a2e1006b3b272126332aa064f3ad95387129544 Mon Sep 17 00:00:00 2001
From: Biswakalyan Bhuyan <biswa@surgot.in>
Date: Thu, 13 Feb 2025 14:13:49 +0530
Subject: new dot files

---
 .config/nvim/lua/configs/conform.lua   | 15 ++++++++
 .config/nvim/lua/configs/lazy.lua      | 47 ++++++++++++++++++++++++
 .config/nvim/lua/configs/lspconfig.lua | 67 ++++++++++++++++++++++++++++++++++
 3 files changed, 129 insertions(+)
 create mode 100644 .config/nvim/lua/configs/conform.lua
 create mode 100644 .config/nvim/lua/configs/lazy.lua
 create mode 100644 .config/nvim/lua/configs/lspconfig.lua

(limited to '.config/nvim/lua/configs')

diff --git a/.config/nvim/lua/configs/conform.lua b/.config/nvim/lua/configs/conform.lua
new file mode 100644
index 0000000..35ba6cf
--- /dev/null
+++ b/.config/nvim/lua/configs/conform.lua
@@ -0,0 +1,15 @@
+local options = {
+  formatters_by_ft = {
+    lua = { "stylua" },
+    -- css = { "prettier" },
+    -- html = { "prettier" },
+  },
+
+  -- format_on_save = {
+  --   -- These options will be passed to conform.format()
+  --   timeout_ms = 500,
+  --   lsp_fallback = true,
+  -- },
+}
+
+return options
diff --git a/.config/nvim/lua/configs/lazy.lua b/.config/nvim/lua/configs/lazy.lua
new file mode 100644
index 0000000..cd170bd
--- /dev/null
+++ b/.config/nvim/lua/configs/lazy.lua
@@ -0,0 +1,47 @@
+return {
+  defaults = { lazy = true },
+  install = { colorscheme = { "nvchad" } },
+
+  ui = {
+    icons = {
+      ft = "",
+      lazy = "󰂠 ",
+      loaded = "",
+      not_loaded = "",
+    },
+  },
+
+  performance = {
+    rtp = {
+      disabled_plugins = {
+        "2html_plugin",
+        "tohtml",
+        "getscript",
+        "getscriptPlugin",
+        "gzip",
+        "logipat",
+        "netrw",
+        "netrwPlugin",
+        "netrwSettings",
+        "netrwFileHandlers",
+        "matchit",
+        "tar",
+        "tarPlugin",
+        "rrhelper",
+        "spellfile_plugin",
+        "vimball",
+        "vimballPlugin",
+        "zip",
+        "zipPlugin",
+        "tutor",
+        "rplugin",
+        "syntax",
+        "synmenu",
+        "optwin",
+        "compiler",
+        "bugreport",
+        "ftplugin",
+      },
+    },
+  },
+}
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,
+-- }
-- 
cgit v1.2.3-59-g8ed1b