Skip to content

Commit

Permalink
feat(startup): add fsplash plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed May 24, 2023
1 parent e6501af commit a8d5eb9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
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" },
},
},
},
}

0 comments on commit a8d5eb9

Please sign in to comment.