From 8f4b09ef0365cbba82889e88f83b5642572bd881 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 29 Jul 2024 05:36:46 +0530 Subject: [PATCH] rm mason.ensure_installed & clean some conf --- lua/chadrc.lua | 2 +- lua/configs/conform.lua | 2 +- lua/configs/lspconfig.lua | 27 ++++++++++++++------------- lua/plugins/init.lua | 29 ++++++++--------------------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 2b575e1..9668de5 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -4,7 +4,7 @@ ---@type ChadrcConfig local M = {} -M.ui = { +M.base46 = { theme = "onedark", -- hl_override = { diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index a000447..35ba6cf 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -12,4 +12,4 @@ local options = { -- }, } -require("conform").setup(options) +return options diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index a73657a..9bdfbf3 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -1,23 +1,24 @@ --- EXAMPLE -local on_attach = require("nvchad.configs.lspconfig").on_attach -local on_init = require("nvchad.configs.lspconfig").on_init -local capabilities = require("nvchad.configs.lspconfig").capabilities +-- 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" -- lsps with default config for _, lsp in ipairs(servers) do lspconfig[lsp].setup { - on_attach = on_attach, - on_init = on_init, - capabilities = capabilities, + on_attach = nvlsp.on_attach, + on_init = nvlsp.on_init, + capabilities = nvlsp.capabilities, } end --- typescript -lspconfig.tsserver.setup { - on_attach = on_attach, - on_init = on_init, - capabilities = capabilities, -} +-- configuring single server, example: typescript +-- lspconfig.tsserver.setup { +-- on_attach = on_attach, +-- on_init = on_init, +-- capabilities = capabilities, +-- } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e62d896..6474776 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -2,30 +2,17 @@ return { { "stevearc/conform.nvim", -- event = 'BufWritePre', -- uncomment for format on save - config = function() - require "configs.conform" - end, + opts = require "configs.conform", }, -- These are some examples, uncomment them if you want to see them work! - -- { - -- "neovim/nvim-lspconfig", - -- config = function() - -- require("nvchad.configs.lspconfig").defaults() - -- require "configs.lspconfig" - -- end, - -- }, - -- - -- { - -- "williamboman/mason.nvim", - -- opts = { - -- ensure_installed = { - -- "lua-language-server", "stylua", - -- "html-lsp", "css-lsp" , "prettier" - -- }, - -- }, - -- }, - -- + { + "neovim/nvim-lspconfig", + config = function() + require "configs.lspconfig" + end, + }, + -- { -- "nvim-treesitter/nvim-treesitter", -- opts = {