Overview
Alpha provides a customizable dashboard that displays when you launch Neovim. This configuration creates a welcoming startup screen with quick access to common actions.
Plugin: alpha-nvim
Config File: lua/user/alpha.lua
Features
- Custom ASCII art header
- Quick action buttons
- Custom footer text
- Automatic theme loading
Configuration
The configuration displays a custom Neovim ASCII art logo:
dashboard.section.header.val = {
[[ __ ]],
[[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
[[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
[[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
}
The dashboard includes seven convenient shortcuts:
| Key | Icon | Action | Description |
|---|
f | ๐ | Find file | Opens Telescope file finder |
e | ๐ | New file | Creates a new empty buffer |
p | ๐ | Find project | Opens Telescope projects |
r | ๐ | Recently used files | Shows recent files |
t | ๐ | Find text | Opens live grep search |
c | โ๏ธ | Configuration | Opens init.lua |
q | โ | Quit Neovim | Exits Neovim |
dashboard.section.buttons.val = {
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("p", " Find project", ":Telescope projects <CR>"),
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
dashboard.button("t", "๓ฑธ Find text", ":Telescope live_grep <CR>"),
dashboard.button("c", " Configuration", ":e $MYVIMRC <CR>"),
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
}
The footer displays a custom message (default: โchrisatmachine.comโ):
local function footer()
return "chrisatmachine.com"
end
dashboard.section.footer.val = footer()
The configuration includes commented code for displaying fortune quotes. Uncomment this section if you have fortune-mod installed on your system.
Highlight Groups
The dashboard uses custom highlight groups for styling:
dashboard.section.footer.opts.hl = "Type"
dashboard.section.header.opts.hl = "Include"
dashboard.section.buttons.opts.hl = "Keyword"
Customization
Replace the ASCII art with your own design:
dashboard.section.header.val = {
[[ YOUR CUSTOM ]],
[[ ASCII ART ]],
[[ HERE ]],
}
Add new quick actions:
dashboard.section.buttons.val = {
-- ... existing buttons ...
dashboard.button("s", " Settings", ":e ~/.config/nvim/lua/user/options.lua <CR>"),
}
Enable Fortune Quotes
Uncomment the fortune function for random quotes:
local function footer()
local handle = io.popen("fortune")
local fortune = handle:read("*a")
handle:close()
return fortune
end
Manual Trigger
Open the Alpha dashboard manually:
Or use the which-key binding:
- Which-Key - Provides
<leader>a shortcut
- Telescope - Powers the file and text search buttons