From 5da6e0a36aa78bab0cf09e9b0b781e38c3192da1 Mon Sep 17 00:00:00 2001 From: Camilo Davila Date: Sat, 6 Apr 2024 05:40:38 -0500 Subject: [PATCH] feat(startup): add mini-starter plugin (#836) * feat(mini-starter): add mini-starter plugin * fix(mini-starter): Mark astrocore as optional --------- Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> --- .../startup/mini-starter/README.md | 5 ++++ .../startup/mini-starter/init.lua | 30 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 lua/astrocommunity/startup/mini-starter/README.md create mode 100644 lua/astrocommunity/startup/mini-starter/init.lua diff --git a/lua/astrocommunity/startup/mini-starter/README.md b/lua/astrocommunity/startup/mini-starter/README.md new file mode 100644 index 000000000..9b53785fe --- /dev/null +++ b/lua/astrocommunity/startup/mini-starter/README.md @@ -0,0 +1,5 @@ +# Mini-Starter + +Neovim Lua plugin with fast and flexible start screen. Part of 'mini.nvim' library. + +**Repository**: diff --git a/lua/astrocommunity/startup/mini-starter/init.lua b/lua/astrocommunity/startup/mini-starter/init.lua new file mode 100644 index 000000000..b6dbfbd3c --- /dev/null +++ b/lua/astrocommunity/startup/mini-starter/init.lua @@ -0,0 +1,30 @@ +return { + { "goolord/alpha-nvim", enabled = false }, + { + "echasnovski/mini.starter", + version = "*", -- stable version + config = function() require("mini.starter").setup() end, + }, + { + "AstroNvim/astrocore", + optional = true, + ---@type AstroCoreOpts + opts = { + mappings = { + n = { + ["c"] = { + function() + local bufs = vim.fn.getbufinfo { buflisted = true } + require("astrocore.buffer").close(0) + if require("astrocore").is_available "mini.starter" and not bufs[2] then + require("mini.starter").open() + require("astrocore.buffer").close_all(true) -- remove empty buffer + end + end, + desc = "Close buffer", + }, + }, + }, + }, + }, +}