Skip to content

Commit

Permalink
feat(fsplash-nvim): configure autocommands in AstroCore
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Mar 1, 2024
1 parent cf53ab4 commit 2b29654
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions lua/astrocommunity/startup/fsplash-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ 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,
dependencies = {
"AstroNvim/astrocore",
opts = {
autocmds = {
fsplash_autostart = {
{
event = "VimEnter",
desc = "Start fsplash when vim is opened with no arguments",
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,
},
},
},
},
},
opts = {
lines = {
" ___ __ _ __ _ ",
Expand All @@ -30,8 +37,9 @@ return {
" / ___ |(__ ) /_/ / / /_/ / /| /| |/ / / / / / / /",
"/_/ |_/____/\\__/_/ \\____/_/ |_/ |___/_/_/ /_/ /_/ ",
},
border = "none",
highlights = {
["NormalFloat"] = { link = "Normal" },
NormalFloat = { link = "Normal" },
},
},
},
Expand Down

0 comments on commit 2b29654

Please sign in to comment.