From 01729e261340a4462a57bf80f6e591c1371ae996 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 22 Oct 2023 18:17:21 -0400 Subject: kitchen sink: - add code action previews - change indent blankline style - more luasnip snippets - change default mason stuff - customize neorg more - change notify style - change startpage completely - add line info to statusline - change telescope style - change how todo comments look - make indentation work via treesitter --- after/plugin/actionpreview.lua | 17 ++ after/plugin/cleanfold.lua | 6 - after/plugin/dapui.lua | 6 - after/plugin/foldsign.lua | 13 -- after/plugin/iconpicker.lua | 6 - after/plugin/indent-blankline.lua | 15 +- after/plugin/killersheep.lua | 14 -- after/plugin/luasnip.lua | 3 + after/plugin/masontool.lua | 9 +- after/plugin/neodev.lua | 6 - after/plugin/neorg.lua | 11 +- after/plugin/notify.lua | 20 +- after/plugin/presence.lua | 19 -- after/plugin/project.lua | 10 +- after/plugin/scrollbar.lua | 33 ---- after/plugin/sfm.lua | 5 +- after/plugin/startpage.lua | 399 +++++++++----------------------------- after/plugin/statusline.lua | 118 +++-------- after/plugin/telescope.lua | 65 ++++++- after/plugin/term-edit.lua | 8 - after/plugin/todo-comments.lua | 34 +++- after/plugin/trouble.lua | 16 -- after/plugin/truezen.lua | 18 -- after/plugin/ts.lua | 3 + 24 files changed, 273 insertions(+), 581 deletions(-) create mode 100644 after/plugin/actionpreview.lua delete mode 100644 after/plugin/cleanfold.lua delete mode 100644 after/plugin/dapui.lua delete mode 100644 after/plugin/foldsign.lua delete mode 100644 after/plugin/iconpicker.lua delete mode 100644 after/plugin/killersheep.lua delete mode 100644 after/plugin/neodev.lua delete mode 100644 after/plugin/presence.lua delete mode 100644 after/plugin/scrollbar.lua delete mode 100644 after/plugin/term-edit.lua delete mode 100644 after/plugin/trouble.lua delete mode 100644 after/plugin/truezen.lua (limited to 'after/plugin') diff --git a/after/plugin/actionpreview.lua b/after/plugin/actionpreview.lua new file mode 100644 index 0000000..21d4ea4 --- /dev/null +++ b/after/plugin/actionpreview.lua @@ -0,0 +1,17 @@ +local status_ok, actions = pcall(require, "actions-preview") +if not status_ok then + return +end + +actions.setup { + backend = { "telescope" }, + telescope = require("telescope.themes").get_dropdown { + borderchars = { + prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; + results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; + preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; + }, + layout_strategy = 'cursor', + winblend = 10, + } +} diff --git a/after/plugin/cleanfold.lua b/after/plugin/cleanfold.lua deleted file mode 100644 index 3ae4183..0000000 --- a/after/plugin/cleanfold.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, fold = pcall(require, "cleanfold") -if not status_ok then - return -end - -fold.setup {} diff --git a/after/plugin/dapui.lua b/after/plugin/dapui.lua deleted file mode 100644 index 56cfb1b..0000000 --- a/after/plugin/dapui.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, dapui = pcall(require, "dapui") -if not status_ok then - return -end - -dapui.setup {} diff --git a/after/plugin/foldsign.lua b/after/plugin/foldsign.lua deleted file mode 100644 index 1ca7d2c..0000000 --- a/after/plugin/foldsign.lua +++ /dev/null @@ -1,13 +0,0 @@ -local status_ok, foldsign = pcall(require, "nvim-foldsign") -if not status_ok then - return -end - -foldsign.setup { - offset = -2, - foldsigns = { - open = 'V', - close = '>', - seps = { '│', '┃' }, - } -} diff --git a/after/plugin/iconpicker.lua b/after/plugin/iconpicker.lua deleted file mode 100644 index e616a67..0000000 --- a/after/plugin/iconpicker.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, iconpicker = pcall(require, "icon-picker") -if not status_ok then - return -end - -iconpicker.setup {} diff --git a/after/plugin/indent-blankline.lua b/after/plugin/indent-blankline.lua index 830ad99..02f2428 100644 --- a/after/plugin/indent-blankline.lua +++ b/after/plugin/indent-blankline.lua @@ -1,17 +1,10 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") +local status_ok, ibl = pcall(require, "ibl") if not status_ok then return end -indent_blankline.setup { - char = "", - char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", +ibl.setup { + scope = { + enabled = false, }, - space_char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", - }, - show_trailing_blankline_indent = false, } diff --git a/after/plugin/killersheep.lua b/after/plugin/killersheep.lua deleted file mode 100644 index b447010..0000000 --- a/after/plugin/killersheep.lua +++ /dev/null @@ -1,14 +0,0 @@ -local status_ok, killersheep = pcall(require, "killersheep") -if not status_ok then - return -end - -killersheep.setup { - gore = true, - border = 'shadow', - keymaps = { - move_left = "h", - move_right = "l", - shoot = "", - }, -} diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua index 1374bc3..e0540ea 100644 --- a/after/plugin/luasnip.lua +++ b/after/plugin/luasnip.lua @@ -10,3 +10,6 @@ luasnip.config.set_config { -- update on text insert updateevents = "TextChanged,TextChangedI" } + +require("luasnip.loaders.from_vscode").lazy_load() +require("luasnip.loaders.from_snipmate").lazy_load() diff --git a/after/plugin/masontool.lua b/after/plugin/masontool.lua index ee9d012..440b64d 100644 --- a/after/plugin/masontool.lua +++ b/after/plugin/masontool.lua @@ -4,15 +4,14 @@ if not status_ok then end masontool.setup { - -- a list of all tools you want to ensure are installed upon - -- start; they should be the names Mason uses for each tool ensure_installed = { 'lua-language-server', + 'bash-language-server', + 'editorconfig-checker', 'stylua', 'shellcheck', - 'editorconfig-checker', - 'shfmt', 'clangd', - 'clang-format', + 'html-lsp', + 'css-lsp', }, } diff --git a/after/plugin/neodev.lua b/after/plugin/neodev.lua deleted file mode 100644 index ec52684..0000000 --- a/after/plugin/neodev.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, neodev = pcall(require, "neodev") -if not status_ok then - return -end - -neodev.setup {} diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua index 52adb3e..583f429 100644 --- a/after/plugin/neorg.lua +++ b/after/plugin/neorg.lua @@ -3,7 +3,7 @@ if not status_ok then return end -local wsphome = "~/documents/notes/" +local wsphome = os.getenv("HOME").."/documents/notes/" neorg.setup { load = { ["core.defaults"] = {}, @@ -16,8 +16,8 @@ neorg.setup { ["core.dirman"] = { config = { workspaces = { - home = wsphome .. "home", - robotics = wsphome .. "robotics" + home = wsphome.."home", + robotics = wsphome.."robotics" }, index = "index.norg", } @@ -31,13 +31,14 @@ neorg.setup { width = "content", }, folds = false, - icon_preset = "varied", + icon_preset = "basic", } }, ["core.export"] = {}, ["core.completion"] = { config = { engine = "nvim-cmp", + name = "[Neorg]", } }, ["core.presenter"] = { @@ -48,5 +49,3 @@ neorg.setup { ["core.integrations.telescope"] = {}, } } - --- vim.cmd('Neorg sync-parsers') diff --git a/after/plugin/notify.lua b/after/plugin/notify.lua index 1a3d1e9..36d7885 100644 --- a/after/plugin/notify.lua +++ b/after/plugin/notify.lua @@ -4,6 +4,8 @@ if not status_ok then end notify.setup { + timeout = 3000, + minimum_width = 35, icons = { DEBUG = "B", ERROR = "x", @@ -11,6 +13,20 @@ notify.setup { TRACE = "t", WARN = "!" }, - minimum_width = 35, - max_width = 80, + + max_height = function() return math.floor(vim.o.lines * 0.75) end, + max_width = function() return math.floor(vim.o.columns * 0.5) end, + on_open = function(win, record) + vim.api.nvim_win_set_config(win, { + title = { + { " "..record.title[1].." ", "Notify"..record.level.."Title" }, + }, + title_pos = "center", + border = "single", + }) + end, + render = function(bufnr, notif) + notif.message[1] = string.format("%s", notif.message[1]) + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, notif.message) + end, } diff --git a/after/plugin/presence.lua b/after/plugin/presence.lua deleted file mode 100644 index b86dc77..0000000 --- a/after/plugin/presence.lua +++ /dev/null @@ -1,19 +0,0 @@ -local status_ok, presence = pcall(require, "presence") -if not status_ok then - return -end - -presence.setup { - neovim_image_text = "Have you heard of our lord a savior Neovim?", - main_image = "file", - show_time = false, - - -- Rich Presence text options - editing_text = "Editing %s", - file_explorer_text = "Browsing %s", - git_commit_text = "Committing changes", - plugin_manager_text = "Managing plugins", - reading_text = "Reading %s", - workspace_text = "Working on %s", - line_number_text = "Line %s out of %s", -} diff --git a/after/plugin/project.lua b/after/plugin/project.lua index fd44e4c..0b5ae3b 100644 --- a/after/plugin/project.lua +++ b/after/plugin/project.lua @@ -5,6 +5,14 @@ end project.setup { detection_methods = { "pattern" }, - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, + patterns = { + ".git", + "Makefile", + "_darcs", + ".hg", + ".bzr", + ".svn", + "package.json", + }, show_hidden = false, } diff --git a/after/plugin/scrollbar.lua b/after/plugin/scrollbar.lua deleted file mode 100644 index 5125f7c..0000000 --- a/after/plugin/scrollbar.lua +++ /dev/null @@ -1,33 +0,0 @@ -local status_ok, scrollbar = pcall(require, "scrollbar") -if not status_ok then - return -end - -scrollbar.setup({ - hide_if_all_visible = true, - handle = { - hide_if_all_visible = true, - }, - marks = { - Cursor = { - text = "*", - }, - GitAdd = { text = "|" }, - GitChange = { text = "|" }, - GitDelete = { text = "-" }, - }, - handlers = { - cursor = true, - diagnostic = true, - gitsigns = true, -- Requires gitsigns - handle = true, - }, -}) - ---[[ scrollbar.setup { - current_only = true, - winblend = 50, - zindex = 40, - excluded_filetypes = {}, - width = 2, -} ]] diff --git a/after/plugin/sfm.lua b/after/plugin/sfm.lua index dcbbe95..5b2e776 100644 --- a/after/plugin/sfm.lua +++ b/after/plugin/sfm.lua @@ -11,7 +11,7 @@ sfm.setup { mappings = { custom_only = false, list = { - -- user mappings go here + { key = 's', action = 'toggle_selection' } } }, renderer = { @@ -30,7 +30,8 @@ sfm.setup { folder_closed = "", folder_open = "", file = "", - } + }, + selection = "*" } } }:load_extension('sfm-git', { diff --git a/after/plugin/startpage.lua b/after/plugin/startpage.lua index 68c0aec..6261b3f 100644 --- a/after/plugin/startpage.lua +++ b/after/plugin/startpage.lua @@ -3,334 +3,113 @@ if not status_ok then return end -math.randomseed(os.time()) - -local C = {} -local R = {} - --- buttons -local function button(sc, txt, keybind) - local opts = { +local function button(sc, txt, cmd, kopts, opts) + opts = opts or { position = "center", - shortcut = sc, - cursor = -1, - width = string.len(C.header[1]), + shortcut = sc:gsub("", "LDR"), + cursor = 0, + width = 49, align_shortcut = "right", - hl_shortcut = "Keyword", - redraw_on_resize = false, + 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(keybind .. "", true, false, true) + local key = vim.api.nvim_replace_termcodes(cmd, true, false, true) vim.api.nvim_feedkeys(key, "t", false) end return { type = "button", val = txt, - on_press = on_press, opts = opts, + on_press = on_press, } end --- actual config -C.bigheader = { - { - [[ |\ ]], - [[ ||. ]], - [[ ||;` ]], - [[ ,'|; : ]], - [[ ,': |; ` ]], - [[ ,' | ; `-` ]], - [[ ,' | ; : ]], - [[ ,' `-|; ` ]], - [[ ; ; ` ]], - [[ ,' `--\`-. `--: ]], - [[ ,-._,'`. |\||`-. ` ]], - [[ `;-.`-._`. | |\ \ `-. ` ]], - [[ :`--`-.`-\ `--.| /`\;\ `-: ]], - [[ ; ``-`. |/ ; \ `. ]], - [[ ; `.`-/ ; \ ` ]], - [[ ; : `/ ; \ ` ]], - [[ ,-._ | / ; -`\ : ]], - [[ `;-.`-._| : / | \ ` ]], - [[ ; `-.| : / | \ ` ]], - [[ ; | : : / | \ : ]], - [[ ; | : / ; | \ ` ]], - [[ ; | / ; | --`\ ` ]], - [[ | | : / ; | \ : ]], - [[ | : | : / ; \ ` ]], - [[ | : ; ;:'-.._ -`\ ` ]], - [[ | : ;___ ;'---....___;__:__| `-._ \ : ]], - [[ | : `;``-------'';|| : \ `-._ \` ]], - [[ -=======:===;===========;=|| : \ `-.\: ]], - [[ ___ ; _;_|| ; ||___,:-.\___,....__\_ ]], - [[ |`--:.|;_o||-______;,..-----""""" __|__...-'' ]], - [[----....|___ """" jrei__||-------........________]], - [[ """"----....____ __..--'' || ~~~~~ ]], - [[ ~~~ ~~~ """"----....____|/ ~~~~~~~ ~~~~~~~]], - [[~~~ ~~~~ ~~~~~~ ~ ~~~ ~~~~ ]], - [[ ~~~~~ ~~~ ~ ~~~~~~~~~ ~~~ ~~~~~~~~~~ ]], - }, - { - [[ J\ ]], - [[ | \ ]], - [[ | `. ]], - [[ F `. ]], - [[ F \ ]], - [[ F \ ]], - [[ J `. ]], - [[ J `. _ ]], - [[ J \ |\ ]], - [[ |. `.J|\ ]], - [[ | `. `.L \ ]], - [[ | `. \L `. ]], - [[ J ` F `. ]], - [[ J F \ ]], - [[ J J \ ]], - [[ F | \ ]], - [[ F | `. ]], - [[ F F `. ]], - [[ | F \ ]], - [[ | J \ ]], - [[ | | \ ]], - [[ | | \ ]], - [[ J F \ ]], - [[----------J J \-------------]], - [[ L | \ ]], - [[~ O ======F \ ~ ]], - [[ ~ (\`-. / J \-. ~ ]], - [[ \_\/ )"L_ _\_) ]], - [[ >|`-.||[_][""""---------.'_.-\\ ~ ]], - [[~~ ~~~ \`-. J_ Veronica"""""\/"_.--'\\ ]], - [[ ~ `. "--._ _..--""" |\` ]], - [[ ~~ ~~ ~""-. """"""""""" | ]], - [[ ~~ ~ ~~ ~"----._--.-._--""""\|'\| ]], - [[ ~ ~~~ ~~ ~~~ ~~~~ `- `--.` ` ]], - [[~~~ ~~ ~~ ~~~~ ~~ ~ ]], - }, - { - [[ . . ]], - [[ _..-''"""\ _.--'"""\ ]], - [[ | L | \ ]], - [[ _ / _.-.---.\. / .-.----.\ ]], - [[ _/-|--- _/<"---'"""""\\`. /-'--''"""""\ ]], - [[ | \ | L`.`-. | L ]], - [[ /_.-.---.L | \ \ `| J`. ]], - [[ _/--'"""" \ F \L \ | L ]], - [[ L `. L J _.---.-"""-.\`. L_/ _.--|"""""--.\ `. ]], - [[ | \+. /-"__.--'"""" \ `./'"---'"""""" \`. `. ]], - [[ F _____ \ `F" `. \ \ L `. ]], - [[ /.-'"_|---'"\ | ` JL | L `.`. ]], - [[ <-'"" \| _.-.------._ A J _.-.-----`.--| ``.`. ]], - [[ L `. |/.-'"_.-`---'""\."| /-'"---'""""" \`.\. \ `.`. ]], - [[ | _.------\.<'""" L\ L\ `.`\`. \ `. ]], - [[ _.-'//'"--'""" L\| ________\ `.F ___.-------._L \ `-\ \`. ]], - [[ /___| F F _.--'"_|-------L /_.-'"_.-|-'"""""""\ L L `.`. ]], - [[ | F _.-'|"""""/'"-'""" J <'""" L J | `.`. ]], - [[ |/-'-''/|""\ )-|\ F \ | L .'"""`\""-\\_ ]], - [[ F`-'-'-(`-') | \ F \ |___`"""`.""`.-'" ]], - [[------------/ `-'---| F L L __ |"""""`-'"__________]], - [[ .'_ | |__L __ J__ | _.--'"""" `".----'".' ]], - [[ '""""""""""""|--._+--F _.-'""||" """___/.-'" ||-'"/""""" \_. .' ]], - [[ J------------(___\__/'_____.--------'-------'"""""""" / ]], - [[ `-. _.__.__.__.____ J_.-._ ]], - [[ .'`-._ (-`--`---.'--._`---._.-'`-._.-'_.-'``-._' `-''-' ]], - }, - { - [[ _____|\ ]], - [[ _.--| SSt |: ]], - [[ <____|.----|| ]], - [[ .---''---, ]], - [[ ;..__..' _... ]], - [[ ,'/ ;|/..--'' \ ]], - [[ ,'_/.-/': : ]], - [[ _..-'''/ / | \ \ _|/| ]], - [[ \ /-./_ \; \ \,;' \ ]], - [[ ,\ / \: `:\ \ // `:`. ]], - [[ ,' \ /-._; | : : :: ,. . ]], - [[ ,' :: /`-._| | | || ' : `.`.)]], - [[ _,' |;._:: | | | | `| : `' ]], - [[ ,' `. / |`-:_ ; | | | : \ ]], - [[ `--. ) /|-._: : | \ \ ]], - [[ / / :_| ;`-._; __..--'; : : ]], - [[ / ( ;|;-./_ _/.-:'o | / ' | ]], - [[ / , \._/_/_./--''/_|:|___|_,' | ]], - [[ : / `'-'--'----'---------' | ]], - [[ | : O ._O O_. O ._O O_. ; ; ]], - [[ : `. // // // // ,' / ]], - [[ ~~~`.______//____//____//____//_______,'~ ]], - [[ // //~ // // ]], - [[ ~~ _// _// _// ~ _// ~ ]], - [[ ~ / / / / / / / / ~ ~~ ]], - [[ ~~~ ~~~ ~~~ ~~~ ]], - }, - { - [[ P___----.... ]], - [[ ! __ ]], - [[ ' ~~ ---.#..__ ` ~ ~ - - . .: ]], - [[ ` ~~--. .F~~___-__. ]], - [[ ; , .- . _! ]], - [[ , ' ; ~ . ]], - [[ , ____ ; ' _ ._ ; ]], - [[ ,_ . - '___#, ~~~ ---. _, . ' .#' ~ .; ]], - [[ =---==~~~ ~~~==--__ ; '~ -. ,#_ .' ]], - [[ ' `~=.; ` / ]], - [[ ' ' '. ]], - [[ ' ' ]], - [[ \ ' ' ' ]], - [[ `.`\ ' . ; , ]], - [[ \ ` ' ' ; ]], - [[ ; ' ' ' ]], - [[ /_ ., / __...---./ ' ]], - [[ ',_, __.--- ~~;#~ --..__ _'.-~;# // `.' ]], - [[ / / ~~ .' . #; ~~ /// #; // / ]], - [[ / ' . __ . ' ;#;_ . ////.;#;./ ; / ]], - [[ \ . / ,##' / _ /. '(/ ~||~\' ]], - [[ \ ` - . /_ . -==- ~ ' / (/ ' . ;;. ', ]], - [[ /' . ' -^^^...--- ``(/' _ ' '' `,; ]], - [[##,. .#...( ' .c c .c c c. '.. ;; ../ ]], - [[%%#%;,..##.\_ ,;###;,. ;;.:##;,. raf ]], - [[%%%%########%%%%;,.....,;%%%%%%;,.....,;%%%%%%%%%%%%%%%%%%%%............]], - }, - { - [[ .. ]], - [[ .( )`-._ ]], - [[ .' || `._ ]], - [[ .' || `. ]], - [[ .' || `._ ]], - [[ .' _||_ `-. ]], - [[ .' |====| `.. ]], - [[ .' \__/ ( ) ]], - [[ ( ) || _ || ]], - [[ /|\ || .-` \ || ]], - [[ .' | ' || _.-' | || ]], - [[ / |\ \ || .' `.__.' || _.-.. ]], - [[ .' /| `. _.-' _.-' _.-.`-'`._`.` ]], - [[ \ .' | | .-.` `./ _.-`. `._.-' ]], - [[ |. | `. _.-' `. .' .' `._.`---` ]], - [[ .' | | : `._..-'.' `._..' || ]], - [[ / | \ `-._.' || || ]], - [[ | .'|`. | ||_.--.-._ || ]], - [[ ' / | \ \ __.--'\ `. : || ]], - [[ \ .' | \| ..-' \ `._-._.' || ]], - [[`.._ |/ | `. \ \ `._.- || ]], - [[ `-.._ / | \ `-.'_.--' || ]], - [[ `-.._.' | | | | _ _ _ _'_ _ _ _ _ ]], - [[ `-.._ | \ | | |_|_|_'|_|_|_|_|_|_| ]], - [[ [`--^-..._.' | | /....../| __ __ | ]], - [[ \`---.._|`--.._ | | /....../ | |__| |__| | ]], - [[ \__ _ `-.._| `-._|_|_ _ _/_ _ _ / | |__| |__| | ]], - [[ \ _o_ _`-._|_|_|_|_|_|_|_|_/ '-----------/ ]], - [[ \_`.|.' _ - .--.--.--.--.--.`--------------' ]], - [[ .```-._ ``-.._ \__ _ _ '--'--'--'--'--' - _ - _ __/ ]], - [[ .`-.```-._ ``-..__``.- `. _ - _ _ _ - _- _ __/(.``-._]], - [[ _.-` ``--.. .. _.-` ``--.. .. .._ _. __ __ _ __ ..--.._ / .( _..``]], - [[`.-._ `._ `- `-._ .`-.```-._ ``-..__``.- -._--.__---._--..-._`...```]], - [[ _.-` ``--.. .. `.-._ `._ `- `-._ .-_. ._.- -._ --.._`` _.-`LGB`-.]], - }, +local header = { + '█▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ █▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀█ ', + '█ ░█████▀▀▀▀▀█████▓▄ ▀▀▀▀ ░ ░█ ░█ ░█ █ ', + '█ ▒███████ ▓███████ ▒██ ▓███ ▓███ ▓███ █ ', + '█ ▓███████ ▓███████ ▓█████████████████ █ ', + '█ ▓███████ ▓███████ ███ ██████████████ █ ', + '█ ▓███████ ▓███████ ███ ██████████████ █ ', + '█ ▓███████ ▓███████ ███ ██████████████ █ ', + '█ ▓███████ ▓███████ ███▄██████████████ █ ', + '█ ▓███████ ▓███████ ██████▀▀██████████ █ ', + '▀ ▓███████ ▓███████▄ ▄▄███████████ █ ', + '█ ▓███████ ██████████████████ █▄▄▄', + '█ ▓███████▀▀ ▀ ▀ ▀████████████████▄ ▄ █', + '█▄▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀▀▀▀▀▀▀█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█', + ' █ ▀ █ ', + ' ▀▀▀▀▀ ', } -C.mediumheader = { - { - [[ |._ ]], - [[ |._( ]], - [[ <|.__..-'|. ]], - [[ ,| .|)\ ]], - [[ /| .|) \ ]], - [[ /.|) .|) \ ]], - [[ / .|) .|) \ ]], - [[ / .|) .|) \ ]], - [[ / .|) .|) \ ]], - [[ / ,--+---_ | \ , ]], - [[ '\==-,,;,,;,,;,,,,,,,-==;7 ]], - [[ _ \__...____...__ __/ _ seal _]], - [[ ~ ~~~~ ~~ ]], - }, - { - [[ , ]], - [[ |"-,_ ]], - [[ I--(_ ]], - [[ ,I?8, ]], - [[ d|`888. ]], - [[ d8| 8888b ]], - [[ ,88| ?8888b ]], - [[ ,888| `88888b ]], - [[ ,8888| 8888g8b ]], - [[ ,88888| 888PX?8b ]], - [[ ,888888| 8888bd88, ]], - [[ o8888888| ,888888888 ]], - [[ d8888888P| d888888888b ]], - [[ _.d888gggg8'| 8gg88888888, ]], - [[ '\==-,,,,,,,,|/;,,,,,-==;7 ]], - [[ _ \__...____...__ __/ _ seal _]], - [[ ~ ~~~~ ~~ ]], - }, -} -C.smallheader = { - { - [[ _~ ]], - [[ _~ )_)_~ ]], - [[ )_))_))_) ]], - [[ _!__!__!_ ]], - [[ \______t/ ]], - [[~~~~~~~~~~~~~]], - }, - { - [[ __4___ ]], - [[ _ \ \ \ \ ]], - [[<'\ /_/_/_/ ]], - [[ ((____!___/)]], - [[ \0\0\0\0\/ ]], - }, - { - [[ I\ ]], - [[ I \ ]], - [[ I \ ]], - [[ I*--\ ]], - [[ I \ ]], - [[ I \ ]], - [[ I______\ ]], - [[ _____I__O______ ]], - [[ \ ( ) b ^ ^]], - [[^^^^^^^^^^^^^^^^^ ^ ]], - }, - { - [[ ^ +~+~~ ]], - [[ ^ )`.). ]], - [[ )``)``) .~~ ]], - [[ ).-'.-')|) ]], - [[ |-).-).-'_'-/ ]], - [[~~~\ `o-o-o' /~~~~~~~~~~~~~~~~~]], - [[ ~~~'---.____/~~Eric C. Liebl~~~]], - }, - { - [[ ,_ ]], - [[ I~ ]], - [[ |\ ]], - [[ /|.\ ]], - [[ / || \ ]], - [[ ,' |' \ ]], - [[.-'.-==|/_--' ]], - [[`--'-------' _ seal _]], - } +local footer = { + '▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄', } -R.width = vim.api.nvim_win_get_width(0) -R.height = vim.api.nvim_win_get_height(0) - -C.header = C.bigheader[math.random(#C.bigheader)] -if #C.header >= R.height then - C.header = C.mediumheader[math.random(#C.mediumheader)] - if #C.header >= R.height then - C.header = C.smallheader[math.random(#C.smallheader)] - if #C.header >= R.height then - C.header = "" - end - end -end - alpha.setup { layout = { - { type = "padding", val = math.floor((R.height - #C.header) / 2) }, - { type = "text", val = C.header, opts = { position = 'center', hl = "AlphaHeader" } }, + { 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', 'Telescope find_files'), + button('r', '↺ Recent files', 'Telescope oldfiles '), + button('n', '▣ Neorg workspace', 'Telescope neorg switch_workspace'), + button('m', '≡ Menu', 'ConfigMenu'), + button('q', '✖ Quit', 'wqa'), + } }, + { type = 'text', val = footer, opts = { + position = 'center', + hl = 'AlphaFooter', + } }, }, + opts = { + keymap = { + press = '', + 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, + } } diff --git a/after/plugin/statusline.lua b/after/plugin/statusline.lua index 1da1163..9e578a7 100644 --- a/after/plugin/statusline.lua +++ b/after/plugin/statusline.lua @@ -5,63 +5,19 @@ end el.reset_windows() -local builtin = require "el.builtin" -local sections = require "el.sections" +local builtin = require("el.builtin") +local sections = require("el.sections") local c = require "components" --- color setup -local hl_statusline = "StatusLine" ---diagnostic colors -local hl_hint = "DiagnosticHint" -local hl_info = "DiagnosticInfo" -local hl_warn = "DiagnosticWarn" -local hl_err = "DiagnosticError" --- git colors -local hl_red = "ErrorMsg" -local hl_green = "diffAdded" -local hl_yellow = "WarningMsg" -local highlights = { - -- diagnostic colors - diag_err = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_err] = "fg" }, - bold = true, - }), - diag_warn = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_warn] = "fg" }, - bold = true, - }), - diag_info = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_info] = "fg" }, - bold = true, - }), - diag_hint = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_hint] = "fg" }, - bold = true, - }), - - -- git colors - red_fg = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_red] = "fg" }, - bold = true, - }), - green_fg = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_green] = "fg" }, - bold = true, - }), - yellow_fg = c.extract_hl({ - bg = { [hl_statusline] = "bg" }, - fg = { [hl_yellow] = "fg" }, - bold = true, - }), -} +local function hl(fg, b) + b = b or false + return c.extract_hl({ + bg = {["StatusLine"] = "bg"}, + fg = {[fg] = "fg"}, + bold = b, + }) +end --- modes local modes = { -- display name, mode, highlight group n = { "Normal", "N" }, @@ -79,56 +35,44 @@ local modes = { ic = { "ICompl", "Ic" }, R = { "Replace", "R" }, Rv = { "VReplace", "Rv" }, - c = { "Command", "C" }, + c = { "Command", "C", hl("DiagnosticHint")}, cv = { "Vim Ex", "E" }, ce = { "Ex (r)", "E" }, r = { "Prompt", "P" }, - rm = { "More ", "M" }, + rm = { "More", "M" }, ["r?"] = { "Confirm", "Cn" }, - ["!"] = { "Shell ", "S" }, - nt = { "Term ", "T" }, - t = { "Term ", "T" }, + ["!"] = { "Shell", "S" }, + nt = { "Term", "T" }, + t = { "Term", "T" }, } el.setup { generator = function() - local items = { - { c.mode { modes = modes, fmt = " %s %s ", icon = "", hl_icon_only = false } }, + return { + { { " " }, c.mode { modes = modes, hl_icon_only = false } }, { sections.split, required = true }, { sections.collapse_builtin { { builtin.filetype }, { " " } } }, { sections.maximum_width(builtin.tail_file, 0.50), required = true }, { sections.collapse_builtin { { " " }, { builtin.modified_flag } } }, { sections.split, required = true }, + { c.lsp_srvname }, { c.diagnostics { - fmt = "[%s]", lsp = true, - hl_err = highlights.diag_err, - hl_warn = highlights.diag_warn, - hl_info = highlights.diag_info, - hl_hint = highlights.diag_hint, - icon_err = 'x', icon_warn = '!', icon_info = 'i', icon_hint = 'h' - } - }, - { c.git_branch { fmt = "%s *%s", icon = "" } }, + fmt = "[%s]", + hl_err = hl("DiagnosticError", true), + hl_warn = hl("DiagnosticWarn", true), + hl_info = hl("DiagnosticInfo", true), + hl_hint = hl("DiagnosticHint", true) + }}, + { c.git_branch { icon = "*", fmt = " %s%s" } }, { c.git_changes_buf { fmt = "[%s]", - icon_insert = "+", - icon_change = "~", - icon_delete = "-", - hl_insert = highlights.green_fg, - hl_change = highlights.yellow_fg, - hl_delete = highlights.red_fg, + hl_insert = hl("GitSignsAdd", true), + hl_change = hl("GitSignsChange", true), + hl_delete = hl("GitSignsDelete", true), }}, + { { " " }, c.line { + fmt = "ʟ[%s]", + }, required = true }, } - - local add_item = function(result, item) - table.insert(result, item) - end - - local result = {} - for _, item in ipairs(items) do - add_item(result, item) - end - - return result end } diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 9411e61..519ecbd 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -5,18 +5,71 @@ end local actions = require('telescope.actions') local action_layout = require("telescope.actions.layout") +local function telescopew() + if vim.o.columns <= 80 then + return vim.o.columns + else + return 80 + end +end + telescope.setup { defaults = { borderchars = { - prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; + prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; }, - sorting_strategy = 'ascending', + preview = { + -- add image previews via chafa + mime_hook = function(filepath, bufnr, opts) + local is_image = function(filepath) + local image_extensions = { -- supported image formats + 'png', + 'jpg', + 'jpe', + 'jpeg', + 'webp', + 'gif', + } + local split_path = vim.split(filepath:lower(), '.', { plain=true }) + local extension = split_path[#split_path] + return vim.tbl_contains(image_extensions, extension) + end + if is_image(filepath) then + local term = vim.api.nvim_open_term(bufnr, {}) + local function send_output(_, data, _ ) + for _, d in ipairs(data) do + vim.api.nvim_chan_send(term, d..'\r\n') + end + end + vim.fn.jobstart({ + 'chafa', + '-C', + 'on', + '--animate', + 'off', + '-s', + (telescopew() - 10)..'x25', + '--clear', + filepath + }, { on_stdout = send_output, stdout_buffered = true, pty = true }) + a.nvim_set_option_value("number", false, {buf = bufnr}) + else + require("telescope.previewers.utils").set_preview_message(bufnr, opts.winid, "File cannot be previewed") + end + end + }, + + winblend = 0, -- 'horizontal', 'vertical', 'bottom_pane', or 'cursor' - layout_strategy = 'bottom_pane', + layout_strategy = 'vertical', + sorting_strategy = 'ascending', layout_config = { - bottom_pane = { height = 0.4, }, + vertical = { + width = telescopew(), + prompt_position = "top", + } }, mappings = { i = { @@ -42,5 +95,7 @@ telescope.load_extension('projects') a.nvim_create_autocmd('User', { pattern = 'TelescopePreviewerLoaded', - command = 'setlocal number', + callback = function() + vim.opt.winblend = 0 + end, }) diff --git a/after/plugin/term-edit.lua b/after/plugin/term-edit.lua deleted file mode 100644 index 77f7470..0000000 --- a/after/plugin/term-edit.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, termedit = pcall(require, "term-edit") -if not status_ok then - return -end - -termedit.setup { - prompt_end = '$ ', -} diff --git a/after/plugin/todo-comments.lua b/after/plugin/todo-comments.lua index 2a65cda..cf1c0a0 100644 --- a/after/plugin/todo-comments.lua +++ b/after/plugin/todo-comments.lua @@ -5,12 +5,32 @@ end todocomments.setup { keywords = { - FIX = { icon = " ", alt = { "FIXME", "BUG" } }, - TODO = { icon = "i ", color = "info" }, - HACK = { icon = "* ", color = "warning" }, - WARN = { icon = "! ", color = "warning", alt = { "WARNING", "XXX" } }, - PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, - NOTE = { icon = "i ", color = "hint", alt = { "INFO" } }, - TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, + FIX = { + icon = "# ", + alt = { "FIXME", "BUG" }, + }, + HACK = { + icon = "* ", + color = "warning", + }, + WARN = { + icon = "! ", + color = "warning", + alt = { "WARNING", "XXX" }, + }, + NOTE = { + icon = "i ", + color = "hint", + alt = { "INFO", "TODO" }, + }, + PERF = { + icon = "@ ", + alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" }, + }, + TEST = { + icon = "@ ", + color = "test", + alt = { "TESTING", "PASSED", "FAILED" }, + }, }, } diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua deleted file mode 100644 index bdf9f37..0000000 --- a/after/plugin/trouble.lua +++ /dev/null @@ -1,16 +0,0 @@ -local status_ok, trouble = pcall(require, "trouble") -if not status_ok then - return -end - -trouble.setup { - icons = false, - fold_open = "v", - fold_closed = ">", - signs = { - error = "[x]", - warning = "[!]", - hint = "[?]", - information = "[i]" - }, -} diff --git a/after/plugin/truezen.lua b/after/plugin/truezen.lua deleted file mode 100644 index 9eecc4f..0000000 --- a/after/plugin/truezen.lua +++ /dev/null @@ -1,18 +0,0 @@ -local status_ok, truezen = pcall(require, "true-zen") -if not status_ok then - return -end - -truezen.setup { - modes = { - ataraxis = { - minimum_writing_area = { - width = 90, - height = 44, - }, - }, - narrow = { - folds_style = "invisible", - }, - } -} diff --git a/after/plugin/ts.lua b/after/plugin/ts.lua index 7e5a490..96bebb6 100644 --- a/after/plugin/ts.lua +++ b/after/plugin/ts.lua @@ -24,4 +24,7 @@ treesitter.setup { enable = true, additional_vim_regex_highlighting = false, }, + indent = { + enable = true + }, } -- cgit v1.2.1