From 72fc5aacb7c07b382817ed2e1862d23ba13fe0ad Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 14 Aug 2024 05:06:30 +0545 Subject: [PATCH] revert to aplha plugin --- lazy-lock.json | 20 +++++--- lua/plugins/alpha.lua | 107 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 lua/plugins/alpha.lua diff --git a/lazy-lock.json b/lazy-lock.json index 7622429..f935e75 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,33 +1,41 @@ { "LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" }, + "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, + "alpha-nvim": { "branch": "main", "commit": "355fbb81a59637a8963cf5847074f8c44dbef11f" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, + "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "github-preview.nvim": { "branch": "main", "commit": "b1f286a0c2c5bfcc0fea467decbb73e657428065" }, + "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim": { "branch": "main", "commit": "18bab5ec4c782cdf7d7525dbe89c60bfa02fc195" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-lspconfig": { "branch": "master", "commit": "ff97d376b1d22b2eaf9274605531babf0cd0cf21" }, + "nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" }, + "nvim-lspconfig": { "branch": "master", "commit": "a67bc39aaa4f1e13212c5022a561120846eaef27" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "e5a05ba5e298cc1e1dad8eb8095b8d4d89a7f793" }, + "nvim-treesitter": { "branch": "master", "commit": "047ce49ccf9a2dce22e1cf3843bef3b5682a8144" }, + "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "refactoring.nvim": { "branch": "master", "commit": "c406fc5fb4d7ba5fce7b668637075fad6e75e9f8" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, + "termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" }, "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "1420fb9e07b1d80cc6d87e7d90827fb2c1109cb3" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } } diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..8e3e534 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,107 @@ +--- @type LazyPluginSpec +return { + "goolord/alpha-nvim", + event = "VimEnter", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = function() + local dashboard = require("alpha.themes.dashboard") + require("alpha.term") + local arttoggle = false + + local logo = { + [[ ]], + [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]], + [[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]], + [[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]], + [[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]], + [[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]], + [[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], + [[ ]], + } + + local art = { + -- { name, width, height } + { "tohru", 62, 17 }, + } + + if arttoggle == true then + dashboard.opts.opts.noautocmd = true + dashboard.section.terminal.opts.redraw = true + local path = vim.fn.stdpath("config") .. "/assets/" + -- local random = math.random(1, #art) + local currentart = art[1] + dashboard.section.terminal.command = "cat " .. path .. currentart[1] + + dashboard.section.terminal.width = currentart[2] + dashboard.section.terminal.height = currentart[3] + + dashboard.opts.layout = { + dashboard.section.terminal, + { type = "padding", val = 2 }, + dashboard.section.buttons, + dashboard.section.footer, + } + else + dashboard.section.header.val = logo + end + dashboard.section.buttons.val = { + dashboard.button("ff", " " .. " Find files", ":Telescope find_files "), + dashboard.button("of", " " .. " Recent files", ":Telescope oldfiles "), + dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy "), + dashboard.button("q", " " .. " Quit", ":q "), + } + for _, button in ipairs(dashboard.section.buttons.val) do + button.opts.hl = "AlphaButtons" + button.opts.hl_shortcut = "AlphaShortcut" + end + dashboard.section.header.opts.hl = "Function" + dashboard.section.buttons.opts.hl = "Identifier" + dashboard.section.footer.opts.hl = "Function" + dashboard.opts.layout[1].val = 4 + return dashboard + end, + config = function(_, dashboard) + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "AlphaReady", + callback = function() + require("lazy").show() + end, + }) + end + require("alpha").setup(dashboard.opts) + vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimStarted", + callback = function() + local v = vim.version() + local dev = "" + if v.prerelease == "dev" then + dev = "-dev+" .. v.build + else + dev = "" + end + local version = v.major .. "." .. v.minor .. "." .. v.patch .. dev + local stats = require("lazy").stats() + local plugins_count = stats.loaded .. "/" .. stats.count + local ms = math.floor(stats.startuptime + 0.5) + local time = vim.fn.strftime("%H:%M:%S") + local date = vim.fn.strftime("%d.%m.%Y") + local line1 = " " .. plugins_count .. " plugins loaded in " .. ms .. "ms" + local line2 = "󰃭 " .. date .. "  " .. time + local line3 = " " .. version + + local line1_width = vim.fn.strdisplaywidth(line1) + local line2Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line2)) / 2) .. line2 + local line3Padded = string.rep(" ", (line1_width - vim.fn.strdisplaywidth(line3)) / 2) .. line3 + + dashboard.section.footer.val = { + line1, + line2Padded, + line3Padded, + } + pcall(vim.cmd.AlphaRedraw) + end, + }) + end, +}