From a8d5eb9b41fe41d9a5d2d641c4e65e784ca825df Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Wed, 24 May 2023 15:33:52 -0400 Subject: [PATCH] feat(startup): add fsplash plugin --- .../startup/fsplash-nvim/README.md | 7 ++++ .../startup/fsplash-nvim/fsplash.lua | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 lua/astrocommunity/startup/fsplash-nvim/README.md create mode 100644 lua/astrocommunity/startup/fsplash-nvim/fsplash.lua diff --git a/lua/astrocommunity/startup/fsplash-nvim/README.md b/lua/astrocommunity/startup/fsplash-nvim/README.md new file mode 100644 index 000000000..c52adecb2 --- /dev/null +++ b/lua/astrocommunity/startup/fsplash-nvim/README.md @@ -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 diff --git a/lua/astrocommunity/startup/fsplash-nvim/fsplash.lua b/lua/astrocommunity/startup/fsplash-nvim/fsplash.lua new file mode 100644 index 000000000..287cacfd0 --- /dev/null +++ b/lua/astrocommunity/startup/fsplash-nvim/fsplash.lua @@ -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" }, + }, + }, + }, +}