From 230b6c867e46d944c3c0cc48ca92b02c8bbbc171 Mon Sep 17 00:00:00 2001 From: siduck Date: Thu, 27 Jun 2024 09:28:14 +0530 Subject: [PATCH] minor refactoring moved the lsp.signature to ui repo to be available for non-nvchad users too --- lua/nvchad/configs/gitsigns.lua | 2 ++ lua/nvchad/configs/lspconfig.lua | 8 +------- lua/nvchad/configs/mason.lua | 4 +++- lua/nvchad/configs/nvimtree.lua | 2 ++ lua/nvchad/configs/telescope.lua | 2 ++ lua/nvchad/configs/treesitter.lua | 3 +++ lua/nvchad/options.lua | 4 ++-- lua/nvchad/plugins/init.lua | 6 ------ 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lua/nvchad/configs/gitsigns.lua b/lua/nvchad/configs/gitsigns.lua index 27f3105..dc4c6e9 100644 --- a/lua/nvchad/configs/gitsigns.lua +++ b/lua/nvchad/configs/gitsigns.lua @@ -1,3 +1,5 @@ +dofile(vim.g.base46_cache .. "git") + local options = { signs = { add = { text = "│" }, diff --git a/lua/nvchad/configs/lspconfig.lua b/lua/nvchad/configs/lspconfig.lua index 2274aa2..75ea277 100644 --- a/lua/nvchad/configs/lspconfig.lua +++ b/lua/nvchad/configs/lspconfig.lua @@ -1,9 +1,8 @@ local M = {} local map = vim.keymap.set -local conf = require("nvconfig").ui.lsp -- export on_attach & capabilities -M.on_attach = function(client, bufnr) +M.on_attach = function(_, bufnr) local function opts(desc) return { buffer = bufnr, desc = "LSP " .. desc } end @@ -27,11 +26,6 @@ M.on_attach = function(client, bufnr) map({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts "Code action") map("n", "gr", vim.lsp.buf.references, opts "Show references") - - -- setup signature popup - if conf.signature and client.server_capabilities.signatureHelpProvider then - require("nvchad.lsp.signature").setup(client, bufnr) - end end -- disable semanticTokens diff --git a/lua/nvchad/configs/mason.lua b/lua/nvchad/configs/mason.lua index a87f593..9078818 100644 --- a/lua/nvchad/configs/mason.lua +++ b/lua/nvchad/configs/mason.lua @@ -1,5 +1,7 @@ +dofile(vim.g.base46_cache .. "mason") + local options = { - ensure_installed = { "lua-language-server", 'stylua' }, -- not an option from mason.nvim + ensure_installed = { "lua-language-server", "stylua" }, -- not an option from mason.nvim PATH = "skip", diff --git a/lua/nvchad/configs/nvimtree.lua b/lua/nvchad/configs/nvimtree.lua index da68148..8b8578d 100644 --- a/lua/nvchad/configs/nvimtree.lua +++ b/lua/nvchad/configs/nvimtree.lua @@ -1,3 +1,5 @@ +dofile(vim.g.base46_cache .. "nvimtree") + local options = { filters = { dotfiles = false, diff --git a/lua/nvchad/configs/telescope.lua b/lua/nvchad/configs/telescope.lua index ebfe009..612a097 100644 --- a/lua/nvchad/configs/telescope.lua +++ b/lua/nvchad/configs/telescope.lua @@ -1,3 +1,5 @@ +dofile(vim.g.base46_cache .. "telescope") + local options = { defaults = { vimgrep_arguments = { diff --git a/lua/nvchad/configs/treesitter.lua b/lua/nvchad/configs/treesitter.lua index 0453b33..870ac24 100644 --- a/lua/nvchad/configs/treesitter.lua +++ b/lua/nvchad/configs/treesitter.lua @@ -1,3 +1,6 @@ +dofile(vim.g.base46_cache .. "syntax") +dofile(vim.g.base46_cache .. "treesitter") + local options = { ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" }, diff --git a/lua/nvchad/options.lua b/lua/nvchad/options.lua index f3c722d..d91a45e 100644 --- a/lua/nvchad/options.lua +++ b/lua/nvchad/options.lua @@ -55,7 +55,7 @@ g["loaded_perl_provider"] = 0 g["loaded_ruby_provider"] = 0 -- add binaries installed by mason.nvim to path -local is_windows = vim.fn.has("win32") ~= 0 +local is_windows = vim.fn.has "win32" ~= 0 local sep = is_windows and "\\" or "/" local delim = is_windows and ";" or ":" -vim.env.PATH = table.concat({vim.fn.stdpath "data", "mason", "bin"}, sep) .. delim .. vim.env.PATH +vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH diff --git a/lua/nvchad/plugins/init.lua b/lua/nvchad/plugins/init.lua index 1b4a9e8..aa6abc9 100644 --- a/lua/nvchad/plugins/init.lua +++ b/lua/nvchad/plugins/init.lua @@ -54,7 +54,6 @@ return { return require "nvchad.configs.nvimtree" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "nvimtree") require("nvim-tree").setup(opts) end, }, @@ -92,7 +91,6 @@ return { return require "nvchad.configs.gitsigns" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "git") require("gitsigns").setup(opts) end, }, @@ -105,7 +103,6 @@ return { return require "nvchad.configs.mason" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "mason") require("mason").setup(opts) -- custom nvchad cmd to install all mason binaries listed @@ -194,7 +191,6 @@ return { return require "nvchad.configs.telescope" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "telescope") local telescope = require "telescope" telescope.setup(opts) @@ -228,8 +224,6 @@ return { return require "nvchad.configs.treesitter" end, config = function(_, opts) - dofile(vim.g.base46_cache .. "syntax") - dofile(vim.g.base46_cache .. "treesitter") require("nvim-treesitter.configs").setup(opts) end, },