Repository navigation
Expand file tree
/
Copy pathui.lua
More file actions
190 lines (175 loc) · 8.53 KB
/
Copy pathui.lua
File metadata and controls
190 lines (175 loc) · 8.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
-- =============================================================================
-- UI PLUGINS
-- =============================================================================
-- Configures the visual appearance of mu-vim.
-- Includes:
-- 1. Catppuccin Mocha (Default colorscheme)
-- 2. Lualine (Aesthetic status line at the bottom)
-- 3. Alpha (Minimal startup dashboard with μ logo, buttons, and rotating tips)
-- =============================================================================
return {
-- --- 1. Colorscheme: Catppuccin ---
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000, -- Load this plugin first on startup
config = function()
require("catppuccin").setup({
flavour = "mocha", -- Mocha is the dark theme (non-negotiable)
transparent_background = true,
integrations = {
alpha = true,
cmp = true,
gitsigns = true,
indent_blankline = {
enabled = true,
scope_color = "lavender", -- highlight active indent with lavender
},
mason = true,
neotree = true,
treesitter = true,
which_key = true,
dap = true,
dap_ui = true,
},
})
-- Apply Catppuccin as the default colorscheme
vim.cmd.colorscheme("catppuccin-mocha")
end,
},
-- --- 2. Statusline: Lualine ---
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "catppuccin" },
config = function()
require("lualine").setup({
options = {
theme = "auto", -- dynamically match active colorscheme (Catppuccin)
component_separators = { left = "│", right = "│" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = { "alpha" }, -- Disable statusline on dashboard
},
},
sections = {
lualine_a = { { "mode", separator = { left = "", right = "" } } },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { { "filename", path = 1 } }, -- Path = 1 shows relative file path
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { { "location", separator = { left = "", right = "" } } },
},
})
end,
},
-- --- 3. Dashboard: Alpha-nvim ---
{
"goolord/alpha-nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = function()
local dashboard = require("alpha.themes.dashboard")
-- The stylized Greek letter mu (μ) header in Catppuccin Mocha Lavender
-- The custom logo with description strings
dashboard.section.header.val = {
" ",
" ██╗ ██╗ ██╗ ██╗██╗███╗ ███╗",
" ██║ ██║ ██║ ██║██║████╗ ████║ compact",
" ██║ ██║ █████╗ ██║ ██║██║██╔████╔██║ opinionated",
" ████████╔╝ ╚════╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ atomically customizable",
" ██╔═════╝ ╚████╔╝ ██║██║ ╚═╝ ██║ made with ♡",
" ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝",
" ",
}
-- Custom color highlighting for the header (Lavender)
vim.api.nvim_set_hl(0, "AlphaHeader", { fg = "#b4befe" })
dashboard.section.header.opts.hl = "AlphaHeader"
-- Quick access buttons
dashboard.section.buttons.val = {
dashboard.button("n", " New File", "<cmd>ene <BAR> startinsert <CR>"),
dashboard.button("f", " Find File", "<cmd>Telescope find_files<CR>"),
dashboard.button("r", " Recent Files", "<cmd>Telescope oldfiles<CR>"),
dashboard.button("q", " Quit", "<cmd>qa<CR>"),
}
-- Set color for buttons
vim.api.nvim_set_hl(0, "AlphaButtons", { fg = "#cdd6f4" })
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaHeader"
end
-- Curated rotating tips, resource links, and motivational lines
local tips = {
-- --- Vim Tips ---
"Tip: Learn motions like 'ciw' (change inner word) to edit text incredibly fast!",
"Tip: Use 'u' to undo, 'Ctrl+r' to redo. Undo history is saved to disk and persists!",
"Tip: Press 'Ctrl+h/j/k/l' to easily jump between open window splits.",
"Tip: Use 'Shift+h' and 'Shift+l' to cycle between active buffers (open files).",
"Tip: Press '<leader>e' to toggle the Neo-tree file sidebar explorer.",
"Tip: Type ':%s/old/new/g' to search and replace all instances of 'old' with 'new' in the file.",
"Tip: Learn 'd' followed by a motion to delete. e.g. 'dt,' deletes until a comma.",
"Tip: In visual mode, use '>' and '<' to shift code indentations without losing selection.",
"Tip: Use '*' to search for the word currently under your cursor.",
"Tip: Press 'gd' over a symbol to jump directly to its definition (LSP power!).",
"Tip: Use '<leader>ff' to find files instantly using Telescope search.",
"Tip: Press '<leader>ca' to open LSP Code Actions for quick refactoring fixes.",
"Tip: Running 'vimtutor' in your terminal is the absolute best way to learn basic Vim keys.",
"Tip: To comment lines, use 'gcc' in normal mode or 'gc' in visual mode.",
"Tip: Use '<leader>db' to set a debugging breakpoint, and '<leader>dc' to start debugging.",
"Tip: Toggle GitHub Copilot suggestions using '<leader>cp'.",
"Tip: Use '<leader>cc' to open the Copilot Chat interface.",
"Tip: Keep your hands on the home row! Use 'hjkl' instead of the arrow keys.",
-- --- Resource Links ---
"Resource: Run 'vimtutor' in your terminal to practice core movement skills.",
"Resource: Read the interactive tutorial at github.com/iggredible/Learn-Vim",
"Resource: Watch TJ DeVries' Youtube channel for Neovim deep dives & tips.",
"Resource: Watch Typecraft's 'Neovim for Beginners' series to master the editor.",
"Resource: Play Vim Adventures (vim-adventures.com) to gamify learning motions.",
"Resource: Browse the official documentation inside Neovim by typing ':help'.",
-- --- Motivational Lines ---
"Motivation: 'The only way to write fast code is to write code fast.' — Keep practicing!",
"Motivation: Every developer was once a beginner. Take it one shortcut at a time.",
"Motivation: Learning Vim keyboard motions is an investment that pays off for life!",
"Motivation: Customizing your editor is the programmer's ultimate superpower.",
}
-- Pick a random tip on launch
math.randomseed(os.time())
local random_index = math.random(1, #tips)
local selected_tip = tips[random_index]
-- Define custom tips section placed just below the logo
local tips_section = {
type = "text",
val = selected_tip,
opts = {
position = "center",
hl = "AlphaTips",
},
}
-- Set color for the tips (Peach / Warm Yellow highlight)
vim.api.nvim_set_hl(0, "AlphaTips", { fg = "#f9e2af", italic = true })
-- Set up the dynamic footer (using lazy.nvim statistics)
dashboard.section.footer.val = function()
local stats = require("lazy").stats()
local count = stats and stats.count or 0
local startuptime = stats and stats.startuptime or 0
local ms = (math.floor(startuptime * 100 + 0.5) / 100)
return "⚡ Loaded " .. count .. " plugins in " .. ms .. "ms"
end
-- Format footer style (Soft green color for load stats)
vim.api.nvim_set_hl(0, "AlphaFooter", { fg = "#a6e3a1", italic = true })
dashboard.section.footer.opts.hl = "AlphaFooter"
-- Reconstruct the layout to insert the tips section right below the header
dashboard.opts.layout = {
{ type = "padding", val = 2 },
dashboard.section.header,
{ type = "padding", val = 1 },
tips_section,
{ type = "padding", val = 2 },
dashboard.section.buttons,
dashboard.section.footer,
}
return dashboard
end,
config = function(_, dashboard)
require("alpha").setup(dashboard.opts)
end,
},
}