feat(ui): modernize nvim with fzf-lua, snacks dashboard, and p10k-style statusline
- Replace Snacks picker with fzf-lua for LSP navigation (gd, gr, gi, gt) - Add fzf-lua plugin with LSP-optimized settings - Fix Mason inconsistencies (add eslint, gopls to ensure_installed) - Replace alpha-nvim with Snacks dashboard (shared config) - Create dashboard_config.lua for DRY dashboard settings - Modernize lualine with p10k-rainbow style and solid backgrounds - Enhance bufferline with LSP diagnostics and modern styling - Update noice with centered cmdline/search and modern icons - Add global rounded borders for floating windows - Improve indent-blankline with scope highlighting - Add return-to-dashboard on last buffer close - Create performance_monitor module Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,56 +1,24 @@
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
enabled = true,
|
||||
enabled = false, -- Replaced by Snacks dashboard
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
local config = require("cargdev.core.dashboard_config")
|
||||
|
||||
-- 🚀 Set header
|
||||
dashboard.section.header.val = {
|
||||
" ██████╗ █████╗ ██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗ ",
|
||||
" █╔════╝██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔════╝██║ ██║ ",
|
||||
" █║ ███████║██████╔╝██║ ███╗██║ ██║█████╗ ██║ ██║ ",
|
||||
" █║ ██╔══██║██╔══██╗██║ ██║██║ ██║██╔══╝ ╚██╗ ██╔╝ ",
|
||||
" ██████╗██║ ██║██║ ██║╚██████╔╝██████╔╝███████╗ ╚████╔╝ ",
|
||||
" ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═══╝ ",
|
||||
" ",
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██╗ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
" ",
|
||||
" 🚀 Welcome to CarGDev Neovim - Customize Your Flow! 🚀 ",
|
||||
}
|
||||
-- Set header from shared config
|
||||
dashboard.section.header.val = config.header
|
||||
|
||||
-- 📂 Set menu with improved icons and performance tools
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", "🔎 Find File (Safe)", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("n", "📄 New File", "<cmd>ene<CR>"),
|
||||
dashboard.button("g", "📝 Find Text", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("r", "📚 Recent Files", "<cmd>Telescope oldfiles<CR>"),
|
||||
dashboard.button("t", "🌳 File Tree", "<cmd>NvimTreeToggle<CR>"),
|
||||
dashboard.button("c", "⚙️ Config", "<cmd>e ~/.config/nvim/init.lua<CR>"),
|
||||
dashboard.button("L", "🦥 Lazy", "<cmd>Lazy<CR>"),
|
||||
dashboard.button("p", "📊 Performance", "<cmd>lua require('cargdev.core.function.performance_monitor').check_performance()<CR>"),
|
||||
dashboard.button("l", "🔧 LSP Health", "<cmd>lua require('cargdev.core.function.performance_monitor').check_lsp_health()<CR>"),
|
||||
dashboard.button("s", "🧩 Sudoku", "<cmd>Sudoku<CR>"),
|
||||
dashboard.button("e", "💻 LeetCode", "<cmd>Leet<CR>"),
|
||||
dashboard.button("m", "🔨 Mason", "<cmd>Mason<CR>"),
|
||||
dashboard.button("q", "🚪 Quit", "<cmd>qa<CR>"),
|
||||
}
|
||||
-- Set menu from shared config
|
||||
dashboard.section.buttons.val = config.get_alpha_buttons(dashboard)
|
||||
|
||||
-- 🎯 Function to center text within a width
|
||||
-- Footer with fortune
|
||||
local function center_text(text, width)
|
||||
local padding = math.floor((width - #text) / 2)
|
||||
return padding > 0 and string.rep(" ", padding) .. text or text
|
||||
end
|
||||
|
||||
-- 📌 Function to wrap text at a specific width
|
||||
local function wrap_text(text, width)
|
||||
local wrapped_lines = {}
|
||||
for line in text:gmatch("[^\n]+") do
|
||||
@@ -64,48 +32,19 @@ return {
|
||||
return wrapped_lines
|
||||
end
|
||||
|
||||
-- 🖥 Set viewport width (adjust if necessary)
|
||||
local viewport_width = 50
|
||||
|
||||
-- 📝 Get a fortune quote and wrap it
|
||||
local handle = io.popen("fortune")
|
||||
local quote = handle and handle:read("*a") or "💻 Code, Create, Conquer with CarGDev 🚀"
|
||||
if handle then
|
||||
handle:close()
|
||||
end
|
||||
local quote = handle and handle:read("*a") or "Code, Create, Conquer with CarGDev"
|
||||
if handle then handle:close() end
|
||||
local wrapped_quote = wrap_text(quote:gsub("\n", " "), viewport_width)
|
||||
|
||||
-- 📝 Set the footer content with added spacing
|
||||
dashboard.section.footer.val = {
|
||||
"",
|
||||
center_text("🔧 CarGDev - Innovating with Neovim! 🔧", viewport_width),
|
||||
"",
|
||||
}
|
||||
|
||||
-- Add wrapped quote below separator
|
||||
dashboard.section.footer.val = { "", center_text("CarGDev - Innovating with Neovim!", viewport_width), "" }
|
||||
for _, line in ipairs(wrapped_quote) do
|
||||
table.insert(dashboard.section.footer.val, line)
|
||||
end
|
||||
|
||||
-- Add branding line at the bottom
|
||||
table.insert(dashboard.section.footer.val, "")
|
||||
table.insert(
|
||||
dashboard.section.footer.val,
|
||||
center_text("🎯 Stay productive & code with passion! 🚀", viewport_width)
|
||||
)
|
||||
table.insert(dashboard.section.footer.val, "")
|
||||
|
||||
-- 🌈 Apply modern styling
|
||||
dashboard.opts.opts = {
|
||||
position = "center",
|
||||
hl = "Statement",
|
||||
spacing = 2,
|
||||
}
|
||||
|
||||
-- 🚀 Load dashboard config
|
||||
dashboard.opts.opts = { position = "center", hl = "Statement", spacing = 2 }
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
-- 🔥 Disable folding on alpha buffer
|
||||
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user