From 73bf6c437f1c73c85daab5c76ee016f3bbd1ddd7 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 4 Mar 2024 08:07:10 +0530 Subject: [PATCH] misc --- init.lua | 19 +--------- lua/core/bootstrap.lua | 47 ------------------------- lua/{core => nvchad}/autocmds.lua | 7 ++-- lua/{ => nvchad}/configs/cmp.lua | 0 lua/{ => nvchad}/configs/lazy.lua | 0 lua/{ => nvchad}/configs/lspconfig.lua | 0 lua/{core => nvchad}/mappings.lua | 4 +-- lua/{ => nvchad}/nvconfig.lua | 0 lua/{core => nvchad}/options.lua | 4 +-- lua/{ => nvchad}/plugins/cmp.lua | 2 +- lua/{ => nvchad}/plugins/gitsigns.lua | 1 + lua/{ => nvchad}/plugins/lsp.lua | 2 +- lua/{ => nvchad}/plugins/mason.lua | 0 lua/{ => nvchad}/plugins/nvimtree.lua | 0 lua/{ => nvchad}/plugins/telescope.lua | 0 lua/{ => nvchad}/plugins/treesitter.lua | 0 lua/{ => nvchad}/plugins/ui.lua | 6 ++-- 17 files changed, 14 insertions(+), 78 deletions(-) delete mode 100644 lua/core/bootstrap.lua rename lua/{core => nvchad}/autocmds.lua (90%) rename lua/{ => nvchad}/configs/cmp.lua (100%) rename lua/{ => nvchad}/configs/lazy.lua (100%) rename lua/{ => nvchad}/configs/lspconfig.lua (100%) rename lua/{core => nvchad}/mappings.lua (98%) rename lua/{ => nvchad}/nvconfig.lua (100%) rename lua/{core => nvchad}/options.lua (94%) rename lua/{ => nvchad}/plugins/cmp.lua (97%) rename lua/{ => nvchad}/plugins/gitsigns.lua (99%) rename lua/{ => nvchad}/plugins/lsp.lua (64%) rename lua/{ => nvchad}/plugins/mason.lua (100%) rename lua/{ => nvchad}/plugins/nvimtree.lua (100%) rename lua/{ => nvchad}/plugins/telescope.lua (100%) rename lua/{ => nvchad}/plugins/treesitter.lua (100%) rename lua/{ => nvchad}/plugins/ui.lua (95%) diff --git a/init.lua b/init.lua index 2e98038..3d8a6e5 100644 --- a/init.lua +++ b/init.lua @@ -1,18 +1 @@ -require "core.options" -require "core.autocmds" --- --- local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" --- --- -- bootstrap lazy.nvim! --- if not vim.loop.fs_stat(lazypath) then --- require("core.bootstrap").gen_chadrc_template() --- require("core.bootstrap").lazy(lazypath) --- end --- --- dofile(vim.g.base46_cache .. "defaults") --- vim.opt.rtp:prepend(lazypath) - --- require("lazy").setup({ --- { import = "plugins" }, --- { import = "custom.plugins" }, --- }, require "configs.lazy") +print('use this along starter!!!') diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua deleted file mode 100644 index 2871609..0000000 --- a/lua/core/bootstrap.lua +++ /dev/null @@ -1,47 +0,0 @@ -local M = {} -local fn = vim.fn - -M.echo = function(str) - vim.cmd "redraw" - vim.api.nvim_echo({ { str, "Bold" } }, true, {}) -end - -local function shell_call(args) - local output = fn.system(args) - assert(vim.v.shell_error == 0, "External call failed with error code: " .. vim.v.shell_error .. "\n" .. output) -end - -M.lazy = function(install_path) - ------------- base46 --------------- - local lazy_path = fn.stdpath "data" .. "/lazy/base46" - - M.echo " Compiling base46 theme to bytecode ..." - - local base46_repo = "https://github.com/NvChad/base46" - shell_call { "git", "clone", "--depth", "1", "-b", "v3.0", base46_repo, lazy_path } - vim.opt.rtp:prepend(lazy_path) - - require("base46").compile() - - --------- lazy.nvim --------------- - M.echo " Installing lazy.nvim & plugins ..." - local repo = "https://github.com/folke/lazy.nvim.git" - shell_call { "git", "clone", "--filter=blob:none", "--branch=stable", repo, install_path } - vim.opt.rtp:prepend(install_path) - - -- install plugins - require "plugins" - - -- mason packages & show post_bootstrap screen - vim.cmd "MasonInstallAll" - local lastpkg = vim.g.mason_binaries_list[#vim.g.mason_binaries_list] - - -- Keep track of which mason pkgs get installed - require("mason-registry"):on("package:install:success", function(pkg) - if tostring(pkg) == "Package(name=" .. lastpkg .. ")" then - print "All done! Now read nvchad.com " - end - end) -end - -return M diff --git a/lua/core/autocmds.lua b/lua/nvchad/autocmds.lua similarity index 90% rename from lua/core/autocmds.lua rename to lua/nvchad/autocmds.lua index fbc0f36..42c964a 100644 --- a/lua/core/autocmds.lua +++ b/lua/nvchad/autocmds.lua @@ -28,14 +28,15 @@ autocmd("BufWritePost", { -- statusline if config.ui.statusline.theme ~= "custom" then - require("plenary.reload").reload_module("nvchad.statusline." .. config.ui.statusline.theme) - vim.opt.statusline = "%!v:lua.require('nvchad.statusline." .. config.ui.statusline.theme .. "').run()" + require("plenary.reload").reload_module("nvchad.stl.utils") + require("plenary.reload").reload_module("nvchad.stl." .. config.ui.statusline.theme) + vim.opt.statusline = "%!v:lua.require('nvchad.stl." .. config.ui.statusline.theme .. "')()" end -- tabufline if config.ui.tabufline.enabled then require("plenary.reload").reload_module "nvchad.tabufline.modules" - vim.opt.tabline = "%!v:lua.require('nvchad.tabufline.modules').run()" + vim.opt.tabline = "%!v:lua.require('nvchad.tabufline.modules')()" end require("base46").load_all_highlights() diff --git a/lua/configs/cmp.lua b/lua/nvchad/configs/cmp.lua similarity index 100% rename from lua/configs/cmp.lua rename to lua/nvchad/configs/cmp.lua diff --git a/lua/configs/lazy.lua b/lua/nvchad/configs/lazy.lua similarity index 100% rename from lua/configs/lazy.lua rename to lua/nvchad/configs/lazy.lua diff --git a/lua/configs/lspconfig.lua b/lua/nvchad/configs/lspconfig.lua similarity index 100% rename from lua/configs/lspconfig.lua rename to lua/nvchad/configs/lspconfig.lua diff --git a/lua/core/mappings.lua b/lua/nvchad/mappings.lua similarity index 98% rename from lua/core/mappings.lua rename to lua/nvchad/mappings.lua index cb1a279..ba80b4f 100644 --- a/lua/core/mappings.lua +++ b/lua/nvchad/mappings.lua @@ -35,11 +35,11 @@ map("n", "q", vim.diagnostic.setloclist, { desc = "Lsp diagnostic loclis map("n", "b", "enew", { desc = "Buffer New" }) map("n", "", function() - require("nvchad.tabufline").tabuflineNext() + require("nvchad.tabufline").next() end, { desc = "Buffer Goto next" }) map("n", "", function() - require("nvchad.tabufline").tabuflinePrev() + require("nvchad.tabufline").prev() end, { desc = "Buffer Goto prev" }) map("n", "x", function() diff --git a/lua/nvconfig.lua b/lua/nvchad/nvconfig.lua similarity index 100% rename from lua/nvconfig.lua rename to lua/nvchad/nvconfig.lua diff --git a/lua/core/options.lua b/lua/nvchad/options.lua similarity index 94% rename from lua/core/options.lua rename to lua/nvchad/options.lua index bd7f2be..b7e5ad0 100644 --- a/lua/core/options.lua +++ b/lua/nvchad/options.lua @@ -2,7 +2,7 @@ local opt = vim.opt local g = vim.g -------------------------------------- globals ----------------------------------------- -g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" +-- g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/" g.toggle_theme_icon = "  " -------------------------------------- options ------------------------------------------ @@ -47,7 +47,7 @@ opt.updatetime = 250 -- when cursor reaches end/beginning of line opt.whichwrap:append "<>[]hl" -g.mapleader = " " +-- g.mapleader = " " -- disable some default providers vim.g["loaded_node_provider"] = 0 diff --git a/lua/plugins/cmp.lua b/lua/nvchad/plugins/cmp.lua similarity index 97% rename from lua/plugins/cmp.lua rename to lua/nvchad/plugins/cmp.lua index 978d7e7..44fb8be 100644 --- a/lua/plugins/cmp.lua +++ b/lua/nvchad/plugins/cmp.lua @@ -3,7 +3,7 @@ return { event = "InsertEnter", opts = function() - return require "configs.cmp" + return require "nvchad.configs.cmp" end, config = function(_, opts) diff --git a/lua/plugins/gitsigns.lua b/lua/nvchad/plugins/gitsigns.lua similarity index 99% rename from lua/plugins/gitsigns.lua rename to lua/nvchad/plugins/gitsigns.lua index 8f9fb6c..ca7c70b 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/nvchad/plugins/gitsigns.lua @@ -27,6 +27,7 @@ return { "lewis6991/gitsigns.nvim", event = "User FilePost", opts = options, + config = function(_, opts) dofile(vim.g.base46_cache .. "git") require("gitsigns").setup(opts) diff --git a/lua/plugins/lsp.lua b/lua/nvchad/plugins/lsp.lua similarity index 64% rename from lua/plugins/lsp.lua rename to lua/nvchad/plugins/lsp.lua index b55658f..e42fa1a 100644 --- a/lua/plugins/lsp.lua +++ b/lua/nvchad/plugins/lsp.lua @@ -2,6 +2,6 @@ return { "neovim/nvim-lspconfig", event = "User FilePost", config = function() - require("configs.lspconfig").defaults() + require("nvchad.configs.lspconfig").defaults() end, } diff --git a/lua/plugins/mason.lua b/lua/nvchad/plugins/mason.lua similarity index 100% rename from lua/plugins/mason.lua rename to lua/nvchad/plugins/mason.lua diff --git a/lua/plugins/nvimtree.lua b/lua/nvchad/plugins/nvimtree.lua similarity index 100% rename from lua/plugins/nvimtree.lua rename to lua/nvchad/plugins/nvimtree.lua diff --git a/lua/plugins/telescope.lua b/lua/nvchad/plugins/telescope.lua similarity index 100% rename from lua/plugins/telescope.lua rename to lua/nvchad/plugins/telescope.lua diff --git a/lua/plugins/treesitter.lua b/lua/nvchad/plugins/treesitter.lua similarity index 100% rename from lua/plugins/treesitter.lua rename to lua/nvchad/plugins/treesitter.lua diff --git a/lua/plugins/ui.lua b/lua/nvchad/plugins/ui.lua similarity index 95% rename from lua/plugins/ui.lua rename to lua/nvchad/plugins/ui.lua index 6366f45..0c5fad3 100644 --- a/lua/plugins/ui.lua +++ b/lua/nvchad/plugins/ui.lua @@ -3,8 +3,7 @@ return { { "NvChad/base46", - -- branch = "v3.0", - dir = "~/projects/base46/", + branch = "v3.0", build = function() require("base46").load_all_highlights() end, @@ -12,8 +11,7 @@ return { { "NvChad/ui", - -- branch = "v3.0", - dir = "~/projects/ui/", + branch = "v3.0", lazy = false, config = function() require "nvchad"