misc & cleanup

This commit is contained in:
siduck
2023-03-08 18:57:54 +05:30
parent a3ea8a9f4d
commit 0aafb002b5
5 changed files with 33 additions and 55 deletions

View File

@@ -16,12 +16,11 @@ M.lazy = function(install_path)
-- install plugins + compile their configs
require "plugins"
require("lazy").load { plugins = { "nvim-treesitter" } }
-- install binaries from mason.nvim & tsparsers on LazySync
vim.schedule(function()
vim.api.nvim_buf_delete(0, { force = true }) -- close lazy window
vim.defer_fn(function()
vim.cmd "silent! MasonInstallAll"
-- print success message
end, 0)
end
@@ -31,7 +30,6 @@ M.gen_chadrc_template = function()
vim.cmd "redraw|echo ''"
if input == "y" then
-- clone example_config repo
print "cloning chadrc starter template repo...."
vim.fn.system {
@@ -50,6 +48,21 @@ M.gen_chadrc_template = function()
vim.loop.fs_rmdir(vim.fn.stdpath "config" .. "/lua/custom/.git")
vim.notify "successfully installed chadrc template!"
vim.cmd "redraw|echo ''"
else
local custom_dir = vim.fn.stdpath "config" .. "/lua/custom/"
vim.fn.mkdir(custom_dir, "p")
local str = [[
local M = {}
M.ui = {
theme = "onedark",
}
return M
]]
local file = io.open(custom_dir .. "chadrc.lua", "w")
file:write(str)
file:close()
end
end
end