Added dashboard plugin alpha.nvim
This commit is contained in:
56
after/plugin/alpha.lua
Normal file
56
after/plugin/alpha.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
local cdir = vim.fn.getcwd()
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
local function pick_color()
|
||||
local colors = { "String", "Identifier", "Keyword", "Number" }
|
||||
return colors[math.random(#colors)]
|
||||
end
|
||||
|
||||
local function footer()
|
||||
local total_plugins = #vim.tbl_keys(packer_plugins)
|
||||
local datetime = os.date(" %d-%m-%Y %H:%M:%S")
|
||||
local version = vim.version()
|
||||
local nvim_version_info = " v" .. version.major .. "." .. version.minor .. "." .. version.patch
|
||||
|
||||
return datetime .. " " .. total_plugins .. " plugins" .. nvim_version_info
|
||||
end
|
||||
|
||||
local logo = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
dashboard.section.header.val = logo
|
||||
dashboard.section.header.opts.hl = pick_color()
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("t", "🌳 NvimTree", ":NvimTreeToggle<CR>"),
|
||||
dashboard.button("c", "✨ Change Theme", "<cmd>Telescope colorscheme<CR>"),
|
||||
dashboard.button(
|
||||
"f",
|
||||
"🔎 Find Files",
|
||||
"<cmd>Telescope find_files<CR>"
|
||||
),
|
||||
dashboard.button("p", "✅ PackerSync", ":PackerSync<CR>"),
|
||||
dashboard.button("q", "🛑 Quit NVIM", ":qa<CR>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
dashboard.section.footer.opts.hl = "Constant"
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
vim.cmd([[ autocmd FileType alpha setlocal nofoldenable ]])
|
||||
@@ -107,6 +107,13 @@ return packer.startup(function(use)
|
||||
use("lewis6991/gitsigns.nvim")
|
||||
use("f-person/git-blame.nvim")
|
||||
-- useful plugins
|
||||
use({
|
||||
"goolord/alpha-nvim",
|
||||
requires = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("alpha").setup(require("alpha.themes.startify"))
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
|
||||
Reference in New Issue
Block a user