From 0376a0a9429599da2ffe74d992fa5e91fb29b6da Mon Sep 17 00:00:00 2001 From: max397574 Date: Mon, 4 Oct 2021 21:03:19 +0200 Subject: =?UTF-8?q?fix():=20=F0=9F=90=9Bsets=20header=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/startuptools.lua | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'lua/startuptools.lua') diff --git a/lua/startuptools.lua b/lua/startuptools.lua index 679d44e..0d95c01 100644 --- a/lua/startuptools.lua +++ b/lua/startuptools.lua @@ -3,33 +3,27 @@ local nb = vim.api.nvim_create_namespace('noiceboard') local settings = { header = { - " ▄▄▄█████▓ ▄▄▄ ▄▄▄██▀▀▀ ", - " ▓ ██▒ ▓▒ ▒████▄ ▒██ ", - " ▒ ▓██░ ▒░ ▒██ ▀█▄ ░██ ", - " ░ ▓██▓ ░ ░██▄▄▄▄██ ▓██▄██▓ ", - " ▒██▒ ░ ▓█ ▓██▒ ▓███▒ ", - " ▒ ░░ ▒▒ ▓▒█░ ▒▓▒▒░ ", - " ░ ▒ ▒▒ ░ ▒ ░▒░ ", - " ░ ░ ▒ ░ ░ ░ ", - " ░ ░ ░ ░ ", +" /$$ ", +" |__/ ", +" /$$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$/$$$$ ", +"| $$__ $$ /$$__ $$ /$$__ $$| $$ /$$/| $$| $$_ $$_ $$", +"| $$ \\ $$| $$$$$$$$| $$ \\ $$ \\ $$/$$/ | $$| $$ \\ $$ \\ $$", +"| $$ | $$| $$_____/| $$ | $$ \\ $$$/ | $$| $$ | $$ | $$", +"| $$ | $$| $$$$$$$| $$$$$$/ \\ $/ | $$| $$ | $$ | $$", +"|__/ |__/ \\_______/ \\______/ \\_/ |__/|__/ |__/ |__/", } } local function center(dict) local centered = {} + local space_left = vim.o.columns - string.len(dict[1]) for _, line in ipairs(dict) do - local space_left = vim.o.columns - string.len(line) - table.insert(centered, string.rep(" ", space_left) .. line) - space_left = 0 + table.insert(centered, string.rep(" ", space_left/2) .. line) end return centered end -function M.print_header() - dump(center(settings.header)) -end - local count = 1 local function set_lines(len, text, hi, pass) vim.api.nvim_buf_set_lines(0, count, count+len, false, center(text)) @@ -45,8 +39,4 @@ function M.set_header() set_lines(#settings.header, settings.header, 'TSString') end -function M.setup() - vim.cmd("command! -bang -nargs=0 StartuptoolsHeader :lua require('startuptools').set_header()") -end - return M -- cgit v1.2.3