misc
This commit is contained in:
parent
7dc8c6d0b2
commit
73bf6c437f
17 changed files with 14 additions and 78 deletions
19
init.lua
19
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!!!')
|
||||
|
|
|
@ -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
|
|
@ -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()
|
|
@ -35,11 +35,11 @@ map("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Lsp diagnostic loclis
|
|||
map("n", "<leader>b", "<cmd>enew<CR>", { desc = "Buffer New" })
|
||||
|
||||
map("n", "<tab>", function()
|
||||
require("nvchad.tabufline").tabuflineNext()
|
||||
require("nvchad.tabufline").next()
|
||||
end, { desc = "Buffer Goto next" })
|
||||
|
||||
map("n", "<S-tab>", function()
|
||||
require("nvchad.tabufline").tabuflinePrev()
|
||||
require("nvchad.tabufline").prev()
|
||||
end, { desc = "Buffer Goto prev" })
|
||||
|
||||
map("n", "<leader>x", function()
|
|
@ -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
|
|
@ -3,7 +3,7 @@ return {
|
|||
event = "InsertEnter",
|
||||
|
||||
opts = function()
|
||||
return require "configs.cmp"
|
||||
return require "nvchad.configs.cmp"
|
||||
end,
|
||||
|
||||
config = function(_, opts)
|
|
@ -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)
|
|
@ -2,6 +2,6 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
event = "User FilePost",
|
||||
config = function()
|
||||
require("configs.lspconfig").defaults()
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
end,
|
||||
}
|
|
@ -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"
|
Loading…
Reference in a new issue