From 61b336c0309426f9aa21b63012d07bc1936a1c60 Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 25 Jun 2024 20:30:34 +0530 Subject: [PATCH] put all plugin specs in one file --- lua/nvchad/plugins/init.lua | 115 +++++++++++++++++++++++++++++++----- lua/nvchad/plugins/ui.lua | 85 -------------------------- 2 files changed, 99 insertions(+), 101 deletions(-) delete mode 100644 lua/nvchad/plugins/ui.lua diff --git a/lua/nvchad/plugins/init.lua b/lua/nvchad/plugins/init.lua index 0ac6750..1b4a9e8 100644 --- a/lua/nvchad/plugins/init.lua +++ b/lua/nvchad/plugins/init.lua @@ -1,5 +1,74 @@ return { + { + "NvChad/base46", + branch = "v2.5", + build = function() + require("base46").load_all_highlights() + end, + }, + + { + "NvChad/ui", + branch = "v2.5", + lazy = false, + config = function() + require "nvchad" + end, + }, + + { + "nvim-tree/nvim-web-devicons", + opts = function() + return { override = require "nvchad.icons.devicons" } + end, + config = function(_, opts) + dofile(vim.g.base46_cache .. "devicons") + require("nvim-web-devicons").setup(opts) + end, + }, + + { + "lukas-reineke/indent-blankline.nvim", + event = "User FilePost", + opts = { + indent = { char = "│", highlight = "IblChar" }, + scope = { char = "│", highlight = "IblScopeChar" }, + }, + config = function(_, opts) + dofile(vim.g.base46_cache .. "blankline") + + local hooks = require "ibl.hooks" + hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) + require("ibl").setup(opts) + + dofile(vim.g.base46_cache .. "blankline") + end, + }, + + -- file managing , picker etc + { + "nvim-tree/nvim-tree.lua", + cmd = { "NvimTreeToggle", "NvimTreeFocus" }, + opts = function() + return require "nvchad.configs.nvimtree" + end, + config = function(_, opts) + dofile(vim.g.base46_cache .. "nvimtree") + require("nvim-tree").setup(opts) + end, + }, + + { + "folke/which-key.nvim", + keys = { "", "", "", '"', "'", "`", "c", "v", "g" }, + cmd = "WhichKey", + config = function(_, opts) + dofile(vim.g.base46_cache .. "whichkey") + require("which-key").setup(opts) + end, + }, + "nvim-lua/plenary.nvim", -- formatting! @@ -15,21 +84,6 @@ return { end, }, - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPost", "BufNewFile" }, - cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, - build = ":TSUpdate", - opts = function() - 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, - }, - -- git stuff { "lewis6991/gitsigns.nvim", @@ -58,7 +112,7 @@ return { vim.api.nvim_create_user_command("MasonInstallAll", function() if opts.ensure_installed and #opts.ensure_installed > 0 then vim.cmd "Mason" - local mr = require("mason-registry") + local mr = require "mason-registry" mr.refresh(function() for _, tool in ipairs(opts.ensure_installed) do @@ -150,4 +204,33 @@ return { end end, }, + + { + "NvChad/nvim-colorizer.lua", + event = "User FilePost", + opts = { user_default_options = { names = false } }, + config = function(_, opts) + require("colorizer").setup(opts) + + -- execute colorizer as soon as possible + vim.defer_fn(function() + require("colorizer").attach_to_buffer(0) + end, 0) + end, + }, + + { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPost", "BufNewFile" }, + cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, + build = ":TSUpdate", + opts = function() + 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, + }, } diff --git a/lua/nvchad/plugins/ui.lua b/lua/nvchad/plugins/ui.lua deleted file mode 100644 index 28663b4..0000000 --- a/lua/nvchad/plugins/ui.lua +++ /dev/null @@ -1,85 +0,0 @@ -return { - - { - "NvChad/base46", - branch = "v2.5", - build = function() - require("base46").load_all_highlights() - end, - }, - - { - "NvChad/ui", - branch = "v2.5", - lazy = false, - config = function() - require "nvchad" - end, - }, - - { - "NvChad/nvim-colorizer.lua", - event = "User FilePost", - opts = { user_default_options = { names = false } }, - config = function(_, opts) - require("colorizer").setup(opts) - - -- execute colorizer as soon as possible - vim.defer_fn(function() - require("colorizer").attach_to_buffer(0) - end, 0) - end, - }, - - { - "nvim-tree/nvim-web-devicons", - opts = function() - return { override = require "nvchad.icons.devicons" } - end, - config = function(_, opts) - dofile(vim.g.base46_cache .. "devicons") - require("nvim-web-devicons").setup(opts) - end, - }, - - { - "lukas-reineke/indent-blankline.nvim", - event = "User FilePost", - opts = { - indent = { char = "│", highlight = "IblChar" }, - scope = { char = "│", highlight = "IblScopeChar" }, - }, - config = function(_, opts) - dofile(vim.g.base46_cache .. "blankline") - - local hooks = require "ibl.hooks" - hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) - require("ibl").setup(opts) - - dofile(vim.g.base46_cache .. "blankline") - end, - }, - - -- file managing , picker etc - { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, - opts = function() - return require "nvchad.configs.nvimtree" - end, - config = function(_, opts) - dofile(vim.g.base46_cache .. "nvimtree") - require("nvim-tree").setup(opts) - end, - }, - - { - "folke/which-key.nvim", - keys = { "", "", "", '"', "'", "`", "c", "v", "g" }, - cmd = "WhichKey", - config = function(_, opts) - dofile(vim.g.base46_cache .. "whichkey") - require("which-key").setup(opts) - end, - }, -}