From 5d4c51127c4baffa37757de9f5ec816adf4eb690 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 24 Jul 2022 17:00:09 +0000 Subject: [PATCH] clean stuff https://github.com/NvChad/ui/commit/5501044bfddb58ff43143fbda4b2c67141d0d90f --- lua/plugins/configs/nvchad_ui.lua | 40 ------------------------------- lua/plugins/configs/others.lua | 8 +++++++ lua/plugins/init.lua | 2 +- 3 files changed, 9 insertions(+), 41 deletions(-) delete mode 100644 lua/plugins/configs/nvchad_ui.lua diff --git a/lua/plugins/configs/nvchad_ui.lua b/lua/plugins/configs/nvchad_ui.lua deleted file mode 100644 index e19d87e..0000000 --- a/lua/plugins/configs/nvchad_ui.lua +++ /dev/null @@ -1,40 +0,0 @@ -local present, _ = pcall(require, "nvchad_ui") - -if not present then - return -end - -local options = { - - statusline = { - separator_style = "default", -- default/round/block/arrow - overriden_modules = nil, - }, - - -- lazyload it when there are 1+ buffers - tabufline = { - enabled = true, - lazyload = true, - overriden_modules = nil, - }, -} - -options = require("core.utils").load_override(options, "NvChad/ui") - -require "nvchad_ui.tabufline.lazyload"(options.tabufline) - --- ignore this as it might scare you XD -return { - statusline = function() - return require("nvchad_ui.statusline").setup(options) - end, - - tabufline = function() - return require("nvchad_ui.tabufline").setup(options) - end, - - load_ui_plugins = function() - vim.opt.statusline = "%!v:lua.require('plugins.configs.nvchad_ui').statusline()" - vim.opt.tabline = "%!v:lua.require('plugins.configs.nvchad_ui').tabufline()" - end, -} diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 0b2e255..3272f8a 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -2,6 +2,14 @@ local M = {} local load_override = require("core.utils").load_override +M.nvchad_ui = function() + local present, nvchad_ui = pcall(require, "nvchad_ui") + + if present then + nvchad_ui.setup() + end +end + M.autopairs = function() local present1, autopairs = pcall(require, "nvim-autopairs") local present2, cmp = pcall(require, "cmp") diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index f245359..729c0de 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -19,7 +19,7 @@ local plugins = { ["NvChad/ui"] = { after = "base46", config = function() - require("plugins.configs.nvchad_ui").load_ui_plugins() + require("plugins.configs.others").nvchad_ui() end, },