Skip to content

Commit

Permalink
feat(pack): add an NvChad UI pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Oct 3, 2024
1 parent baeee61 commit 577f559
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/astrocommunity/pack/nvchad-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NvChad/ui

Lightweight & high performance UI plugin for nvchad

**Repository:** <https://github.com/NvChad/ui>
230 changes: 230 additions & 0 deletions lua/astrocommunity/pack/nvchad-ui/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
return {
"NvChad/ui",
opts = {
base46 = {
theme = "onedark", -- default theme
hl_add = {},
hl_override = {},
integrations = {},
changed_themes = {},
transparency = false,
theme_toggle = { "onedark", "one_light" },
},

ui = {
cmp = {
icons_left = false, -- only for non-atom styles!
lspkind_text = true,
style = "default", -- default/flat_light/flat_dark/atom/atom_colored
format_colors = {
tailwind = false, -- will work for css lsp too
icon = "󱓻",
},
},

telescope = { style = "borderless" }, -- borderless / bordered

statusline = {
theme = "default", -- default/vscode/vscode_colored/minimal
-- default/round/block/arrow separators work only for default statusline theme
-- round and block will work for minimal theme only
separator_style = "default",
order = nil,
modules = nil,
},

-- lazyload it when there are 1+ buffers
tabufline = {
enabled = true,
lazyload = true,
order = { "treeOffset", "buffers", "tabs", "btns" },
modules = nil,
},
},

nvdash = {
load_on_startup = false,
header = {
" ",
" ▄▄ ▄ ▄▄▄▄▄▄▄ ",
" ▄▀███▄ ▄██ █████▀ ",
" ██▄▀███▄ ███ ",
" ███ ▀███▄ ███ ",
" ███ ▀██ ███ ",
" ███ ▀ ███ ",
" ▀██ █████▄▀█▀▄██████▄ ",
" ▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ",
" ",
"  Powered By  eovim ",
" ",
},

buttons = {
{ txt = " Find File", keys = "Spc f f", cmd = "Telescope find_files" },
{ txt = " Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" },
{ txt = "󰈭 Find Word", keys = "Spc f w", cmd = "Telescope live_grep" },
{ txt = "󱥚 Themes", keys = "Spc t h", cmd = ":lua require('nvchad.themes').open()" },
{ txt = " Mappings", keys = "Spc c h", cmd = "NvCheatsheet" },

{ txt = "", hl = "NvDashLazy", no_gap = true, rep = true },

{
txt = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime) .. " ms"
return " Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms
end,
hl = "NvDashLazy",
no_gap = true,
},

{ txt = "", hl = "NvDashLazy", no_gap = true, rep = true },
},
},

term = {
winopts = { number = false, relativenumber = false },
sizes = { sp = 0.3, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 },
float = {
relative = "editor",
row = 0.3,
col = 0.25,
width = 0.5,
height = 0.4,
border = "single",
},
},

lsp = { signature = true },

cheatsheet = {
theme = "grid", -- simple/grid
excluded_groups = { "terminal (t)", "autopairs", "Nvim", "Opens" }, -- can add group name or with mode
},

mason = { pkgs = {} },

colorify = {
enabled = true,
mode = "virtual", -- fg, bg, virtual
virt_text = "󱓻 ",
highlight = { hex = true, lspvars = true },
},
},
init = function()
-- load the lazy opts on module load
package.preload["chadrc"] = function()
local plugin = require("lazy.core.config").spec.plugins["ui"]
return require("lazy.core.plugin").values(plugin, "opts", false) -- resolve mini.clue options
end
end,
config = function()
pcall(function()
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
end)
require "nvchad"
end,
specs = {
-- Disable unnecessary plugins
{ "rebelot/heirline.nvim", opts = { statusline = false, tabline = false } },
{ "goolord/alpha-nvim", enabled = false },
{ "brenoprata10/nvim-highlight-colors", enabled = false },
{ "NvChad/nvim-colorizer.lua", enabled = false },
{ "AstroNvim/astrocore", opts = { options = { opt = { showtabline = 0 } } } },
-- add lazy loaded dependencies
{ "nvim-lua/plenary.nvim", lazy = true },
{ "NvChad/volt", lazy = true },
{ "NvChad/minty", lazy = true },
{ "NvChad/menu", lazy = true },
{
"nvchad/base46",
lazy = true,
init = function() vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46_cache/" end,
build = function() require("base46").load_all_highlights() end,
-- load base46 cache when necessary
specs = {
{
"nvim-treesitter/nvim-treesitter",
optional = true,
opts = function()
pcall(function()
dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")
end)
end,
},
{
"folke/which-key.nvim",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "whichkey") end)
end,
},
{
"lukas-reineke/indent-blankline.nvim",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "blankline") end)
end,
},
{
"nvim-telescope/telescope.nvim",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "telescope") end)
end,
},
{
"neovim/nvim-lspconfig",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "lsp") end)
end,
},
{
"nvim-tree/nvim-tree.lua",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "nvimtree") end)
end,
},
{
"williamboman/mason.nvim",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "mason") end)
end,
},
{
"lewis6991/gitsigns.nvim",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "git") end)
end,
},
{
"nvim-tree/nvim-web-devicons",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "devicons") end)
end,
},
{
"echasnovski/mini.icons",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "devicons") end)
end,
},
{
"hrsh7th/nvim-cmp",
optional = true,
opts = function()
pcall(function() dofile(vim.g.base46_cache .. "cmp") end)
end,
},
},
},
},
}

0 comments on commit 577f559

Please sign in to comment.