all repos

init.lua @ 5fa3b15d882301af8837eb71b75236da74ad6191

my nvim config
3 files changed, 79 insertions(+), 1 deletions(-)
adds startup dashbord
Author: flof-ik ss2316544@gmail.com
Committed at: 2022-02-17 18:07:39 +0200
Parent: 41349dd
M lua/plugin.lua

@@ -17,6 +17,7 @@ use { "TimUntersberger/neogit", cmd = "Neogit", config = get_config "neogit" }

use { "numToStr/Comment.nvim", keys = { "gc" }, config = get_config "Comment" } use { "folke/lua-dev.nvim", config = get_config "lua-dev", ft = "lua" } use { "folke/todo-comments.nvim", config = get_config "todo-comments" } + use { "goolord/alpha-nvim", config = get_config "plugin.alpha" } use { "windwp/nvim-autopairs",
A lua/plugin/alpha.lua

@@ -0,0 +1,77 @@

+local M = {} + +local function button(sc, txt, keybind, keybind_opts) + local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>") + local opts = { + cursor = 5, + width = 50, + shortcut = sc, + position = "center", + hl_shortcut = "Keyword", + align_shortcut = "right", + } + if keybind then + keybind_opts = vim.F.if_nil(keybind_opts, { noremap = true, silent = true, nowait = true }) + opts.keymap = { "n", sc_, keybind, keybind_opts } + end + + local function on_press() + local key = vim.api.nvim_replace_termcodes(sc_ .. "<Ignore>", true, false, true) + vim.api.nvim_feedkeys(key, "normal", false) + end + + return { + val = txt, + opts = opts, + type = "button", + on_press = on_press, + } +end + +function M.setup() + local alpha = require "alpha" + + local section = { + header = { + type = "text", + opts = { position = "center", hl = "String" }, + val = { + [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠀⠀⠀⡀⡢⢂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢄⢮⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠀⡠⡂⣊⠢⡑⡐⠄⠀⠀⠀⠀⠀⠀⢀⢔⡕⣕⢗⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠢⠨⢢⠢⡃⡪⡐⡑⢄⠀⠀⠀⠀⢰⢱⡣⣫⢪⢮⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⡑⠅⢅⠣⡊⡢⡊⢌⠢⡂⡀⠀⠀⢐⢧⢳⢕⢧⢳⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠪⡨⠢⠡⡑⠰⡘⡌⡪⡂⡆⠄⠀⢐⡕⣗⢕⡗⡵⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠕⢌⠪⡨⢌⠀⠘⡰⡑⡌⡪⡊⣂⠀⡯⣪⡳⣹⡪⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠕⡅⠕⢌⠢⠀⠀⠀⢕⢅⢇⢕⢒⢬⢺⢕⢽⢜⢮⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⢕⢘⠜⢌⠪⠀⠀⠀⠀⠪⡢⡣⡣⡣⡳⣹⢕⢯⡳⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⢕⢅⢣⢑⠕⠀⠀⠀⠀⠀⠘⢜⢌⢎⢞⢎⢯⡳⡝⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⢕⢌⠆⠁⠀⠀⠀⠀⠀⠀⠀⠈⢎⢎⣗⢽⠑⠉⠀⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠕⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠣⠓⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀neovim⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]], + }, + }, + buttons = { + type = "group", + val = { + button("f", " search files", "<cmd>Telescope find_files<cr>"), + button("n", " new file", "<cmd>ene <cr>"), + }, + }, + } + + local opts = { + layout = { + { type = "padding", val = 2 }, + section.header, + { type = "padding", val = 2 }, + section.buttons, + }, + opts = { margin = 5 }, + } + + alpha.setup(opts) +end + +return M
M lua/plugin/statusline.lua

@@ -6,7 +6,7 @@ options = {

theme = "onenord", component_separators = { "", "" }, section_separators = { "", "" }, - disabled_filetypes = { "NvimTree", "Telescope" }, + disabled_filetypes = { "NvimTree", "Telescope", "alpha" }, always_divide_middle = false, }, sections = {