goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.78k stars 104 forks source link

Add a module that generates the header based on the git directory your in. #206

Open twiclo opened 1 year ago

twiclo commented 1 year ago
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
local ascii = require("alpha.ascii")                          

dashboard.section.header.val = git_or("neovim", "ansi_shadow")

https://asciinema.org/a/55ia2ygqn6KD30GhToZ44F8fX

git_or will look to the parent directory of a git repo and generate a header for that. If not in a git repo it will default to the first argument. The second argument is the font. I only put one in but more can be added later. Looking for input on if storing the "font" this way is a good idea.

twiclo commented 1 year ago

I'm also looking for pointers on the best way to set the preferred case. All lower, all caps, or leave as is