summaryrefslogtreecommitdiffstats
path: root/after/plugin/startpage.lua
diff options
context:
space:
mode:
Diffstat (limited to 'after/plugin/startpage.lua')
-rw-r--r--after/plugin/startpage.lua115
1 files changed, 0 insertions, 115 deletions
diff --git a/after/plugin/startpage.lua b/after/plugin/startpage.lua
deleted file mode 100644
index afd93dc..0000000
--- a/after/plugin/startpage.lua
+++ /dev/null
@@ -1,115 +0,0 @@
-local status_ok, alpha = pcall(require, "alpha")
-if not status_ok then
- return
-end
-
-local function button(sc, txt, cmd, kopts, opts)
- opts = opts or {
- position = "center",
- shortcut = sc:gsub("<leader>", "LDR"),
- cursor = 0,
- width = 49,
- align_shortcut = "right",
- hl_shortcut = "AlphaShortcut",
- hl = "AlphaText",
- }
- if cmd then
- kopts = kopts or { noremap = true, silent = true, nowait = true }
- opts.keymap = { "n", sc, cmd, kopts }
- end
-
- local function on_press()
- local key = vim.api.nvim_replace_termcodes(cmd, true, false, true)
- vim.api.nvim_feedkeys(key, "t", false)
- end
-
- return {
- type = "button",
- val = txt,
- opts = opts,
- on_press = on_press,
- }
-end
-
-local header = {
- '█▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ █▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ ',
- '█ ░█████▀▀▀▀▀█████▓▄ ▀▀▀▀ ░ ░█ ░█ ░█ █ ',
- '█ ▒███████ ▓███████ ▒██ ▓███ ▓███ ▓███ █ ',
- '█ ▓███████ ▓███████ ▓█████████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███ ██████████████ █ ',
- '█ ▓███████ ▓███████ ███▄██████████████ █ ',
- '█ ▓███████ ▓███████ ██████▀▀██████████ █ ',
- '▀ ▓███████ ▓███████▄ ▄▄███████████ █ ',
- '█ ▓███████ ██████████████████ █▄▄▄',
- '█ ▓███████▀▀ ▀ ▀ ▀████████████████▄ ▄ █',
- '█▄▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀▀▀▀▀▀▀█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█',
- ' █ ▀ █ ',
- ' ▀▀▀▀▀ ',
-}
-local footer = {
- '▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄',
-}
-
-alpha.setup {
- layout = {
- { type = 'text', val = function()
- local padding = {}
- for i = 1, math.floor((vim.api.nvim_win_get_height(0) - #header - 6 - #footer) / 2), 1 do
- table.insert(padding, " ")
- end
- return padding
- end },
- { type = 'text', val = header, opts = {
- position = 'center',
- hl = 'AlphaHeader',
- } },
- { type = 'padding', val = 1 },
- { type = 'group', val = {
- button('f', '? Find files', '<cmd>Telescope find_files<CR>'),
- button('r', '↺ Recent files', '<cmd>Telescope oldfiles <CR>'),
- button('n', '▣ Neorg workspace', '<cmd>Telescope neorg switch_workspace<CR>'),
- button('m', '≡ Menu', '<cmd>lua require("core.conf").configmenu()<CR>'),
- button('q', '✖ Quit', '<cmd>wqa<CR>'),
- } },
- { type = 'text', val = footer, opts = {
- position = 'center',
- hl = 'AlphaFooter',
- } },
- },
- opts = {
- keymap = {
- press = '<CR>',
- press_queue = nil
- },
- setup = function()
- vim.api.nvim_create_autocmd('User', {
- pattern = 'AlphaReady',
- desc = 'disable stuff for alpha',
- callback = function()
- vim.opt.laststatus = 0
- vim.opt.showtabline = 0
- vim.opt.more = false
- vim.opt.showcmd = false
- vim.opt.ruler = false
- vim.opt.number = false
- vim.opt.relativenumber = false
- end,
- })
- vim.api.nvim_create_autocmd('BufUnload', {
- buffer = 0,
- desc = 'enable stuff after alpha closes',
- callback = function()
- vim.opt.laststatus = 3
- vim.opt.showtabline = 2
- vim.opt.more = true
- vim.opt.showcmd = true
- vim.opt.ruler = true
- vim.opt.number = false
- vim.opt.relativenumber = false
- end,
- })
- end,
- }
-}