Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(startup): add fsplash plugin #221

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lua/astrocommunity/startup/fsplash-nvim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# fsplash.nvim

**Repository:** https://github.com/jovanlanik/fsplash.nvim

Show a custom splash screen in a floating window

**Note:** This plugin will also disable the Alpha dashboard by default
38 changes: 38 additions & 0 deletions lua/astrocommunity/startup/fsplash-nvim/fsplash.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
return {
{ "goolord/alpha-nvim", enabled = false },
{
"jovanlanik/fsplash.nvim",
init = function()
vim.api.nvim_create_autocmd("VimEnter", {
desc = "Start fsplash when vim is opened with no arguments",
group = vim.api.nvim_create_augroup("fsplash_autostart", { clear = true }),
callback = function()
local should_skip = false
if vim.fn.argc() > 0 or vim.fn.line2byte(vim.fn.line "$") ~= -1 or not vim.o.modifiable then
should_skip = true
else
for _, arg in pairs(vim.v.argv) do
if arg == "-b" or arg == "-c" or vim.startswith(arg, "+") or arg == "-S" then
should_skip = true
break
end
end
end
if not should_skip then require("fsplash").open_window() end
end,
})
end,
opts = {
lines = {
" ___ __ _ __ _ ",
" / | _____/ /__________ / | / / __(_)___ ___ ",
" / /| | / ___/ __/ ___/ __ \\/ |/ / | / / / __ `__ \\",
" / ___ |(__ ) /_/ / / /_/ / /| /| |/ / / / / / / /",
"/_/ |_/____/\\__/_/ \\____/_/ |_/ |___/_/_/ /_/ /_/ ",
},
highlights = {
["NormalFloat"] = { link = "Normal" },
},
},
},
}