diff options
Diffstat (limited to 'pkgs/custom-neovim/config')
41 files changed, 187 insertions, 1400 deletions
diff --git a/pkgs/custom-neovim/config/init.lua b/pkgs/custom-neovim/config/init.lua index cd5e09b..d567b58 100644 --- a/pkgs/custom-neovim/config/init.lua +++ b/pkgs/custom-neovim/config/init.lua @@ -1,67 +1,7 @@ -local should_profile = os.getenv("NVIM_PROFILE") -if should_profile then - require("profile").instrument_autocmds() - if should_profile:lower():match("^start") then - require("profile").start("*") - else - require("profile").instrument("*") - end -end +-- Load plugins +require('lz.n').load('plugins') -local function toggle_profile() - local prof = require("profile") - if prof.is_recording() then - prof.stop() - vim.ui.input({ prompt = "Save profile to:", completion = "file", default = "profile.json" }, function(filename) - if filename then - prof.export(filename) - vim.notify(string.format("Wrote %s", filename)) - end - end) - else - prof.start("*") - end -end -vim.keymap.set("", "<f1>", toggle_profile) - --- Require utilities. -require("utilities") -require("art") - --- Require config parts. +-- Require config modules require("options") -require("autocommands") -require("colorschemes") -require("neovide") -require("mappings") -require("statusline") -require("completion") +require("keymaps") require("lsp") - --- UI Plugins: -require("plugins.mini.icons") -require("plugins.mini.tabline") -require("plugins.mini.clue") -require("plugins.mini.indentscope") -require("plugins.fidget") -require("plugins.treesitter") -require("plugins.mini.files") -require("plugins.incline") -require("plugins.auto-session") -require("plugins.gitsigns") -require("plugins.namu") -require("plugins.focus") - --- LSP Plugins: -require("plugins.actions-preview") - --- Utility Plugins: -require("plugins.mini.git") -require("plugins.mini.pairs") -require("plugins.ts-autotag") -require("plugins.comment") - --- Misc Plugins: -require("plugins.presence") -require("plugins.snacks") --- require("hardtime").setup() diff --git a/pkgs/custom-neovim/config/lua/art.lua b/pkgs/custom-neovim/config/lua/art.lua deleted file mode 100644 index f36a5d9..0000000 --- a/pkgs/custom-neovim/config/lua/art.lua +++ /dev/null @@ -1,269 +0,0 @@ --- Credits to the ascii.nvim plugin and jgs on the ascii art archive. - -Art = { - space = { - saturn = { - [[ ~+ ]], - [[ * + ]], - [[ ' | ]], - [[ () .-.,="``"=. - o - ]], - [[ '=/_ \ | ]], - [[ * | '=._ | ]], - [[ \ `=./`, ' ]], - [[ . '=.__.=' `=' * ]], - [[ + + ]], - [[ O * ' . ]], - }, - }, - neovim = { - default1 = { - [[ __ ]], - [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], - [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], - [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], - [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], - [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], - }, - - default2 = { - [[ _______ ____ ____.__ ]], - [[ \ \ ____ ___\ \ / /|__| _____ ]], - [[ / | \_/ __ \/ _ \ Y / | |/ \ ]], - [[/ | \ ___( <_> ) / | | Y Y \]], - [[\____|__ /\___ >____/ \___/ |__|__|_| /]], - [[ \/ \/ \/ ]], - }, - - dos_rebel = { - [[ ]], - [[ ██████ █████ █████ █████ ███ ]], - [[ ░░██████ ░░███ ░░███ ░░███ ░░░ ]], - [[ ░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████ ]], - [[ ░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███ ]], - [[ ░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███ ]], - [[ ░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███ ]], - [[ █████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████ ]], - [[ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░ ]], - [[ ]], - }, - - rowan_cap = { - [[ ]], - [[ dMMMMb dMMMMMP .aMMMb dMP dMP dMP dMMMMMMMMb ]], - [[ dMP dMP dMP dMP"dMP dMP dMP amr dMP"dMP"dMP ]], - [[ dMP dMP dMMMP dMP dMP dMP dMP dMP dMP dMP dMP ]], - [[ dMP dMP dMP dMP.aMP YMvAP" dMP dMP dMP dMP ]], - [[ dMP dMP dMMMMMP VMMMP" VP" dMP dMP dMP dMP ]], - [[ ]], - }, - - isometric = { - [[ ]], - [[ /\__\ /\ \ /\ \ /\__\ ___ /\__\ ]], - [[ /::| | /::\ \ /::\ \ /:/ / /\ \ /::| | ]], - [[ /:|:| | /:/\:\ \ /:/\:\ \ /:/ / \:\ \ /:|:| | ]], - [[ /:/|:| |__ /::\~\:\ \ /:/ \:\ \ /:/__/ ___ /::\__\ /:/|:|__|__ ]], - [[ /:/ |:| /\__\ /:/\:\ \:\__\ /:/__/ \:\__\ |:| | /\__\ __/:/\/__/ /:/ |::::\__\ ]], - [[ \/__|:|/:/ / \:\~\:\ \/__/ \:\ \ /:/ / |:| |/:/ / /\/:/ / \/__/~~/:/ / ]], - [[ |:/:/ / \:\ \:\__\ \:\ /:/ / |:|__/:/ / \::/__/ /:/ / ]], - [[ |::/ / \:\ \/__/ \:\/:/ / \::::/__/ \:\__\ /:/ / ]], - [[ /:/ / \:\__\ \::/ / ~~~~ \/__/ /:/ / ]], - [[ \/__/ \/__/ \/__/ \/__/ ]], - [[ ]], - }, - - ogre = { - [[ ]], - [[ __ _ ]], - [[ /\ \ \___ ___/\ /(_)_ __ ___ ]], - [[ / \/ / _ \/ _ \ \ / | | '_ ` _ \ ]], - [[ / /\ | __| (_) \ V /| | | | | | | ]], - [[ \_\ \/ \___|\___/ \_/ |_|_| |_| |_| ]], - [[ ]], - }, - - slant_relief = { - [[ ]], - [[ /\\\\\_____/\\\_______________________________/\\\________/\\\___________________________ ]], - [[ \/\\\\\\___\/\\\______________________________\/\\\_______\/\\\__________________________ ]], - [[ _\/\\\/\\\__\/\\\______________________________\//\\\______/\\\___/\\\_____________________ ]], - [[ _\/\\\//\\\_\/\\\_____/\\\\\\\\______/\\\\\_____\//\\\____/\\\___\///_____/\\\\\__/\\\\\__ ]], - [[ _\/\\\\//\\\\/\\\___/\\\/////\\\___/\\\///\\\____\//\\\__/\\\_____/\\\__/\\\///\\\\\///\\\_ ]], - [[ _\/\\\_\//\\\/\\\__/\\\\\\\\\\\___/\\\__\//\\\____\//\\\/\\\_____\/\\\_\/\\\_\//\\\__\/\\\ ]], - [[ _\/\\\__\//\\\\\\_\//\\///////___\//\\\__/\\\______\//\\\\\______\/\\\_\/\\\__\/\\\__\/\\\_ ]], - [[ _\/\\\___\//\\\\\__\//\\\\\\\\\\__\///\\\\\/________\//\\\_______\/\\\_\/\\\__\/\\\__\/\\\ ]], - [[ _\///_____\/////____\//////////_____\/////___________\///________\///__\///___\///___\///__ ]], - [[ ]], - }, - - ansi_shadow = { - [[ ]], - [[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]], - [[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]], - [[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]], - [[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]], - [[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]], - [[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]], - [[ ]], - }, - - bloody = { - [[ ]], - [[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ ]], - [[ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ ]], - [[ ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ ]], - [[ ▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ ]], - [[ ▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒ ]], - [[ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░ ]], - [[ ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░ ]], - [[ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ ]], - [[ ░ ░ ░ ░ ░ ░ ░ ░ ]], - [[ ░ ]], - [[ ]], - }, - - delta_corps_priest1 = { - [[ ]], - [[ ███▄▄▄▄ ▄████████ ▄██████▄ ▄█ █▄ ▄█ ▄▄▄▄███▄▄▄▄ ]], - [[ ███▀▀▀██▄ ███ ███ ███ ███ ███ ███ ███ ▄██▀▀▀███▀▀▀██▄ ]], - [[ ███ ███ ███ █▀ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], - [[ ███ ███ ▄███▄▄▄ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], - [[ ███ ███ ▀▀███▀▀▀ ███ ███ ███ ███ ███▌ ███ ███ ███ ]], - [[ ███ ███ ███ █▄ ███ ███ ███ ███ ███ ███ ███ ███ ]], - [[ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ]], - [[ ▀█ █▀ ██████████ ▀██████▀ ▀██████▀ █▀ ▀█ ███ █▀ ]], - [[ ]], - }, - - elite = { - [[ ]], - [[ ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. ]], - [[ •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪ ]], - [[ ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█· ]], - [[ ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ ]], - [[ ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ ]], - [[ ]], - }, - - the_edge = { - [[ ]], - [[ ▄ ▄███▄ ████▄ ▄ ▄█ █▀▄▀█ ]], - [[ █ █▀ ▀ █ █ █ ██ █ █ █ ]], - [[ ██ █ ██▄▄ █ █ █ █ ██ █ ▄ █ ]], - [[ █ █ █ █▄ ▄▀ ▀████ █ █ ▐█ █ █ ]], - [[ █ █ █ ▀███▀ █ █ ▐ █ ]], - [[ █ ██ █▐ ▀ ]], - [[ ▐ ]], - [[ ]], - }, - - banner3 = { - [[ ]], - [[ ## ## ######## ####### ## ## #### ## ## ]], - [[ ### ## ## ## ## ## ## ## ### ### ]], - [[ #### ## ## ## ## ## ## ## #### #### ]], - [[ ## ## ## ###### ## ## ## ## ## ## ### ## ]], - [[ ## #### ## ## ## ## ## ## ## ## ]], - [[ ## ### ## ## ## ## ## ## ## ## ]], - [[ ## ## ######## ####### ### #### ## ## ]], - [[ ]], - }, - - colossal = { - [[ ]], - [[ 888b 888 888 888 d8b ]], - [[ 8888b 888 888 888 Y8P ]], - [[ 88888b 888 888 888 ]], - [[ 888Y88b 888 .d88b. .d88b. Y88b d88P 888 88888b.d88b. ]], - [[ 888 Y88b888 d8P Y8b d88""88b Y88b d88P 888 888 "888 "88b ]], - [[ 888 Y88888 88888888 888 888 Y88o88P 888 888 888 888 ]], - [[ 888 Y8888 Y8b. Y88..88P Y888P 888 888 888 888 ]], - [[ 888 Y888 "Y8888 "Y88P" Y8P 888 888 888 888 ]], - [[ ]], - }, - - decimal = { - [[ ]], - [[ 78 101 111 86 105 109 ]], - [[ ]], - }, - - def_leppard = { - [[ ]], - [[ : ]], - [[ L. ,; t#, ]], - [[ EW: ,ft f#i ;##W. t ]], - [[ E##; t#E .E#t :#L:WE Ej .. : ]], - [[ E###t t#E i#W, .KG ,#D t .DD.E#, ,W, .Et ]], - [[ E#fE#f t#E L#D. EE ;#f EK: ,WK. E#t t##, ,W#t ]], - [[ E#t D#G t#E :K#Wfff; f#. t#iE#t i#D E#t L###, j###t ]], - [[ E#t f#E. t#E i##WLLLLt :#G GK E#t j#f E#t .E#j##, G#fE#t ]], - [[ E#t t#K: t#E .E#L ;#L LW. E#tL#i E#t ;WW; ##,:K#i E#t ]], - [[ E#t ;#W,t#E f#E: t#f f#: E#WW, E#t j#E. ##f#W, E#t ]], - [[ E#t :K#D#E ,WW; f#D#; E#K: E#t .D#L ###K: E#t ]], - [[ E#t .E##E .D#; G#t ED. E#t :K#t ##D. E#t ]], - [[ .. G#E tt t t E#t ... #G .. ]], - [[ fE ,;. j ]], - [[ , ]], - [[ ]], - }, - - larry_3d = { - [[ ]], - [[ __ __ __ __ ]], - [[ /\ \/\ \ /\ \/\ \ __ ]], - [[ \ \ `\\ \ __ ___\ \ \ \ \/\_\ ___ ___ ]], - [[ \ \ , ` \ /'__`\ / __`\ \ \ \ \/\ \ /' __` __`\ ]], - [[ \ \ \`\ \/\ __//\ \L\ \ \ \_/ \ \ \/\ \/\ \/\ \ ]], - [[ \ \_\ \_\ \____\ \____/\ `\___/\ \_\ \_\ \_\ \_\ ]], - [[ \/_/\/_/\/____/\/___/ `\/__/ \/_/\/_/\/_/\/_/ ]], - [[ ]], - }, - - lean = { - [[ ]], - [[ _/ _/ _/ _/ _/ ]], - [[ _/_/ _/ _/_/ _/_/ _/ _/ _/_/_/ _/_/ ]], - [[ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ ]], - [[ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ ]], - [[ _/ _/ _/_/_/ _/_/ _/ _/ _/ _/ _/ ]], - [[ ]], - }, - - morse = { - [[ ]], - [[ -. . --- ...- .. -- ]], - [[ ]], - }, - - sharp = { - [[ ]], - [[ ]], - [[ ████ ██████ █████ ██ ]], - [[ ███████████ █████ ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - }, - }, - misc = { - hydra = { - [[ ]], - [[ ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ]], - [[ ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ]], - [[ ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ]], - [[ ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ]], - [[ ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ]], - [[ ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ]], - [[ ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ]], - [[ ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ]], - [[ ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ]], - [[ ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ]], - [[ ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ]], - [[ ]], - }, - }, -} diff --git a/pkgs/custom-neovim/config/lua/autocommands.lua b/pkgs/custom-neovim/config/lua/autocommands.lua deleted file mode 100644 index c452696..0000000 --- a/pkgs/custom-neovim/config/lua/autocommands.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Autocommands - --- Equalize Splits when resized -vim.api.nvim_create_autocmd({"VimResized"}, { - callback = function() - -- vim.cmd.wincmd("=") - vim.cmd("FocusAutoresize") - end, -}) diff --git a/pkgs/custom-neovim/config/lua/colorschemes.lua b/pkgs/custom-neovim/config/lua/colorschemes.lua deleted file mode 100644 index cbbbd60..0000000 --- a/pkgs/custom-neovim/config/lua/colorschemes.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Set colorscheme. -vim.cmd.colorscheme("carbonfox") - --- Enable good colors. -vim.o.termguicolors = true - --- Require colorscheme patches. -require("colorschemes.carbonfox") diff --git a/pkgs/custom-neovim/config/lua/colorschemes/carbonfox.lua b/pkgs/custom-neovim/config/lua/colorschemes/carbonfox.lua deleted file mode 100644 index a3bba87..0000000 --- a/pkgs/custom-neovim/config/lua/colorschemes/carbonfox.lua +++ /dev/null @@ -1,25 +0,0 @@ -local link_highlight = Utils.link_highlight - -vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, { - callback = function() - -- Fixes some colorschemes having borderless floating windows. - if vim.g.colors_name == "carbonfox" then - - link_highlight("VertSplit", "Variable") - - -- link_highlight("FloatBorder", "Comment") - - -- Telescope-specific highlights - -- link_highlight("TelescopeBorder", "Comment") - -- link_highlight("TelescopeResultsTitle", "Variable") - -- link_highlight("TelescopePreviewTitle", "Variable") - -- link_highlight("TelescopePromptTitle", "Variable") - -- link_highlight("TelescopePromptNormal", "Variable") - -- link_highlight("TelescopePromptBorder", "Variable") - -- link_highlight("TelescopePromptPrefix", "Variable") - - -- Snacks-specific highlights - -- link_highlight("SnacksPickerDir", "SnacksPickerFile") - end - end, -}) diff --git a/pkgs/custom-neovim/config/lua/completion.lua b/pkgs/custom-neovim/config/lua/completion.lua deleted file mode 100644 index 1ba2a91..0000000 --- a/pkgs/custom-neovim/config/lua/completion.lua +++ /dev/null @@ -1,98 +0,0 @@ -vim.opt.completeopt = {'menu', 'menuone', 'noselect'} - -require('luasnip.loaders.from_vscode').lazy_load() - -local cmp = require('cmp') -local luasnip = require('luasnip') - -local select_opts = {behavior = cmp.SelectBehavior.Select} - -cmp.setup({ - enabled = function() -- Disable in certain circumstances - local disabled = false - disabled = disabled or (vim.api.nvim_get_option_value('buftype', { buf = 0 }) == 'prompt') -- While in prompts. - disabled = disabled or (vim.fn.reg_recording() ~= '') - disabled = disabled or (vim.fn.reg_executing() ~= '') - disabled = disabled or require('cmp.config.context').in_treesitter_capture('comment') -- While in comments. - return not disabled - end, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end - }, - sources = { - {name = 'path'}, - {name = 'nvim_lsp', keyword_length = 1}, - {name = 'buffer', keyword_length = 3}, - {name = 'luasnip', keyword_length = 2}, - }, - window = { - documentation = cmp.config.window.bordered() - }, - formatting = { - fields = {'menu', 'abbr', 'kind'}, - format = function(entry, item) - local menu_icon = { - nvim_lsp = 'λ', - luasnip = '⋗', - buffer = 'Ω', - path = '🖫', - } - - item.menu = menu_icon[entry.source.name] - return item - end, - }, - mapping = { - -- ['<Up>'] = cmp.mapping.select_prev_item(select_opts), - -- ['<Down>'] = cmp.mapping.select_next_item(select_opts), - - ['<C-p>'] = cmp.mapping.select_prev_item(select_opts), - ['<C-n>'] = cmp.mapping.select_next_item(select_opts), - - ['<C-u>'] = cmp.mapping.scroll_docs(-4), - ['<C-d>'] = cmp.mapping.scroll_docs(4), - - ['<C-e>'] = cmp.mapping.abort(), - -- ['<esc>'] = cmp.mapping.abort(), - ['<C-y>'] = cmp.mapping.confirm({select = true}), - ['<CR>'] = cmp.mapping.confirm({select = false}), - - ['<C-f>'] = cmp.mapping(function(fallback) - if luasnip.jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, {'i', 's'}), - - ['<C-b>'] = cmp.mapping(function(fallback) - if luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, {'i', 's'}), - - ['<Tab>'] = cmp.mapping(function(fallback) - local col = vim.fn.col('.') - 1 - - if cmp.visible() then - cmp.select_next_item(select_opts) - elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - fallback() - else - -- cmp.complete() - end - end, {'i', 's'}), - - ['<S-Tab>'] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item(select_opts) - else - fallback() - end - end, {'i', 's'}), - }, -}) diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua new file mode 100644 index 0000000..f766fb5 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/keymaps.lua @@ -0,0 +1,16 @@ +-- Create keymap function +local mapkey = function(mode, key, desc, action, plugin) + local keymapper = plugin and require("lz.n").keymap(plugin).set or vim.keymap.set + keymapper(mode, key, action, {noremap = true, silent = true, desc = desc}) +end + +-- Set the leader key +vim.g.mapleader = " " + +-- Pickers +mapkey("n", "<leader>f", "Open file picker", ":Pick files<cr>", "mini.pick") +mapkey("n", "<leader>o", "Open old file picker", ":Pick oldfiles<cr>", "mini.pick") +mapkey("n", "<leader>/", "Open live grep picker", ":Pick grep_live<cr>", "mini.pick") + +-- File manager +mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini.files") diff --git a/pkgs/custom-neovim/config/lua/lsp.lua b/pkgs/custom-neovim/config/lua/lsp.lua index a01758c..a4a25bc 100644 --- a/pkgs/custom-neovim/config/lua/lsp.lua +++ b/pkgs/custom-neovim/config/lua/lsp.lua @@ -1,3 +1,23 @@ +-- Lua LS +vim.lsp.config("lua_ls", { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + root_markers = { + '.luarc.json', + '.luarc.jsonc', + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', + '.git', + }, + } +) +vim.lsp.enable("lua_ls") + +-- LSP Autocommands + -- Disable semantic tokens to stop weird highlighting. vim.api.nvim_create_autocmd('LspAttach', { callback = function(ev) @@ -16,22 +36,17 @@ vim.api.nvim_create_autocmd('LspAttach', { -- Enable completion triggered by <c-x><c-o> -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' - local mapkey = Utils.mapkey - - -- Workspace management - mapkey('n', "<leader>o", "Manage LSP workspace", "") - mapkey('n', '<leader>oa', "Add Workspace Folder", vim.lsp.buf.add_workspace_folder) - mapkey('n', '<leader>or', "Remove Workspace Folder", vim.lsp.buf.remove_workspace_folder) - mapkey('n', '<leader>ol', "List Workspace Folders", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end) + local mapkey = function(mode, key, desc, action, plugin) + local keymapper = plugin and require("lz.n").keymap(plugin).set or vim.keymap.set + keymapper(mode, key, action, {noremap = true, silent = true, desc = desc}) + end -- LSP Pickers mapkey('n', "<leader>a", "Perform code action", ":lua require('actions-preview').code_actions()<cr>") - -- mapkey("n", "<leader>I", "Open workspace diagnostic picker", ":Namu diagnostics<cr>") - mapkey("n", "<leader>i", "Open diagnostic picker", ":Namu diagnostics<cr>") - mapkey("n", "<leader>s", "Open symbol picker", ":Namu symbols<cr>") - mapkey("n", "<leader>S", "Open workspace symbol picker", ":Namu workspace<cr>") + mapkey("n", "<leader>S", "Open workspace symbol picker", [[:Pick lsp scope="workspace_symbol"<cr>]], "mini.pick") + mapkey("n", "<leader>s", "Open symbol picker", [[:Pick lsp scope="document_symbol"<cr>]], "mini.pick") + mapkey("n", "<leader>I", "Open workspace diagnostic picker", [[:Pick diagnostic scope="all"<cr>]], "mini.pick") + mapkey("n", "<leader>i", "Open diagnostic picker", [[:Pick diagnostic scope="current"<cr>]], "mini.pick") -- Goto Keys mapkey('n', 'gD', "Go to declaration", vim.lsp.buf.declaration) @@ -41,47 +56,11 @@ vim.api.nvim_create_autocmd('LspAttach', { -- Other LSP Keys mapkey('n', 'gs', "Signature Help", vim.lsp.buf.signature_help) - mapkey('n', 'gr', "Buffer References", vim.lsp.buf.references) + mapkey('n', 'gR', "Buffer References", vim.lsp.buf.references) + mapkey('n', 'gr', "Open ", vim.lsp.buf.references) mapkey('n', '<leader>r', "Rename Symbol", vim.lsp.buf.rename) mapkey('n', '<leader>h', "Format Buffer", function() vim.lsp.buf.format { async = true } end) end, }) - -local lspconfig = require('lspconfig') - --- Configure individual lsps -lspconfig.nil_ls.setup {} -lspconfig.lua_ls.setup { - on_init = function(client) - local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then - return - end - - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT' - }, - -- Make the server aware of Neovim runtime files - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- Depending on the usage, you might want to add additional paths here. - "${3rd}/luv/library" - -- "${3rd}/busted/library", - } - -- or pull in all of 'runtimepath'. NOTE: this is a lot slower - -- library = vim.api.nvim_get_runtime_file("", true) - } - }) - end, - settings = { - Lua = {} - } -} -lspconfig.marksman.setup {} diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua deleted file mode 100644 index b763d05..0000000 --- a/pkgs/custom-neovim/config/lua/mappings.lua +++ /dev/null @@ -1,112 +0,0 @@ --- Keymap function. -local mapkey = Utils.mapkey - --- Map the leader key. -vim.g.mapleader = ' ' - --- Pickers -mapkey("n", "<leader>f", "Open file picker", ":lua Snacks.picker.files()<cr>") -mapkey("n", "<leader>l", "Open recent file picker", ":lua Snacks.picker.recent()<cr>") -mapkey("n", "<leader>y", "Open clipboard history picker", ":lua Snacks.picker.cliphist()<cr>") -mapkey("n", "<leader>/", "Open live grep picker", ":lua Snacks.picker.grep()<cr>") -mapkey("n", "<leader>\\", "Open command palette", ":lua Snacks.picker.commands()<cr>") -mapkey("n", "<leader>?", "Open help picker", ":lua Snacks.picker.help()<cr>") -mapkey("n", "<leader>p", "Open picker picker", ":lua Snacks.picker.pickers()<cr>") -mapkey("n", "<leader>'", "Open last picker", ":lua Snacks.picker.resume()<cr>") -mapkey("n", "<leader><leader>", "Open smart picker", ":lua Snacks.picker.smart()<cr>") -mapkey("n", "<leader>z", "Open zoxide picker", ":lua Snacks.picker.zoxide()<cr>") -mapkey("n", "<leader>R", "Open treesitter picker", ":Namu treesitter<cr>") -mapkey("n", "<leader>k", "Open colorscheme picker", ":Namu colorscheme<cr>") - --- Dropbar -mapkey("n", "<leader>j", "Open dropdown", ":lua require('dropbar.api').pick()<cr>") - --- Tabs -mapkey("n", "<leader>t", "Manage tabs", "") -mapkey("n", "<leader>to", "Open new tab", ":tabnew<cr>") -mapkey("n", "<leader>tc", "Close tab", ":tabclose<cr>") -mapkey("n", "<leader>tt", "Go to next tab", ":tabnext<cr>") -mapkey("n", "<leader>tT", "Go to previous tab", ":tabprev<cr>") - --- Buffers -mapkey("n", "<leader>b", "Manage buffers", "") -mapkey("n", "<leader>bb", "Go to next buffer", ":bn<cr>") -mapkey("n", "<leader>bB", "Go to previous buffer", ":bp<cr>") -mapkey("n", "<leader>bd", "Delete current buffer", ":bd<cr>") -mapkey("n", "<leader>bD", "Force delete current buffer", ":bd!<cr>") -mapkey("n", "<leader>bp", "Open buffer picker", ":lua Snacks.picker.buffers()<cr>") -mapkey("n", "<leader>bg", "Open buffer live grep picker", ":lua Snacks.picker.grep_buffers()<cr>") -mapkey("n", "<leader>bc", "Clear invisible buffers", function () - local bufinfos = vim.fn.getbufinfo({buflisted = 1}) - vim.tbl_map(function (bufinfo) - if bufinfo.changed == 0 and (not bufinfo.windows or #bufinfo.windows == 0) then - print(('Deleting buffer %d : %s'):format(bufinfo.bufnr, bufinfo.name)) - vim.api.nvim_buf_delete(bufinfo.bufnr, {force = false, unload = false}) - end - end, bufinfos) -end) - --- Windows -mapkey("n", "<leader>w", "Manage windows", "<C-w>") -mapkey("n", "<C-w>S", "Open new horizontally", ":new<cr>") -mapkey("n", "<leader>wS", "Open new horizontally", ":new<cr>") -mapkey("n", "<C-w>V", "Open new vertically", ":vnew<cr>") -mapkey("n", "<leader>wV", "Open new vertically", ":vnew<cr>") - --- Sessions -mapkey("n", "<leader>m", "Manage sessions", "") -mapkey("n", "<leader>mm", "Open session picker", ":Autosession search<cr>") -mapkey("n", "<leader>md", "Delete a session", ":Autosession delete<cr>") - --- Terminals -mapkey("n", "<leader>c", "Manage terminals", "") -mapkey("n", "<leader>cc", "Toggle terminal", ":lua Snacks.terminal.toggle()<cr>") -mapkey("n", "<leader>co", "Open new terminal", ":lua Snacks.terminal.open()<cr>") - --- Git -mapkey("n", "<leader>g", "Manage git", "") -mapkey("n", "<leader>gg", "Open lazygit", ":lua Snacks.lazygit()<cr>") -mapkey("n", "<leader>ga", "Add the current file", ":Git add %<cr>") -mapkey("n", "<leader>gs", "Open git status picker", ":lua Snacks.picker.git_status()<cr>") - --- Other leader keys -mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>") - --- QOL Keys -mapkey("t", "<Esc><Esc>", "Exit terminal insert mode", "<C-\\><C-n>") -vim.keymap.set("c", "<cr>", function() - if vim.fn.pumvisible() == 1 then return '<c-y>' end - return '<cr>' -end, { expr = true }) -- Make enter complete command. -mapkey("n", "<esc>", "Clear highlights", ":noh<cr>") -- Make esc clear highlights - --- Newline in normal mode. -mapkey('n', '<CR>', "Add newline below", 'm`o<Esc>``') -mapkey('n', '<S-CR>', "Add newline above", 'm`O<Esc>``') - --- Really delete -mapkey({"n", "v"}, "<leader>d", "Really delete", [["_d]]) -mapkey({"n", "v"}, "<leader>x", "Really delete character", [["_x]]) - --- Visual Movement Keys. -mapkey({"n", "v"}, "j", "Go down visually", "gj") -mapkey({"n", "v"}, "k", "Go up visually", "gk") - --- Exit neovim -mapkey("n", "<leader>q", "Save and exit neovim", function() - vim.cmd("wa!") - vim.cmd("qa!") -end) - -mapkey("n", "<leader>Q", "Exit neovim", function() - vim.cmd("qa!") -end) - --- Dimming -mapkey("n", "<leader>u", "Toggle scope dimming", function() - if Snacks.dim.enabled then - Snacks.dim.disable() - else - Snacks.dim.enable() - end -end) diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua deleted file mode 100644 index 9d648c4..0000000 --- a/pkgs/custom-neovim/config/lua/neovide.lua +++ /dev/null @@ -1,48 +0,0 @@ -if vim.g.neovide then - vim.o.guifont = "CodeNewRoman Nerd Font:h12" - vim.g.neovide_scale_factor = 0.8 - - vim.g.neovide_floating_shadow = false - - -- Zoom keymaps. - local change_scale_factor = function(delta) - vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + delta - end - vim.keymap.set("n", "<C-=>", function() - change_scale_factor(0.05) - end) - vim.keymap.set("n", "<C-->", function() - change_scale_factor(-0.05) - end) - - -- Standard terminal emulator keymaps. - vim.api.nvim_set_keymap("c", "<sc-v>", "<C-R>+", { noremap = true }) -- Paste in command mode. - vim.api.nvim_set_keymap('t', '<sc-v>', '<C-\\><C-n>"+Pi', {noremap = true}) -- Paste in terminal mode. - - - local positionAnimationLength = 0.2 - local scrollAnimationFarLines = 0.1 - local scrollAnimationLength = 0.1 - vim.g.neovide_position_animation_length = positionAnimationLength - vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines - vim.g.neovide_scroll_animation_length = scrollAnimationLength - - -- Don't smooth scroll in terminals. - vim.api.nvim_create_autocmd("BufEnter", { - pattern = "*", - callback = function(args) - local filetype = vim.api.nvim_buf_get_option(args.buf, "filetype") - - -- When entering terminal for first time I noticed the filetype is empty - if filetype == '' or filetype == 'terminal' then - vim.g.neovide_position_animation_length = 0 - vim.g.neovide_scroll_animation_far_lines = 0 - vim.g.neovide_scroll_animation_length = 0 - else - vim.g.neovide_position_animation_length = positionAnimationLength - vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines - vim.g.neovide_scroll_animation_length = scrollAnimationLength - end - end, - }) -end diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index 20f3e01..6840085 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -1,43 +1,16 @@ --- General Settings -vim.o.winborder = 'rounded' -vim.o.showtabline = 2 -- whether to only show tabline if there is more than one tab. +-- General +vim.opt.clipboard = "unnamedplus" -- use system clipboard +vim.o.mouse = "" -- Don't use mouse + +-- UI +vim.o.winborder = 'rounded' -- rounded window borders where possible. +vim.o.showtabline = 1 -- whether to only show tabline if there is more than one tab. vim.o.laststatus = 3 -- only have one statusline at the bottom of the window. vim.o.showmode = false -- don't show the mode in the commandline. vim.o.ruler = false -- don't show #,# in the commandline. -vim.o.icm = 'split' -vim.o.cia = 'abbr,kind,menu' -vim.o.mouse = "" vim.o.number = true -- set absolute numbered lines --- vim.o.relativenumber = true -- set relative numbered lines vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time -vim.o.clipboard = "unnamedplus" -- use system clipboard --- vim.o.equalalways = true -- equalize splits -vim.o.sessionoptions = "blank,curdir,folds,help,tabpages,winsize,winpos,terminal,globals,buffers,localoptions" -- define what is saved with the session. - --- Split Behavior -vim.o.splitright = true -vim.o.splitbelow = true - --- Indention -local indent = 2 -vim.o.autoindent = true -- auto indentation -vim.o.expandtab = true -- convert tabs to spaces -vim.o.shiftwidth = indent -- the number of spaces inserted for each indentation -vim.o.smartindent = true -- make indenting smarter -vim.o.softtabstop = indent -- when hitting <BS>, pretend like a tab is removed, even if spaces -vim.o.tabstop = indent -- insert 2 spaces for a tab -vim.o.shiftround = true -- use multiple of shiftwidth when indenting with "<" and ">" - --- Backups -vim.o.backup = false -- create a backup file -vim.o.swapfile = false -- creates a swapfile -vim.o.writebackup = false -- if a file is being edited by another program, it is not allowed to be edited - --- Search -vim.o.hlsearch = true -- highlight all matches on previous search pattern -vim.o.ignorecase = true -- ignore case in search patterns -vim.o.smartcase = true -- smart case -- Folding vim.o.foldmethod = "expr" @@ -56,3 +29,22 @@ vim.opt.fillchars = { vertright = '┣', verthoriz = '╋', } + +-- Splits +vim.o.splitright = true +vim.o.splitbelow = true + +-- Indention +local indent = 2 +vim.o.autoindent = true -- auto indentation +vim.o.expandtab = true -- convert tabs to spaces +vim.o.shiftwidth = indent -- the number of spaces inserted for each indentation +vim.o.smartindent = true -- make indenting smarter +vim.o.softtabstop = indent -- when hitting <BS>, pretend like a tab is removed, even if spaces +vim.o.tabstop = indent -- insert 2 spaces for a tab +vim.o.shiftround = true -- use multiple of shiftwidth when indenting with "<" and ">" + +-- Backups +vim.o.backup = false -- create a backup file +vim.o.swapfile = false -- creates a swapfile +vim.o.writebackup = false -- if a file is being edited by another program, it is not allowed to be edited diff --git a/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua b/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua deleted file mode 100644 index 0e3cc02..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("actions-preview").setup { - backend = {"snacks"} -} diff --git a/pkgs/custom-neovim/config/lua/plugins/auto-session.lua b/pkgs/custom-neovim/config/lua/plugins/auto-session.lua deleted file mode 100644 index 99df59b..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/auto-session.lua +++ /dev/null @@ -1 +0,0 @@ -require("auto-session").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua b/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua new file mode 100644 index 0000000..1ca3c7e --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/colorschemes.lua @@ -0,0 +1,19 @@ +return { + { + "nightfox.nvim", + -- lazy = false, + event = "VimEnter", + after = function () + require("nightfox").setup { + options = { + module_default = false, + modules = { + "mini", + "treesitter", + }, + }, + } + vim.cmd.colorscheme("carbonfox") + end + }, +} diff --git a/pkgs/custom-neovim/config/lua/plugins/comment.lua b/pkgs/custom-neovim/config/lua/plugins/comment.lua deleted file mode 100644 index bd47faf..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/comment.lua +++ /dev/null @@ -1 +0,0 @@ -require("Comment").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/dropbar.lua b/pkgs/custom-neovim/config/lua/plugins/dropbar.lua deleted file mode 100644 index 5d4bb43..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/dropbar.lua +++ /dev/null @@ -1,43 +0,0 @@ -local dropbar = require('dropbar') -local sources = require('dropbar.sources') -local utils = require('dropbar.utils') - -Utils.link_highlight("DropBarFileName", "MiniFilesTitleFocused") - -local custom_path = { - get_symbols = function(buff, win, cursor) - local symbols = sources.path.get_symbols(buff, win, cursor) - symbols[#symbols].name_hl = 'DropBarFileName' - if vim.bo[buff].modified then - symbols[#symbols].name = symbols[#symbols].name .. ' [+]' - symbols[#symbols].name_hl = 'DropBarFileName' - symbols[#symbols].truncate = false - end - return symbols - end, -} - -dropbar.setup({ - bar = { - sources = function(buf, _) - if vim.bo[buf].ft == 'markdown' then - return { - custom_path, - sources.markdown, - } - end - -- if vim.bo[buf].buftype == 'terminal' then - -- return { - -- sources.terminal, - -- } - -- end - return { - custom_path, - utils.source.fallback { - sources.lsp, - sources.treesitter, - }, - } - end, - }, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/fidget.lua b/pkgs/custom-neovim/config/lua/plugins/fidget.lua deleted file mode 100644 index 4f1ab35..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/fidget.lua +++ /dev/null @@ -1 +0,0 @@ -require("fidget").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/focus.lua b/pkgs/custom-neovim/config/lua/plugins/focus.lua deleted file mode 100644 index 560f3ce..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/focus.lua +++ /dev/null @@ -1,18 +0,0 @@ -require("focus").setup { - enable = true, - split = { - -- bufnew = true, - }, - ui = { - winhighlight = true, -- Highlight focused and unfocused windows - signcolumn = false, -- Signcolumn on all windows - -- cursorline = false, - }, -} - -vim.api.nvim_create_autocmd("WinEnter", { - pattern = "picker", - callback = function(args) - vim.b[args.buf].cursorline = false - end, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/gitsigns.lua b/pkgs/custom-neovim/config/lua/plugins/gitsigns.lua deleted file mode 100644 index d16d238..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/gitsigns.lua +++ /dev/null @@ -1 +0,0 @@ -require("gitsigns").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/incline.lua b/pkgs/custom-neovim/config/lua/plugins/incline.lua deleted file mode 100644 index 92ced03..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/incline.lua +++ /dev/null @@ -1,25 +0,0 @@ -local icons = require 'mini.icons' -require('incline').setup { - hide = { - only_win = true, - }, - window = { - padding = 0, - margin = { horizontal = 0 }, - }, - render = function(props) - local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t') - if filename == '' then - filename = '[No Name]' - end - local ft_icon, ft_hl = icons.get("file", filename) - local modified = vim.bo[props.buf].modified - return { - ft_icon and { ' ', ft_icon, ' ', gui = ft_hl } or '', - ' ', - { filename, gui = 'bold' }, - ' ', - modified and '[+] ' or '', - } - end, -} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-clue.lua b/pkgs/custom-neovim/config/lua/plugins/mini-clue.lua new file mode 100644 index 0000000..752b001 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini-clue.lua @@ -0,0 +1,57 @@ +return { + "mini.clue", + event = "VimEnter", -- Load after everything else to capture all keybinds. + after = function() + local miniclue = require('mini.clue') + miniclue.setup({ + triggers = { + -- Leader triggers + { mode = 'n', keys = '<Leader>' }, + { mode = 'x', keys = '<Leader>' }, + + -- Built-in completion + { mode = 'i', keys = '<C-x>' }, + + -- `g` key + { mode = 'n', keys = 'g' }, + { mode = 'x', keys = 'g' }, + + -- Marks + { mode = 'n', keys = "'" }, + { mode = 'n', keys = '`' }, + { mode = 'x', keys = "'" }, + { mode = 'x', keys = '`' }, + + -- Registers + { mode = 'n', keys = '"' }, + { mode = 'x', keys = '"' }, + { mode = 'i', keys = '<C-r>' }, + { mode = 'c', keys = '<C-r>' }, + + -- Window commands + { mode = 'n', keys = '<C-w>' }, + + -- `z` key + { mode = 'n', keys = 'z' }, + { mode = 'x', keys = 'z' }, + }, + + clues = { + { mode = {'n', 'v'}, keys = '<Leader>' }, + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + }, + + window = { + delay = 0, + + scroll_down = "<C-d>", + scroll_up = "<C-u>", + }, + }) + end +} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-files.lua b/pkgs/custom-neovim/config/lua/plugins/mini-files.lua new file mode 100644 index 0000000..d979221 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini-files.lua @@ -0,0 +1,6 @@ +return { + "mini.files", + after = function() + require("mini.files").setup() + end +} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua b/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua new file mode 100644 index 0000000..c08c1de --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua @@ -0,0 +1,22 @@ +return { + "mini.pick", + cmd = "Pick", + after = function() + local win_config = function() + local height = math.floor(0.618 * vim.o.lines) + local width = math.floor(0.618 * vim.o.columns) + return { + anchor = 'NW', height = height, width = width, + row = math.floor(0.5 * (vim.o.lines - height)), + col = math.floor(0.5 * (vim.o.columns - width)), + } + end + require("mini.pick").setup { + window = { + config = win_config, + }, + } + vim.cmd.packadd("mini.extra") + require("mini.extra").setup() + end +} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua b/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua new file mode 100644 index 0000000..f3bf10b --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini-statusline.lua @@ -0,0 +1,7 @@ +return { + "mini.statusline", + lazy = false, + after = function() + require("mini.statusline").setup() + end +} diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/clue.lua b/pkgs/custom-neovim/config/lua/plugins/mini/clue.lua deleted file mode 100644 index 3dcac1b..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/clue.lua +++ /dev/null @@ -1,66 +0,0 @@ -local miniclue = require('mini.clue') -miniclue.setup({ - triggers = { - -- Leader triggers - { mode = 'n', keys = '<Leader>' }, - { mode = 'v', keys = '<Leader>' }, - - -- Built-in completion - { mode = 'i', keys = '<C-x>' }, - - -- `g` key - { mode = 'n', keys = 'g' }, - { mode = 'v', keys = 'g' }, - - -- Marks - { mode = 'n', keys = "'" }, - { mode = 'v', keys = "'" }, - { mode = 'n', keys = '`' }, - { mode = 'v', keys = '`' }, - - -- Registers - { mode = 'n', keys = '"' }, - { mode = 'v', keys = '"' }, - { mode = 'i', keys = '<C-r>' }, - { mode = 'c', keys = '<C-r>' }, - - -- Window commands - { mode = 'n', keys = '<C-w>' }, - -- { mode = 'n', keys = '<leader>w' }, - - -- `z` key - { mode = 'v', keys = 'z' }, - { mode = 'n', keys = 'z' }, - }, - - clues = { - { mode = {'n', 'v'}, keys = '<Leader>' }, - miniclue.gen_clues.builtin_completion(), - miniclue.gen_clues.g(), - miniclue.gen_clues.marks(), - miniclue.gen_clues.registers(), - miniclue.gen_clues.windows(), - Utils.replaceInTable(miniclue.gen_clues.windows(), "<C%-w>", "<leader>w"), - miniclue.gen_clues.z(), - }, - - window = { - delay = 0, - - scroll_down = "<C-d>", - scroll_up = "<C-u>", - }, -}) - -vim.api.nvim_create_autocmd("TermOpen", { - callback = function() - vim.cmd.lua("MiniClue.ensure_buf_triggers()") - end, -}) - -vim.api.nvim_create_autocmd("User", { - pattern = "MiniFilesWindowOpen", - callback = function() - vim.cmd.lua("MiniClue.ensure_buf_triggers()") - end, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/cursorword.lua b/pkgs/custom-neovim/config/lua/plugins/mini/cursorword.lua deleted file mode 100644 index 530b88b..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/cursorword.lua +++ /dev/null @@ -1 +0,0 @@ -require("mini.cursorword").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/files.lua b/pkgs/custom-neovim/config/lua/plugins/mini/files.lua deleted file mode 100644 index 1dc1c3e..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/files.lua +++ /dev/null @@ -1,91 +0,0 @@ -require("mini.files").setup { - mappings = { - close = '<esc>', - go_in = 'L', - go_in_plus = "<cr>", - go_out = 'H', - go_out_plus = '<c-h>', - mark_goto = "'", - mark_set = 'm', - reset = '<bs>', - reveal_cwd = '@', - show_help = 'g?', - synchronize = '=', - trim_left = '<', - trim_right = '>', - }, - windows = { - preview = true, - }, -} - --- Set focused directory as current working directory -local set_cwd = function() - local path = (MiniFiles.get_fs_entry() or {}).path - if path == nil then return vim.notify('Cursor is not on valid entry') end - vim.fn.chdir(vim.fs.dirname(path)) -end - --- Yank in register full path of entry under cursor -local yank_path = function() - local path = (MiniFiles.get_fs_entry() or {}).path - if path == nil then return vim.notify('Cursor is not on valid entry') end - vim.fn.setreg(vim.v.register, path) -end - --- Open path with system default handler (useful for non-text files) -local ui_open = function() vim.ui.open(MiniFiles.get_fs_entry().path) end - -vim.api.nvim_create_autocmd('User', { - pattern = 'MiniFilesBufferCreate', - callback = function(args) - local b = args.data.buf_id - vim.keymap.set('n', 'g~', set_cwd, { buffer = b, desc = 'Set cwd' }) - vim.keymap.set('n', 'gX', ui_open, { buffer = b, desc = 'OS open' }) - vim.keymap.set('n', 'gy', yank_path, { buffer = b, desc = 'Yank path' }) - end, -}) - --- Add custom bookmarks. -local set_mark = function(id, path, desc) - MiniFiles.set_bookmark(id, path, { desc = desc }) -end - -vim.api.nvim_create_autocmd('User', { - pattern = 'MiniFilesExplorerOpen', - callback = function() - set_mark('w', vim.fn.getcwd, 'Working directory') -- callable - set_mark('~', '~', 'Home directory') - end, -}) - --- Add split keys -local map_split = function(buf_id, lhs, direction) - local rhs = function() - -- Make new window and set it as target - local cur_target = MiniFiles.get_explorer_state().target_window - local new_target = vim.api.nvim_win_call(cur_target, function() - vim.cmd(direction .. ' split') - return vim.api.nvim_get_current_win() - end) - - MiniFiles.set_target_window(new_target) - - MiniFiles.go_in() - end - - -- Adding `desc` will result into `show_help` entries - local desc = 'Split ' .. direction - vim.keymap.set('n', lhs, rhs, { buffer = buf_id, desc = desc }) -end - -vim.api.nvim_create_autocmd('User', { - pattern = 'MiniFilesBufferCreate', - callback = function(args) - local buf_id = args.data.buf_id - -- Tweak keys to your liking - map_split(buf_id, '<C-s>', 'belowright horizontal') - map_split(buf_id, '<C-v>', 'belowright vertical') - map_split(buf_id, '<C-t>', 'tab') - end, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/git.lua b/pkgs/custom-neovim/config/lua/plugins/mini/git.lua deleted file mode 100644 index 943f91d..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/git.lua +++ /dev/null @@ -1 +0,0 @@ -require("mini.git").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/icons.lua b/pkgs/custom-neovim/config/lua/plugins/mini/icons.lua deleted file mode 100644 index fd2c5f9..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/icons.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("mini.icons").setup() - -MiniIcons.mock_nvim_web_devicons() diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/indentscope.lua b/pkgs/custom-neovim/config/lua/plugins/mini/indentscope.lua deleted file mode 100644 index 2543c40..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/indentscope.lua +++ /dev/null @@ -1,6 +0,0 @@ -require("mini.indentscope").setup() - --- Don't work in terminal or help windows. -local f = function(args) vim.b[args.buf].miniindentscope_disable = true end -vim.api.nvim_create_autocmd('Filetype', { pattern = 'help', callback = f }) -vim.api.nvim_create_autocmd('TermOpen', {callback = f}) diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/pairs.lua b/pkgs/custom-neovim/config/lua/plugins/mini/pairs.lua deleted file mode 100644 index 493c4d0..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/pairs.lua +++ /dev/null @@ -1 +0,0 @@ -require("mini.pairs").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua b/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua deleted file mode 100644 index 1ec6e7f..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua +++ /dev/null @@ -1,20 +0,0 @@ -require("mini.tabline").setup { - format = function(buf_id, label) - local suffix = vim.bo[buf_id].modified and '[+] ' or '' - return MiniTabline.default_format(buf_id, label) .. suffix - end -} - -local link_hl = Utils.link_highlight - -vim.api.nvim_create_autocmd({"Colorscheme", "VimEnter"}, { - - callback = function() - -- Change colors. - - -- Make modified buffers the same color. - link_hl("MiniTablineModifiedHidden", "MiniTablineHidden") - link_hl("MiniTablineModifiedVisible", "MiniTablineVisible") - link_hl("MiniTablineModifiedCurrent", "MiniTablineCurrent") - end, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/namu.lua b/pkgs/custom-neovim/config/lua/plugins/namu.lua deleted file mode 100644 index 82275b9..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/namu.lua +++ /dev/null @@ -1 +0,0 @@ -require("namu").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/presence.lua b/pkgs/custom-neovim/config/lua/plugins/presence.lua deleted file mode 100644 index 7ffb57f..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/presence.lua +++ /dev/null @@ -1,3 +0,0 @@ -require('presence').setup({ - neovim_image_text = "Neovim Text Editor", -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/render-markdown.lua b/pkgs/custom-neovim/config/lua/plugins/render-markdown.lua deleted file mode 100644 index 45bdcf2..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/render-markdown.lua +++ /dev/null @@ -1 +0,0 @@ -require("render-markdown").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/snacks.lua b/pkgs/custom-neovim/config/lua/plugins/snacks.lua deleted file mode 100644 index c2cf737..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/snacks.lua +++ /dev/null @@ -1,36 +0,0 @@ -require("snacks").setup { - bigfile = { enabled = true }, - picker = { - enabled = true, - win = { - input = { - keys = { - ["<Esc>"] = { "close", mode = { "n", "i" } }, - }, - }, - }, - }, - lazygit = { - enabled = true, - config = { - quitOnTopLevelReturn = true, - }, - win = { - height = 0.8, - }, - }, - input = { - enabled = true, - }, - terminal = { - -- interactive = false, - start_insert = true, - auto_insert = true, - win = { - height = 0.2, - }, - keys = {}, - }, -} - --- Utils.mapkey("t", "<c-w>", "Manage windows", "<c-\\><c-o><c-w>") diff --git a/pkgs/custom-neovim/config/lua/plugins/tabby.lua b/pkgs/custom-neovim/config/lua/plugins/tabby.lua deleted file mode 100644 index c00dad7..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/tabby.lua +++ /dev/null @@ -1,53 +0,0 @@ -local general_theme = Utils.generate_theme_from_highlight_groups() -local colors = { - current = { fg = general_theme.modes.normal, bg = general_theme.background, style = 'bold'}, - not_current = { fg = general_theme.text.light, bg = general_theme.background }; - fill = { bg = general_theme.background }; -}; -local theme = { - fill = colors.fill, - head = colors.fill, - current_tab = colors.current, - tab = colors.not_current, - win = colors.fill, - tail = colors.fill, -} -require('tabby').setup({ - line = function(line) - return { - { - -- { ' ', hl = theme.head }, - -- line.sep('', theme.head, theme.fill), - }, - line.tabs().foreach(function(tab) - local hl = tab.is_current() and theme.current_tab or theme.tab - return { - line.sep('', hl, theme.fill), - -- tab.is_current() and '' or '', - -- tab.number(), - tab.name(), - line.sep('', hl, theme.fill), - hl = hl, - margin = ' ', - } - end), - line.spacer(), - line.wins_in_tab(line.api.get_current_tab()).foreach(function(win) - return { - line.sep('', theme.win, theme.fill), - -- win.is_current() and '' or '', - win.buf_name(), - line.sep('', theme.win, theme.fill), - hl = theme.win, - margin = ' ', - } - end), - { - line.sep('', theme.tail, theme.fill), - -- { ' ', hl = theme.tail }, - }, - hl = theme.fill, - } - end, - -- option = {}, -- setup modules' option, -}) diff --git a/pkgs/custom-neovim/config/lua/plugins/treesitter.lua b/pkgs/custom-neovim/config/lua/plugins/treesitter.lua deleted file mode 100644 index 3ad4c9f..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/treesitter.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("nvim-treesitter.configs").setup { - highlight = { - enable = true, - }, -} diff --git a/pkgs/custom-neovim/config/lua/plugins/ts-autotag.lua b/pkgs/custom-neovim/config/lua/plugins/ts-autotag.lua deleted file mode 100644 index 67b9f06..0000000 --- a/pkgs/custom-neovim/config/lua/plugins/ts-autotag.lua +++ /dev/null @@ -1 +0,0 @@ -require("nvim-ts-autotag").setup() diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua deleted file mode 100644 index 08bbe50..0000000 --- a/pkgs/custom-neovim/config/lua/statusline.lua +++ /dev/null @@ -1,249 +0,0 @@ --- Custom Statusline - --- About 1/3 of this code is from https://github.com/MariaSolOs/dotfiles/blob/f1d6229f4a4675745aff95c540dc8f1b9007a77a/.config/nvim/lua/statusline.lua - --- Highlight pattern -local hi_pattern = '%%#%s#%s%%*' - --- Convert mode to string -local mode_to_str = { - ['n'] = 'NORMAL', - ['no'] = 'OP-PENDING', - ['nov'] = 'OP-PENDING', - ['noV'] = 'OP-PENDING', - ['no\22'] = 'OP-PENDING', - ['niI'] = 'NORMAL', - ['niR'] = 'NORMAL', - ['niV'] = 'NORMAL', - ['nt'] = 'NORMAL', - ['ntT'] = 'NORMAL', - ['v'] = 'VISUAL', - ['vs'] = 'VISUAL', - ['V'] = 'VISUAL', - ['Vs'] = 'VISUAL', - ['\22'] = 'VISUAL', - ['\22s'] = 'VISUAL', - ['s'] = 'SELECT', - ['S'] = 'SELECT', - ['\19'] = 'SELECT', - ['i'] = 'INSERT', - ['ic'] = 'INSERT', - ['ix'] = 'INSERT', - ['R'] = 'REPLACE', - ['Rc'] = 'REPLACE', - ['Rx'] = 'REPLACE', - ['Rv'] = 'VIRT REPLACE', - ['Rvc'] = 'VIRT REPLACE', - ['Rvx'] = 'VIRT REPLACE', - ['c'] = 'COMMAND', - ['cv'] = 'VIM EX', - ['ce'] = 'EX', - ['r'] = 'PROMPT', - ['rm'] = 'MORE', - ['r?'] = 'CONFIRM', - ['!'] = 'SHELL', - ['t'] = 'TERMINAL', -} - -local statusline_components = {} - -statusline_components.micro_spacer = function() - return " " -end - -statusline_components.small_spacer = function() - return " " -end - -statusline_components.spacer = function() - return '%=' -end - -statusline_components.diagnostic_status = function() - local diagnostics = {} - - local errors = #vim.diagnostic.get(0, { severity = 1 }) - - if errors > 0 then - table.insert(diagnostics, "%#DiagnosticSignError# " .. tostring(errors)) - end - - local warnings = #vim.diagnostic.get(0, { severity = 2 }) - - if warnings > 0 then - table.insert(diagnostics, "%#DiagnosticSignWarn# " .. tostring(warnings)) - end - - local infos = #vim.diagnostic.get(0, { severity = 3 }) - - if infos > 0 then - table.insert(diagnostics, "%#DiagnosticSignInfo# " .. tostring(infos)) - end - - local hints = #vim.diagnostic.get(0, { severity = 4 }) - - if hints > 0 then - table.insert(diagnostics, "%#DiagnosticSignHint# " .. tostring(hints)) - end - - table.insert(diagnostics, "%#StatusLine#") - - vim.defer_fn(vim.cmd.redrawstatus, 500) - - -- Don't show diagnostics in insert mode. - if mode_to_str[vim.api.nvim_get_mode().mode]:find "INSERT" then - return "" - end - - return table.concat(diagnostics, " ") -end - -statusline_components.mode = function() - -- Get the respective string to display. - local mode = mode_to_str[vim.api.nvim_get_mode().mode] or 'UNKNOWN' - - -- Set the highlight group. - local hl = 'MiniStatuslineModeOther' - if mode:find 'NORMAL' then - hl = 'MiniStatuslineModeNormal' - elseif mode:find 'PENDING' then - hl = 'MiniStatuslineModeNormal' - elseif mode:find 'VISUAL' then - hl = 'MiniStatuslineModeVisual' - elseif mode:find 'REPLACE' then - hl = 'MiniStatuslineModeReplace' - elseif mode:find 'INSERT' or mode:find 'SELECT' then - hl = 'MiniStatuslineModeInsert' - elseif mode:find 'COMMAND' or mode:find 'TERMINAL' or mode:find 'EX' then - hl = 'MiniStatuslineModeCommand' - end - - -- Construct the component. - return hi_pattern:format(hl, string.format(' %s ', mode)) -end - -statusline_components.position = function() - -- Get the respective string to display. - local mode = mode_to_str[vim.api.nvim_get_mode().mode] or 'UNKNOWN' - - -- Set the highlight group. - local hl = 'MiniStatuslineModeOther' - if mode:find 'NORMAL' then - hl = 'MiniStatuslineModeNormal' - elseif mode:find 'PENDING' then - hl = 'MiniStatuslineModeNormal' - elseif mode:find 'VISUAL' then - hl = 'MiniStatuslineModeVisual' - elseif mode:find 'REPLACE' then - hl = 'MiniStatuslineModeReplace' - elseif mode:find 'INSERT' or mode:find 'SELECT' then - hl = 'MiniStatuslineModeInsert' - elseif mode:find 'COMMAND' or mode:find 'TERMINAL' or mode:find 'EX' then - hl = 'MiniStatuslineModeCommand' - end - - -- Construct the component. - return hi_pattern:format(hl, ' %2l:%-2c ') -end - -statusline_components.git_branch = function() - if vim.g.gitsigns_head then - return string.format(' %s', vim.g.gitsigns_head) - else - return '' -- Return an empty string or some default value if the branch name is not available - end -end - -statusline_components.git_status = function() - if not vim.b.gitsigns_status_dict then - return '' - end - - if not vim.b.gitsigns_status_dict.added then - return '' - end - - if not vim.b.gitsigns_status_dict.changed then - return '' - end - - if not vim.b.gitsigns_status_dict.removed then - return '' - end - - local status = {} - - local gitsigns_status = vim.b.gitsigns_status_dict - - if gitsigns_status.added > 0 then - table.insert(status, hi_pattern:format("Added", (" %s"):format(gitsigns_status.added))) - end - - if gitsigns_status.changed > 0 then - table.insert(status, hi_pattern:format("Changed", (" %s"):format(gitsigns_status.changed))) - end - - if gitsigns_status.removed > 0 then - table.insert(status, hi_pattern:format("Removed", (" %s"):format(gitsigns_status.removed))) - end - - return table.concat(status, " ") -end - -statusline_components.working_directory = function() - local text = vim.fn.getcwd() - - local parts = {} - for part in string.gmatch(text, "[^/]+") do - table.insert(parts, part) - end - - -- replace /home/USER with ~/ - if #parts >= 3 then - table.remove(parts, 1) - table.remove(parts, 1) - table.insert(parts, 1, "~") - end - - text = table.concat(parts, "/") - - -- if the cwd takes up more than half the bar width, shorten it. - if text:len() > (vim.api.nvim_win_get_width(0) / 2.5) then - if #parts >= 1 then - text = ".../" .. parts[#parts] - end - end - return string.format('%s', text) -end - -Statusline_component = function(name) - return statusline_components[name]() -end - -local get_component = function(name) - return string.format('%%{%%v:lua.Statusline_component("%s")%%} ', name) -end - -local statusline = { - get_component("micro_spacer"), - - get_component("mode"), - get_component("micro_spacer"), - get_component("working_directory"), - get_component("micro_spacer"), - get_component("git_branch"), - get_component("micro_spacer"), - get_component("git_status"), - get_component("micro_spacer"), - get_component("diagnostic_status"), - - get_component("spacer"), - - '%{&filetype}', -- filetype - get_component("micro_spacer"), - '%2p%%', -- progress % - get_component("micro_spacer"), - get_component("position"), -} - -vim.o.statusline = table.concat(statusline, '') diff --git a/pkgs/custom-neovim/config/lua/utilities.lua b/pkgs/custom-neovim/config/lua/utilities.lua deleted file mode 100644 index d2a26b6..0000000 --- a/pkgs/custom-neovim/config/lua/utilities.lua +++ /dev/null @@ -1,51 +0,0 @@ -Utils = {} - -Utils.mapkey = function(mode, key, desc, action) - vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) -end - -Utils.generate_theme_from_highlight_groups = function() - local get_highlight_colors = function(group) - local raw_colors = vim.api.nvim_get_hl(0, {name = group}) - local decimal_to_hex = function(decimal_color) - if decimal_color == nil then return nil end - return string.format("#%06X", decimal_color) - end - return { - fg = decimal_to_hex(raw_colors.fg), - bg = decimal_to_hex(raw_colors.bg), - } - end - return { - modes = { - normal = get_highlight_colors("MiniStatuslineModeNormal").bg, - insert = get_highlight_colors("MiniStatuslineModeInsert").bg, - visual = get_highlight_colors("MiniStatuslineModeVisual").bg, - replace = get_highlight_colors("MiniStatuslineModeReplace").bg, - command = get_highlight_colors("MiniStatuslineModeCommand").bg, - inactive = get_highlight_colors("MiniStatuslineModeInactive").bg, - }, - text = { - dark = get_highlight_colors("MiniStatuslineModeNormal").fg, - light = get_highlight_colors("Normal").fg, - }, - background = get_highlight_colors("Normal").bg, - } -end - -Utils.link_highlight = function(first_highlight, second_highlight) - vim.cmd.highlight {bang = true, "link", first_highlight, second_highlight} -end - -Utils.replaceInTable = function(t, str1, str2) - for key, value in pairs(t) do - if type(value) == "string" then - -- Replace <C-w> with <leader>w in the string - t[key] = value:gsub(str1, str2) - elseif type(value) == "table" then - -- Recursively process nested tables - Utils.replaceInTable(value, str1, str2) - end - end - return t -end |
