From 538cec8c59f121aebb4b7ffc1f595c0bc4c70be8 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 07:38:57 -0700 Subject: [PATCH 001/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 57 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index c6df73e9..64145443 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "auto-session": { "branch": "main", "commit": "08c279882d4117a3e6ade1a014f7cf4af7c34fec" }, + "LuaSnip": { "branch": "master", "commit": "7552e6504ee95a9c8cfc6db53e389122ded46cd4" }, + "auto-session": { "branch": "main", "commit": "5dd96000324d5f7448dec096281b6caf64d79913" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -15,63 +15,62 @@ "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" }, + "gitsigns.nvim": { "branch": "main", "commit": "0ed466953fe5885166e0d60799172a8b1f752d16" }, "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, - "lazy.nvim": { "branch": "main", "commit": "8f6225751138329da339eb6554d40158768d23ff" }, - "lazydev.nvim": { "branch": "main", "commit": "02f1055a777264d4b65896051ec28d0f322f7932" }, + "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4ba55f9755ebe8297d92c419b90a946123292ae6" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "neogit": { "branch": "master", "commit": "af1d8d88f426a4da63c913f3b81a37350dbe8d02" }, + "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "2cde745aadc2c36f6860a77a556494870675771a" }, - "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" }, + "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, + "nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "dcc85d12d6e2c18c5fa0f9a304d9f5e767e1401a" }, "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, "nvim-highlight-colors": { "branch": "main", "commit": "a8f6952cb1ff7bde864a34c502f1a42c360a6662" }, - "nvim-jdtls": { "branch": "master", "commit": "6bfd1591583b02e742fc3a2f43393c4ea3b6d3c7" }, - "nvim-lspconfig": { "branch": "master", "commit": "df9c116cbcf0aa7e58f2b36b0296fa687e87f36f" }, + "nvim-jdtls": { "branch": "master", "commit": "be5c8d49e0f5c01978aed2314ec47fa8eae759ca" }, + "nvim-lspconfig": { "branch": "master", "commit": "d710f5c58d3b4b010504472d58752d5cef115d99" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" }, - "nvim-treesitter": { "branch": "master", "commit": "874b99065b4b00b84b0ca5fa63490c93728a45ab" }, + "nvim-treesitter": { "branch": "master", "commit": "8453015093ae156f1776d2c913b6c5206e80e26f" }, "nvim-treesitter-context": { "branch": "master", "commit": "2aba92ceb1479485953007f4d5adf34d0b66917e" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1624866a1379fc1861797f0ed05899a9c1d2ff61" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "3eb733685e1aa64a26e8b46220d855fb6a0e9e46" }, + "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "730189c92c6fd80eb92bb6c1886392a142dba273" }, + "nvim-web-devicons": { "branch": "master", "commit": "5be6c4e685618b99c3210a69375b38a1202369b4" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "2820e4c2c6d3dadab1cbdf6dd1e57cac7ed89fb3" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "b29da4a6061a88270e875b38367d82c04c856128" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "a727bd368e70808125b7cf589328cc595faf3d5a" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "sakura.nvim": { "branch": "master", "commit": "2fbf430890dd9466afc41a62a809c21871d126ef" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, - "telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, - "todo-comments.nvim": { "branch": "main", "commit": "96fee098a90e7c09c9811aa7df71d773ba8b9b53" }, + "telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" }, + "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight.nvim": { "branch": "main", "commit": "1471dab694ad88351185758bb4275624d8b798ec" }, - "trouble.nvim": { "branch": "main", "commit": "bf99ea71a39e322336b7f8be965f86dbf5c65540" }, + "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, + "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, - "vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" }, - "vscode.nvim": { "branch": "main", "commit": "3ba16d763097cecc75eb93761f4a981467acfc23" }, - "which-key.nvim": { "branch": "main", "commit": "439d1247cbfed8ee46d6c9a5edbfad6b4c968e06" }, - "zen-mode.nvim": { "branch": "main", "commit": "a31cf7113db34646ca320f8c2df22cf1fbfc6f2a" }, - "zk-nvim": { "branch": "main", "commit": "15e24e96cb90889ebd12b5dbe800a958c716f520" } + "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, + "vscode.nvim": { "branch": "main", "commit": "f6c88cdf9d37d5c0bb1e492a13a3b4b4cc4dd13e" }, + "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, + "zk-nvim": { "branch": "main", "commit": "dbf4eeab55b08856c9d6b6722dbff39630bb35eb" } } From b1bde1352bc5dce5459e984b3fcc1e0a777c4497 Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 24 Jun 2024 19:08:09 -0700 Subject: [PATCH 002/153] chore: update spell dictionary --- spell/en.utf-8.add | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index fac7b89b..473b5e77 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -27,12 +27,14 @@ CmdlineEnter ColorColumn ColorScheme CommitID +CopyPathToClipboard CurrentVersion CursorHold CursorHoldI CursorLine CursorMoved DNSmasq +DarkGray Devicon DiffView DockerHub @@ -42,6 +44,7 @@ EventLog ExecutionPolicy ExitApp ExitPre +ExternalScript FFmpeg FileType FloatBorder @@ -96,10 +99,13 @@ NvimTree OSC OSD OSTYPE +Oem4 +PSReadLine PackerCompile PackerComplete PageDown PageUp +ParameterValue PmenuSel PostgreSQL PowerShell @@ -165,6 +171,7 @@ ZoomWin abc abi abspath +acodec addr adduser adhoc @@ -254,6 +261,7 @@ beancount bezier bg bibtex +bigfile bindkey bindsym bitrate @@ -879,6 +887,7 @@ keyset kickstart kommentary kotlin +kotlinc kubeadm kubectl kubelet @@ -928,6 +937,7 @@ listchars listdir listview lldb +lldebugger llvm ln lnk @@ -967,6 +977,7 @@ lts lua luacheck luacheckrc +luadb luadoc luadocs luafile @@ -1042,6 +1053,7 @@ moonfly motd mountpoint mouseout +mousereleased mov moz mozillateam @@ -1186,6 +1198,7 @@ paren parens parseable parsers +passthrough passwd pathlib pathogen @@ -1526,6 +1539,7 @@ stylelintrc stylesheet stylesheets stylua +subclassed subdir subdirectory submenu @@ -1589,6 +1603,7 @@ textdocument texthl textmate textobjects +textoff textwidth tga tgz @@ -1707,6 +1722,7 @@ v2 vala vbs vbscript +vcodec vcproj vcs vendored From 5c40686a83fc19487d599884c61ea6ada14e2e6c Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 24 Jun 2024 18:40:00 -0700 Subject: [PATCH 003/153] docs: refine comments and LuaDoc annotations in `colors.lua` - Updated header comments to better describe the module purpose. - Ensure consistent comment formatting. - Improve comment annotations: - `is_available`: Add details about `colors_name` parameter. - `get_hl`: Improve `name` parameter description. - `extend_hl`: Clarify `group` and `tbl` parameters. - `set_hl`: Detail `colors` parameter (table/function types). - `set_hl_autocmd`: Describe `name` and `colors` parameters. - `load`: Clarify `name` parameter role in loading colorschemes. --- lua/config/colors.lua | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index ec32cffc..7d41e465 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -1,8 +1,9 @@ --- Load colorscheme from lua module +-- Utility functions for loading and managing neovim colorschemes. +-- Provides color handling, highlight setup, and event-based updates. local M = {} ----Check if colorscheme filename is available in the runtimepath +---Check if colorscheme filename is available in the runtimepath. ---@param colors_name string ---@return boolean M.is_available = function(colors_name) @@ -15,8 +16,8 @@ M.is_available = function(colors_name) return false end ----Get color table from highlight group ----@param name string higroup name +---Get color table from highlight group. +---@param name string higroup name. ---@return table M.get_hl = function(name) local labels = { "bg", "fg", "sp" } @@ -32,7 +33,7 @@ M.get_hl = function(name) return res end ----Extend table for highlight definitions for nvim_set_hl +---Extend table for highlight definitions for `nvim_set_hl`. ---@param group string ---@param tbl table ---@return table @@ -41,20 +42,20 @@ M.extend_hl = function(group, tbl) return vim.tbl_extend("force", colors, tbl) end ----Wrapper for nvim_set_hl that applies higroups from table definitions ----@param colors table|function +---Wrapper for `nvim_set_hl` that applies higroups from table definitions. +---@param colors table|fun(): table M.set_hl = function(colors) if type(colors) == "function" then - colors = colors() ---@type table + colors = colors() end for group, hl in pairs(colors) do vim.api.nvim_set_hl(0, group, hl) end end ----extend set_hl to register an autocmd that will run for the provided colorscheme ----@param name string Name of the colorscheme ----@param colors table Table of highlight definitions +---Wrapper for `set_hl` to register an autocmd that will run on `ColorScheme` event. +---@param name string? Name of the colorscheme for autocmd patten. Use `nil` to match any colorscheme. +---@param colors table Table of highlight definitions. M.set_hl_autocmd = function(name, colors) local groups_name = ("ColorScheme_%s"):format(name) vim.api.nvim_create_autocmd("ColorScheme", { @@ -67,10 +68,10 @@ M.set_hl_autocmd = function(name, colors) }) end ----Get filepath for matching colorscheme name in after/colors directory. ----@param name string Name of the desired colorscheme ----@param rtp string Parent directory to search for runtime files ----@return string|nil Path string to first matching runtime file +---Get filepath for matching colorscheme name in `after/colors` directory. +---@param name string Name of the desired colorscheme. +---@param rtp string Parent directory to search for runtime files. +---@return string? local get_colors_file = function(name, rtp) local files = vim.api.nvim_get_runtime_file(rtp .. "/*", true) for _, path in pairs(files) do @@ -81,8 +82,8 @@ local get_colors_file = function(name, rtp) end end ----Load colorscheme from runtime path: after/colors ----@param name string Name of the desired colorscheme +---Load colorscheme from runtime path: `after/colors` +---@param name string Name of the desired colorscheme. M.load = function(name) local filepath = get_colors_file(name, "after/colors") @@ -97,7 +98,7 @@ M.load = function(name) M.set_hl(theme["colors"] or {}) end - -- Apply global highlights variable for all colorschemes + -- Apply global highlights variable for all colorschemes. if vim.g.colors then M.set_hl(vim.g.colors or {}) end From 60eb28d91ea6356d0ac41e156bb3c0e2539cf115 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 30 Jul 2024 02:06:44 -0700 Subject: [PATCH 004/153] fix: add explicit foldopen settings - Specify foldopen options to control which commands open folds - Disable fold opening for block jumps Allows navigation of folded text without folds unexpectedly opening and jumping into folded regions, which can be disorienting. --- lua/config/options.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/config/options.lua b/lua/config/options.lua index 0cc90dc5..74734fda 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -134,6 +134,21 @@ vim.opt.foldmethod = "expr" -- use treesitter for folding vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldtext = "v:lua.require('config.util').foldtext()" +-- Specifies for which type of commands folds will be opened +vim.opt.foldopen = { + -- "all", -- Any + -- "block", -- (, {, [[, [{, etc. + "hor", -- Horizontal movements: "l", "w", "fx", etc. + "insert", -- Any command in Insert mode + "jump", -- Far jumps: "G", "gg", etc. + "mark", -- Jumping to a mark: "'m", CTRL-O, etc. + "percent", -- Jump to matching item "%" + "quickfix", -- ":cn", ":crew", ":make", etc. + "search", -- Search for a pattern: "/", "n", "*", "gd", etc. + "tag", -- Jumping to a tag: ":ta", CTRL-T, etc. + "undo", -- Undo or redo: "u" and CTRL-R +} + -- Wildmenu options vim.opt.wildmenu = false -- Command-line completion vim.opt.wildignorecase = true -- Case insensitive command-line completion From c2a445c03f21fbd0dd8fed79525b29ccd150bcf8 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:28:08 -0700 Subject: [PATCH 005/153] feat: use empty foldtext to enable fold highlights By removing our custom foldtext function located in `lua/config/util` and setting the option `vim.opt.foldtext` to an empty string, internally neovim will handle highlighting the folded region for us using the already present treesitter highlights. After the revert/removal of the `vim.treesitter.foldtext()` function in neovim core, another option was added to allow similar but limited functionality by setting the foldtext option to that of an empty string, since that value would be otherwise invalid anyway. More work needs to be done to proved a more robust folding system. Many people will utilize plugins like ufo.nvim but I wish to have the most simple implementation until better support is provided by neovim core. --- lua/config/options.lua | 2 +- lua/config/util.lua | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 74734fda..8d3fd94d 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -132,7 +132,7 @@ vim.opt.foldlevel = 99 -- Set nested fold depth level vim.opt.foldlevelstart = 99 -- We want all fold to be expand at start vim.opt.foldmethod = "expr" -- use treesitter for folding vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -vim.opt.foldtext = "v:lua.require('config.util').foldtext()" +vim.opt.foldtext = "" -- Specifies for which type of commands folds will be opened vim.opt.foldopen = { diff --git a/lua/config/util.lua b/lua/config/util.lua index 5e40dd3c..7d72a120 100644 --- a/lua/config/util.lua +++ b/lua/config/util.lua @@ -13,21 +13,4 @@ function M.register_keymaps(options, keymaps) end end ----Define how folded lines should be displayed ----@return string -function M.foldtext() - local foldstart = vim.fn.getline(vim.v.foldstart) - local foldend = vim.fn.getline(vim.v.foldend) - local linecount = vim.v.foldend - vim.v.foldstart + 1 - local tabwidth = string.rep(" ", vim.bo.tabstop) - return string.format( - "%s … %s %s", - ---@cast foldstart string - vim.fn.substitute(foldstart, "\t", tabwidth, "g"), - ---@cast foldend string - vim.fn.trim(foldend), - string.format("[%s lines]", linecount) - ) -end - return M From d2cf9825aaa1b8c50fcac3eabff9085025fe2b22 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:46:24 -0700 Subject: [PATCH 006/153] feat(colors): remove custom fold background in vscode theme The `color_overrides` in the vscode theme previously set the fold background to a custom gray tone. This commit removes the custom color definition, reverting to the default color provided by the plugin. --- lua/plugins/colors/vscode.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/plugins/colors/vscode.lua b/lua/plugins/colors/vscode.lua index f6133dd0..d3588be4 100644 --- a/lua/plugins/colors/vscode.lua +++ b/lua/plugins/colors/vscode.lua @@ -13,9 +13,7 @@ return { transparent = true, italic_comments = false, disable_nvimtree_bg = true, - color_overrides = { - vscFoldBackground = "#242424", - }, + color_overrides = {}, group_overrides = { -- General NormalFloat = { link = "Normal" }, From 150110f2b43aab7f42861742d83aeff9fcdd44a1 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:25:09 -0700 Subject: [PATCH 007/153] feat!: replace nvim-tree with oil.nvim There are a lot of nice features in nvim-tree but over time I find myself using the file tree less and less as I am more accustomed to fuzzy finding. But for the odd cases where I need to navigate/modify the directory structure, oil just seems far more intuitive to work with! --- lazy-lock.json | 1 + lua/plugins/nvim-tree.lua | 75 --------------------------------------- lua/plugins/oil.lua | 65 +++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 75 deletions(-) delete mode 100644 lua/plugins/nvim-tree.lua create mode 100644 lua/plugins/oil.lua diff --git a/lazy-lock.json b/lazy-lock.json index 64145443..024dc4eb 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -53,6 +53,7 @@ "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, "nvim-web-devicons": { "branch": "master", "commit": "5be6c4e685618b99c3210a69375b38a1202369b4" }, + "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "2820e4c2c6d3dadab1cbdf6dd1e57cac7ed89fb3" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua deleted file mode 100644 index f821a0bb..00000000 --- a/lua/plugins/nvim-tree.lua +++ /dev/null @@ -1,75 +0,0 @@ --- nvim-tree | file browser for neovim --- https://github.com/kyazdani42/nvim-tree.lua - ----@type LazyPluginSpec -return { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeOpen", "NvimTreeToggle" }, - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "e", "NvimTreeToggle", desc = "Toggle NvimTree" }, - }, - opts = { - sort_by = "case_sensitive", - sync_root_with_cwd = true, - disable_netrw = true, - hijack_cursor = true, - hijack_netrw = true, - hijack_unnamed_buffer_when_opening = true, - hijack_directories = { - enable = true, - auto_open = true, - }, - diagnostics = { - enable = true, - }, - update_focused_file = { - enable = true, - update_root = true, - ignore_list = {}, - }, - filters = { - dotfiles = false, - custom = { - "^.cache$", -- General cache directory - "^.git$", -- Git repository directory - "__pycache__", -- Python cache directory - "node_modules", -- Node module directory - }, - }, - view = { - width = 40, - side = "right", - }, - renderer = { - group_empty = true, - highlight_git = true, - highlight_opened_files = "icon", - indent_markers = { - enable = true, - }, - icons = { - git_placement = "after", - }, - }, - }, - config = function(_, opts) - -- initialize plugin - require("nvim-tree").setup(opts) - - -- HACK: Close nvimtree window when leaving vim, - -- Prevents Compatibility issues with auto-session - -- https://github.com/nvim-tree/nvim-tree.lua/issues/1992 - vim.api.nvim_create_autocmd("FileType", { - pattern = { "NvimTree" }, - callback = function(args) - vim.api.nvim_create_autocmd("VimLeavePre", { - callback = function() - vim.api.nvim_buf_delete(args.buf, { force = true }) - return true - end, - }) - end, - }) - end, -} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 00000000..41b40dcf --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,65 @@ +-- oil.nvim | Edit your filesystem like a buffer +-- https://github.com/stevearc/oil.nvim +---@module "oil" + +---@type LazyPluginSpec +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = { "Oil" }, + keys = { + { "e", "Oil --float .", desc = "Open file explorer" }, + }, + init = function() + -- Set custom vim style explorer commands + local create_command = vim.api.nvim_create_user_command + create_command("Explore", "Oil ", { nargs = "?", complete = "dir" }) + create_command("Sexplore", "belowright split | Oil ", { nargs = "?", complete = "dir" }) + create_command("Vexplore", "rightbelow vsplit | Oil ", { nargs = "?", complete = "dir" }) + create_command("Texplore", "tabedit % | Oil ", { nargs = "?", complete = "dir" }) + end, + opts = { + default_file_exporer = true, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Window-local options to use for oil buffers + win_options = { + number = false, + relativenumber = false, + concealcursor = "nvic", + colorcolumn = "0", + conceallevel = 3, + cursorcolumn = false, + foldcolumn = "0", + }, + view_options = { + show_hidden = true, + }, + -- Configuration for the floating window in oil.open_float + float = { + max_width = 114, + max_height = 32, + border = vim.g.border, + }, + -- Configuration for the actions floating preview window + preview = { + border = vim.g.border, + width = 0.5, + }, + -- Configuration for the floating progress window + progress = { + border = vim.g.border, + }, + -- Configuration for the floating SSH window + ssh = { + border = vim.g.border, + }, + -- Configuration for the floating keymaps help window + keymaps_help = { + border = vim.g.border, + }, + }, +} From 80bec3436d1064005dcb50ac6dd7eb0d1dd55510 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:31:18 -0700 Subject: [PATCH 008/153] fix(session): exclude 'oil' buffer from session save Updated the list of file types to bypass session saving by adding 'oil'. Previously, only 'dashboard' was excluded from session save. --- lua/plugins/session.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/session.lua b/lua/plugins/session.lua index 8fc9b07e..cb9db861 100644 --- a/lua/plugins/session.lua +++ b/lua/plugins/session.lua @@ -27,7 +27,7 @@ return { auto_restore_enabled = true, auto_save_enabled = true, auto_session_suppress_dirs = { "/", "~/", "~/Documents", "~/Downloads", "~/Projects" }, - bypass_session_save_file_types = { "dashboard" }, + bypass_session_save_file_types = { "dashboard", "oil" }, session_lens = { load_on_setup = false }, }, } From f01613faf2ee1e6fc861c5d8aea6e0a1ba55f7b7 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:52:36 -0700 Subject: [PATCH 009/153] fix(lualine): add 'oil' to windows list Add 'oil' to the list of recognized windows in lualine configuration. This ensures the Oil buffer is properly displayed. --- lua/plugins/lualine.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 1df80b29..dad5f195 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -152,6 +152,7 @@ local windows = { fugitive = "Fugitive", lazy = "Lazy", mason = "Mason", + oil = "Oil", tsplayground = "TSPlayground", }, } From 68f37852eda7844fdaf42164662591b13339f82c Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 8 Sep 2024 11:03:15 -0700 Subject: [PATCH 010/153] refactor(colors): update `set_hl_autocmd` for universal highlights - `set_hl_autocmd` now supports all colorschemes if `name` is `nil` or "*". - Added cache to manage highlight definitions across multiple colorschemes. - Refine luadoc comments to clarify the optional name parameter usage. --- lua/config/colors.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index 7d41e465..a6e8afc9 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -53,17 +53,18 @@ M.set_hl = function(colors) end end ----Wrapper for `set_hl` to register an autocmd that will run on `ColorScheme` event. ----@param name string? Name of the colorscheme for autocmd patten. Use `nil` to match any colorscheme. ----@param colors table Table of highlight definitions. +---Registers an autocmd to set highlights on `ColorScheme` event. +---@param name string? Name of the colorscheme for the autocmd pattern; use `"*"` or `nil` to match all colorschemes. +---@param colors table Table of highlight definitions (e.g., { Normal = { fg = "#ffffff", bg = "#000000" } }). M.set_hl_autocmd = function(name, colors) - local groups_name = ("ColorScheme_%s"):format(name) - vim.api.nvim_create_autocmd("ColorScheme", { - desc = ("Override highlights for theme: %s"):format(name), - group = vim.api.nvim_create_augroup(groups_name, { clear = true }), - pattern = name, + local pattern = name or "*" + M._hl_cache = vim.tbl_deep_extend("force", M._hl_cache or {}, { [pattern] = colors }) + vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { + desc = ("Apply highlight overrides for colorscheme: %s"):format(pattern), + group = vim.api.nvim_create_augroup(("ColorScheme#%s"):format(pattern), { clear = true }), + pattern = pattern, callback = function() - M.set_hl(colors) + M.set_hl(M._hl_cache[pattern]) end, }) end From 9b46dc4c859bc5fe502854bf3fb840b689fbd66d Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 12 May 2024 20:51:16 -0700 Subject: [PATCH 011/153] feat: add scrollbar plugin: satellite.nvim --- lazy-lock.json | 1 + lua/plugins/satellite.lua | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 lua/plugins/satellite.lua diff --git a/lazy-lock.json b/lazy-lock.json index 024dc4eb..f40350ab 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -61,6 +61,7 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "a727bd368e70808125b7cf589328cc595faf3d5a" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "sakura.nvim": { "branch": "master", "commit": "2fbf430890dd9466afc41a62a809c21871d126ef" }, + "satellite.nvim": { "branch": "main", "commit": "777ed56e1ef45ec808df701730b6597fc4fb0fbc" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, "telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" }, "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, diff --git a/lua/plugins/satellite.lua b/lua/plugins/satellite.lua new file mode 100644 index 00000000..116a46ef --- /dev/null +++ b/lua/plugins/satellite.lua @@ -0,0 +1,10 @@ +-- satellite.nvim | Decorate scrollbar for Neovim +-- https://github.com/lewis6991/satellite.nvim +---@module "satellite" + +---@type LazyPluginSpec +return { + "lewis6991/satellite.nvim", + event = { "BufReadPost", "BufNewFile" }, + config = true, +} From d0a94b539d3e95f757d8476cbffebb341eccb981 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 8 Sep 2024 11:05:18 -0700 Subject: [PATCH 012/153] fix(satellite): add default highlight for SatelliteBar - Added autocmd to apply highlights for satellite.nvim on ColorScheme change. - Added default highlight for SatelliteBar with links to 'Pmenu'. - Disable 'winblend' to prevent black background due to a known Neovim core bug. --- lua/plugins/satellite.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/plugins/satellite.lua b/lua/plugins/satellite.lua index 116a46ef..25386967 100644 --- a/lua/plugins/satellite.lua +++ b/lua/plugins/satellite.lua @@ -6,5 +6,16 @@ return { "lewis6991/satellite.nvim", event = { "BufReadPost", "BufNewFile" }, - config = true, + init = function() + -- Apply highlight group values for plugin on ColorScheme change. + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + SatelliteBar = { link = "Pmenu", default = true }, + }) + end, + opts = { + -- FIX: Disable winblend to prevent black background + -- https://github.com/neovim/neovim/issues/18576 + winblend = 0, + }, } From 21ba8eae456ff9923157ad8b57b2b92dc88eefdc Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:13:33 -0700 Subject: [PATCH 013/153] docs(toggleterm): update and standardize luadoc comments - Added `@module` annotation for `toggleterm`. - Reformatted comments for `size`, `on_open`, and `on_close` callbacks. - Added type hints to `terminals` table. - Enhanced overall documentation consistency and clarity. --- lua/plugins/toggleterm.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 584da222..5f38bfdf 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -1,9 +1,11 @@ -- toggleterm.nvim | easily manage multiple terminal windows -- https://github.com/akinsho/toggleterm.nvim +---@module "toggleterm" +---@type Terminal[] local terminals = {} --- Callback to determine the size of terminal windows +---Callback to determine the size of terminal windows. ---@param term Terminal ---@return integer|nil local function size(term) @@ -14,14 +16,14 @@ local function size(term) end end --- Callback to be executed when terminal is opened +---Callback to be executed when terminal is opened. ---@param term Terminal local function on_open(term) local opts = { buffer = term.bufnr, silent = true } vim.keymap.set({ "n", "t" }, "", "", opts) end --- Callback to be executed when terminal is closed +---Callback to be executed when terminal is closed. local function on_close() local wins = vim.api.nvim_list_wins() if wins == 1 then @@ -29,7 +31,7 @@ local function on_close() end end --- Generate custom terminals from user opts +---Generate custom terminals from user opts. ---@param opts table local initialize_terminals = function(opts) local Terminal = require("toggleterm.terminal").Terminal From be1a7e7b81e2c6ba52f57cdac26e7ff1a5428381 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 25 Jul 2024 02:56:17 -0700 Subject: [PATCH 014/153] revert(toggleterm): restore leader prefix for keymaps Partially revert the previous commit to add the leader prefix back to the toggleterm keymaps. Using the leader prefix improves consistency and prevents accidental triggering when yanking text. --- lua/plugins/toggleterm.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 5f38bfdf..be50b4c5 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -58,10 +58,10 @@ return { event = "VeryLazy", keys = { { "" }, - { "tf", "ToggleTerm direction=float", desc = "Terminal (float)" }, - { "ts", "ToggleTerm direction=horizontal", desc = "Terminal (split)" }, - { "tt", "ToggleTerm direction=tab", desc = "Terminal (tab)" }, - { "tv", "ToggleTerm direction=vertical", desc = "Terminal (vsplit)" }, + { "tf", "ToggleTerm direction=float", desc = "Terminal (float)" }, + { "ts", "ToggleTerm direction=horizontal", desc = "Terminal (split)" }, + { "tt", "ToggleTerm direction=tab", desc = "Terminal (tab)" }, + { "tv", "ToggleTerm direction=vertical", desc = "Terminal (vsplit)" }, }, config = function(_, opts) require("toggleterm").setup(opts) From 72b05ba85dfd6ef3f59494ebd2b712b344056f46 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:36:51 -0700 Subject: [PATCH 015/153] fix(flatten): disable lazy-loading to restore functionality The "willothy/flatten.nvim" plugin was non-functional with lazy-loading enabled. Disabling lazy-loading, as recommended in the plugin documentation, prevents nested instances when opening files from terminal buffers with `nvim path/to/file`. This change ensures the plugin works as intended. --- lua/plugins/flatten.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/plugins/flatten.lua b/lua/plugins/flatten.lua index 68df4361..1df18618 100644 --- a/lua/plugins/flatten.lua +++ b/lua/plugins/flatten.lua @@ -4,7 +4,10 @@ ---@type LazyPluginSpec return { "willothy/flatten.nvim", - event = { "TermOpen" }, + -- Disable lazy-loading to ensure that it runs first. + -- This should minimize delay when opening file from terminal + lazy = false, + priority = 1001, opts = { window = { open = "alternate" }, }, From c71c687ac5c58ec2d5f194878146fb28a36eef73 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:44:04 -0700 Subject: [PATCH 016/153] fix(lualine): correct color for terminal mode in vscode theme The `b` section of the lualine vscode theme used the default foreground color instead of the mode color for terminal buffers. This commit fixes the issue by changing the foreground color to the correct terminal mode color. --- lua/lualine/themes/vscode.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lualine/themes/vscode.lua b/lua/lualine/themes/vscode.lua index ecae1fbd..c07cfcb1 100644 --- a/lua/lualine/themes/vscode.lua +++ b/lua/lualine/themes/vscode.lua @@ -54,7 +54,7 @@ vscode.insert = { vscode.terminal = { a = { fg = vim.o.background == "dark" and colors.bg or colors.fg, bg = colors.green, gui = "bold" }, - b = { fg = colors.fg, bg = colors.bg2 }, + b = { fg = colors.green, bg = colors.bg2 }, c = { fg = colors.fg, bg = config.opts.transparent and "NONE" or colors.bg }, } From 5cebf9ede7c2aed8a00de4d61af8fd6d6cabb3c2 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:54:29 -0700 Subject: [PATCH 017/153] fix(lualine): correct function return type in docstring Update return type annotation in `insert_string` function to use `fun(): string` for better type accuracy. --- lua/plugins/lualine.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index dad5f195..641b29fd 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -3,7 +3,7 @@ ---Wrapper function for printing string as lualine component ---@param str string ----@return function +---@return fun(): string local function insert_string(str) return function() return str From e6c74c3a8a05518b7faf3bd2a91a7aca85855b54 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:02:46 -0700 Subject: [PATCH 018/153] chore(trouble): update trouble.nvim config to v3 - Removed deprecated and unused settings. - Added default keymaps to the lazy plugin spec. - Added comments for plugin dependencies. - Included `@module` for proper type definitions with `lazydev/lua-ls`. - Disabled auto-focus; now requires manual selection or Enter key. - Disabled status column in trouble buffers. - Ensured user-defined window border is applied correctly. - Moved buffer autocmd to the lazy spec initialization function. --- lua/plugins/trouble.lua | 52 +++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 447039c1..05e3ae37 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -1,32 +1,38 @@ -- trouble.nvim | pretty diagnostics, references, telescope results -- https://github.com/folke/trouble.nvim +---@module "trouble" ---@type LazyPluginSpec return { "folke/trouble.nvim", - cmd = { "TroubleToggle", "Trouble" }, - dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = { "Trouble" }, + dependencies = { + -- Lua fork of vim-web-devicons for neovim + { "nvim-tree/nvim-web-devicons" }, + }, + -- stylua: ignore + keys = { + { "cl", "Trouble lsp toggle focus=false win.position=right", desc = "LSP (Trouble)" }, + { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, + { "xl", "Trouble loclist toggle", desc = "Location List (Trouble)" }, + { "xq", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, + }, + ---@type trouble.Config opts = { - padding = false, -- add an extra new line on top of the list - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = true, -- automatically close the list when you have no diagnostics - use_diagnostic_signs = true, -- enabling this will use the signs defined in your lsp client + auto_close = false, -- Auto close when there are no items + focus = true, -- Focus the window when opened + follow = false, -- Follow the current item + win = { + border = vim.g.border, + wo = { + number = false, + relativenumber = false, + colorcolumn = "0", + cursorline = true, + cursorlineopt = "both", + }, + }, }, - config = function(_, opts) - require("trouble").setup(opts) - - --- Autocmds --- - - vim.api.nvim_create_augroup("TroubleBuffer", {}) - vim.api.nvim_create_autocmd("FileType", { - desc = "Apply local options to Trouble buffer", - group = "TroubleBuffer", - pattern = "Trouble", - callback = function() - vim.opt_local.cursorline = true - vim.opt_local.cursorlineopt = "both" - vim.opt_local.colorcolumn = "0" - end, - }) - end, } From 4d1c53ee06a84f648b9cf5e873570ab501bb29cc Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:35:52 -0700 Subject: [PATCH 019/153] refactor(todo): add commands to lazy plugin spec Add commands to lazy plugin spec for todo-comments: - "TodoLocList", "TodoQuickFix", "TodoTelescope", "TodoTrouble" - Ensures plugin loads on command execution, handling edge cases like opening todo-comments buffers from the dashboard. --- lua/plugins/todo-comments.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index 7b533f20..d8b11e8d 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -4,8 +4,13 @@ ---@type LazyPluginSpec return { "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, event = { "BufReadPost", "BufNewFile" }, + cmd = { + "TodoLocList", + "TodoQuickFix", + "TodoTelescope", + "TodoTrouble", + }, dependencies = { -- Collection of useful lua functions { "nvim-lua/plenary.nvim" }, From 9ba456e790415d563a459a63dd392419bfa036ad Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 01:51:06 -0700 Subject: [PATCH 020/153] refactor(telescope): update key mappings - Added common alternatives to close the prompt with "qq" and "jk". - Disabled "" to prevent accidental actions. - Enabled "" to clear the search prompt. - Updated "" and "" for simple navigation instead of multi-select. - Added extra keybindings for preview navigation: - "", "", "", "" - "", "", "" --- lua/plugins/telescope.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index b7af3fd6..67af0046 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -87,13 +87,29 @@ return { -- Custom mappings for telescope prompt mappings = { i = { + -- Add common alternative to close prompt ["qq"] = actions.close, ["jk"] = actions.close, + + -- Disable key mappings to prevent accidental actions + [""] = nil, + + -- Allow ctrl-u to clear search prompt + [""] = false, + + -- Replace Tab multi-select with simple navigation. + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + + -- Set extra keybindings for preview navigation + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + [""] = actions.preview_scrolling_left, + [""] = actions.preview_scrolling_right, + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + [""] = actions.preview_scrolling_up, [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_up, - [""] = "which_key", - [""] = "preview_scrolling_up", - [""] = "preview_scrolling_down", -- Scroll results by half/page [""] = function(prompt_bufnr) From 6a4a835a6ac0fc9a2ec49b5bd1f29690d468e3f2 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 23 Jul 2024 20:18:45 -0700 Subject: [PATCH 021/153] fix(telescope): set selection_strategy to reset Change selection_strategy from 'row' to 'reset'. This allows users to change their query without needing to find the current selection, as 'reset' places the selection cursor at the top of the results. --- lua/plugins/telescope.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 67af0046..01673bf6 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -51,7 +51,7 @@ return { preview_title = "", results_title = false, scroll_strategy = "cycle", - selection_strategy = "row", + selection_strategy = "reset", sorting_strategy = "ascending", file_sorter = sorters.get_fuzzy_file, From 5c377b3ba07cf07a59c9c373922e7aaba7054745 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 23 Jul 2024 20:23:30 -0700 Subject: [PATCH 022/153] refactor(telescope): remove redundant previewer/sorter config Remove configuration for previewers and sorters. These settings match the plugin's default config, making them redundant. --- lua/plugins/telescope.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 01673bf6..23888b3e 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -38,8 +38,6 @@ return { opts = function() local action_set = require("telescope.actions.set") local actions = require("telescope.actions") - local previewers = require("telescope.previewers") - local sorters = require("telescope.sorters") local state = require("telescope.state") local themes = require("telescope.themes") return { @@ -54,11 +52,6 @@ return { selection_strategy = "reset", sorting_strategy = "ascending", - file_sorter = sorters.get_fuzzy_file, - file_previewer = previewers.vim_buffer_cat.new, - grep_previewer = previewers.vim_buffer_vimgrep.new, - qflist_previewer = previewers.vim_buffer_qflist.new, - vimgrep_arguments = { "rg", "--no-heading", From 3db5a13b629beb6dbbd4c5de8f584a704145a3f2 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 20 Jul 2024 00:50:23 -0700 Subject: [PATCH 023/153] feat(wk): add diagnostic label to keymap `x` This commit adds a diagnostic label to the keymap `x` in the which-key plugin, following the recommended keymaps from `folke/trouble.nvim`. No builtin keymaps utilize the `x` pattern, so the group is named "Diagnostics". This label helps organize and identify keymaps with similar signatures. --- lua/plugins/which-key.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 9625d8bd..9f17988d 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -38,6 +38,7 @@ return { { "p", group = "Plugins" }, { "s", group = "Sessions" }, { "t", group = "Terminal" }, + { "x", group = "Diagnostics" }, { "z", group = "Notes" }, }) end, From 8d17289eaddc03074cad997539ad0dbef8122861 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 03:34:56 -0700 Subject: [PATCH 024/153] refactor: disable builtin plugin "matchit" Disable "matchit" plugin in lazy.nvim config to improve startup time. --- lua/config/lazy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index a42b40d8..bc02a0dd 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -34,7 +34,7 @@ require("lazy").setup({ paths = { vim.fn.stdpath("data") .. "/site" }, disabled_plugins = { "gzip", - -- "matchit", + "matchit", -- "matchparen", "netrwPlugin", "rplugin", From 0846bee6340a25a30301c981be6bef69817c8cc1 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 06:47:47 -0700 Subject: [PATCH 025/153] feat(todo): support scoped TODO comments Add support for TODO comments with optional scopes, typically used to associate an author with the comment. Example: `-- TODO(username): my todo description`. --- lua/plugins/todo-comments.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index d8b11e8d..973c06b7 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -37,7 +37,7 @@ return { highlight = { keyword = "fg", -- "fg", "bg", "wide" or empty. after = "", -- "fg" or "bg" or empty - pattern = [[(KEYWORDS)\s*(\([^\)]*\))?:]], + pattern = ".*<((KEYWORDS)%(\\(.{-1,}\\))?):", comments_only = true, -- uses treesitter to match keywords in comments only -- list of file types to exclude highlighting exclude = { "help", "log" }, From 30d90bf47e01a700722fdd124ce41b308d52271a Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 06:53:41 -0700 Subject: [PATCH 026/153] refactor(lsp): replace ruff_lsp with ruff server Recent versions of Ruff include a built-in LSP implementation via the `ruff server` command. This replaces the previously used `ruff_lsp` project, which was a separate wrapper for Ruff with an LSP interface. - Replaced ruff_lsp with ruff in mason ensure_installed - Added server settings for ruff - Added autocmd to disable ruff hover capabilities This allows pyright to provide hover capabilities but perhaps we could make this dependent on if pyright is available/configured or attached to the buffer? The latter possibly depending on lsp load order. --- lua/plugins/lsp/settings/ruff.lua | 26 ++++++++++++++++++++++++++ lua/plugins/mason.lua | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/lsp/settings/ruff.lua diff --git a/lua/plugins/lsp/settings/ruff.lua b/lua/plugins/lsp/settings/ruff.lua new file mode 100644 index 00000000..873af64f --- /dev/null +++ b/lua/plugins/lsp/settings/ruff.lua @@ -0,0 +1,26 @@ +-- ruff: Ruff Language-server configuration +-- https://github.com/astral-sh/ruff +---@module "lspconfig" + +vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP: Disable hover capability from Ruff", + group = vim.api.nvim_create_augroup("LspAttach#Ruff#DisableHover", {}), + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client ~= nil and client["name"] == "ruff" then + client.server_capabilities.hoverProvider = false + end + end, +}) + +---@type lspconfig.Config +return { + init_options = { + settings = { + lineLength = 100, + quote_style = "double", + indent_style = "space", + docstring_code_format = true, + }, + }, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index ccece672..6c0306a8 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -35,7 +35,7 @@ return { "jsonls", "lua_ls", "pyright", - "ruff_lsp", + "ruff", "taplo", "yamlls", }, From df6eb24905b7147e9e1175fbe438d6952ca622e9 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 06:59:27 -0700 Subject: [PATCH 027/153] feat(luasnip): extend markup and plain text to include lorem snippets Extend `html`, `markdown`, and `plain` filetypes to include the `loremipsum` snippet group. This allows for lorem sentences and paragraphs from the friendly-snippets plugin to be available as snippets in these filetypes. --- lua/plugins/luasnip.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua index b4288039..1caa71bd 100644 --- a/lua/plugins/luasnip.lua +++ b/lua/plugins/luasnip.lua @@ -38,6 +38,9 @@ return { ls.filetype_extend("glsl", { "c" }) ls.filetype_extend("javascript", { "javascriptreact" }) ls.filetype_extend("typescript", { "typescriptreact" }) + ls.filetype_extend("html", { "loremipsum" }) + ls.filetype_extend("markdown", { "loremipsum" }) + ls.filetype_extend("plain", { "loremipsum" }) -- Load primary LSP snippets from friendly-snippets require("luasnip.loaders.from_vscode").lazy_load() From 3b71e7216813802aec6242fa0cdd28720fb52206 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 15:50:47 -0700 Subject: [PATCH 028/153] fix(autocmds): exclude nofile buffers from checktime updates The `checktime` command should not run on buffers with the `nofile` type. This update ensures `checktime` is only executed on applicable buffers when focus changes or terminal events occur. - Use a callback function to conditionally execute `checktime`. --- lua/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index d2f66084..484e955a 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -19,7 +19,11 @@ autocmd({ "FocusLost" }, { autocmd({ "FocusGained", "TermClose", "TermLeave" }, { desc = "Check if any buffers were changed outside of Vim on focus changed", group = augroup("UpdateBuffers", {}), - command = "checktime", + callback = function() + if vim.o.buftype ~= "nofile" then + vim.cmd.checktime() + end + end, }) autocmd({ "VimResized" }, { From c1dd1f096c7521429b1d06e3aaba8a3a2e75745c Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 2 Aug 2024 16:02:47 -0700 Subject: [PATCH 029/153] fix(autocmds): restore current tab after resizing windows Ensure the currently active tab is restored when resizing windows on the VimResized event. The `tabdo` command cycles through all tabs and runs the provided command, but it does not return to the original tab afterwards. - Save the current tab before running `tabdo` - Restore the saved tab after resizing splits Thanks to the folke/LazyVim project on GitHub for the original code. --- lua/config/autocmds.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 484e955a..c94d29f5 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -27,10 +27,12 @@ autocmd({ "FocusGained", "TermClose", "TermLeave" }, { }) autocmd({ "VimResized" }, { - desc = "Resize splits if vim window is resized", + desc = "Resize splits when vim window is resized", group = augroup("ResizeSplits", {}), callback = function() + local current_tab = vim.fn.tabpagenr() vim.cmd("tabdo wincmd =") + vim.cmd.tabnext(current_tab) end, }) From 41dfbaef452f3dc6abbe8139839de56c55014ed2 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 00:52:04 -0700 Subject: [PATCH 030/153] fix(db): correct prerelease handling for stable/nightly The `vim.version().prerelease` value was not set for stable releases. By checking against a nil value instead of an expected string, the version release table will now correctly classify the release as stable or nightly. --- lua/plugins/dashboard.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index f1c367b6..05e171e8 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -101,7 +101,7 @@ return { config = function(_, opts) -- Add version information as sub header local v = vim.version() - local release = v.prerelease == false and "stable" or "nightly" + local release = v.prerelease == nil and "stable" or "nightly" local template = "--- [ %s.%s.%s %s ] ---" vim.list_extend( opts.config.header, From 0fef37d7d2c44e78e9d35d744f28396d50af6078 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 00:56:30 -0700 Subject: [PATCH 031/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index f40350ab..0ab64292 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "7552e6504ee95a9c8cfc6db53e389122ded46cd4" }, - "auto-session": { "branch": "main", "commit": "5dd96000324d5f7448dec096281b6caf64d79913" }, + "LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" }, + "auto-session": { "branch": "main", "commit": "96c06300c2b13d1c67dcf1c6c969b372c5543b7d" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -15,63 +15,63 @@ "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "0ed466953fe5885166e0d60799172a8b1f752d16" }, + "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, - "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "hop.nvim": { "branch": "master", "commit": "8f51ef02700bb3cdcce94e92eff16170a6343c4f" }, + "indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4ba55f9755ebe8297d92c419b90a946123292ae6" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, - "nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" }, + "nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "dcc85d12d6e2c18c5fa0f9a304d9f5e767e1401a" }, - "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, + "nvim-dap": { "branch": "master", "commit": "20a4859ebde1c9bc8e96f8cc11a20667e7fdd516" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, - "nvim-highlight-colors": { "branch": "main", "commit": "a8f6952cb1ff7bde864a34c502f1a42c360a6662" }, - "nvim-jdtls": { "branch": "master", "commit": "be5c8d49e0f5c01978aed2314ec47fa8eae759ca" }, - "nvim-lspconfig": { "branch": "master", "commit": "d710f5c58d3b4b010504472d58752d5cef115d99" }, + "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, + "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, + "nvim-lspconfig": { "branch": "master", "commit": "037ea0901ce9a28cfcaa36302618f06d2e164fbf" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "8453015093ae156f1776d2c913b6c5206e80e26f" }, - "nvim-treesitter-context": { "branch": "master", "commit": "2aba92ceb1479485953007f4d5adf34d0b66917e" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "3eb733685e1aa64a26e8b46220d855fb6a0e9e46" }, - "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, - "nvim-web-devicons": { "branch": "master", "commit": "5be6c4e685618b99c3210a69375b38a1202369b4" }, - "oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "2820e4c2c6d3dadab1cbdf6dd1e57cac7ed89fb3" }, + "nvim-treesitter": { "branch": "master", "commit": "00f128dd73086aa578dc3d9142de06c633b7c685" }, + "nvim-treesitter-context": { "branch": "master", "commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, + "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, + "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "0f0d5bc67786c36edc2cb6fb5faa5c09dd1a6e10" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "a727bd368e70808125b7cf589328cc595faf3d5a" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "c097f728a409d9923a3c70c1507e8389978a9b85" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "sakura.nvim": { "branch": "master", "commit": "2fbf430890dd9466afc41a62a809c21871d126ef" }, "satellite.nvim": { "branch": "main", "commit": "777ed56e1ef45ec808df701730b6597fc4fb0fbc" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, - "telescope.nvim": { "branch": "master", "commit": "3b1600d0fd5172ad9fae00987362ca0ef3d8895d" }, + "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, - "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, - "vscode.nvim": { "branch": "main", "commit": "f6c88cdf9d37d5c0bb1e492a13a3b4b4cc4dd13e" }, + "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, + "vscode.nvim": { "branch": "main", "commit": "7de58b7a6d55fe48475d0ba2fddbcec871717761" }, "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, "zk-nvim": { "branch": "main", "commit": "dbf4eeab55b08856c9d6b6722dbff39630bb35eb" } From 7fb79837e6eaeb3464e67ccb50a20bb14899e878 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 02:29:52 -0700 Subject: [PATCH 032/153] chore: update spell dictionary --- spell/en.utf-8.add | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 473b5e77..38a00d2a 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -87,6 +87,7 @@ MinimumRes MouseMove Myriadth NERDTree +NES NOPASSWD NoLogo NoProfile @@ -101,6 +102,7 @@ OSD OSTYPE Oem4 PSReadLine +PYTHONPATH PackerCompile PackerComplete PageDown @@ -162,6 +164,7 @@ WinEnter WinEvent WinLeave WinNew +WinSeparator WinTitle WinZoom WriteLine @@ -175,6 +178,7 @@ acodec addr adduser adhoc +aegisub afile agnoster ahk @@ -231,6 +235,7 @@ autorun autosave autosquash autostart +autosuggest autosuggestions autotag autowidth @@ -280,6 +285,7 @@ bp bpytop branchless breakindent +broadcasthost bs btop buf @@ -439,6 +445,7 @@ damnit dap dapui darcs +darkblue darkgreen dataframe datamoshes @@ -526,6 +533,7 @@ dropdown ds_store dstask duckdns +dups easymotion echo editorconfig @@ -586,6 +594,7 @@ extmark eza f1 fallbacks +famicom favour fd fdfind @@ -630,6 +639,7 @@ foldexpr foldlevel foldlevelstart foldmethod +foldnestmax foldopen foldsep foldstart @@ -664,6 +674,7 @@ func fzf fzfterm fzy +gameboy gamesave gamesaves gc @@ -699,6 +710,7 @@ gitmodules gitrebase gitsigns glazewm +globdots globpath glsl gnu @@ -823,6 +835,7 @@ io ios iostream ip +ipaddr ipairs ipsum ipv4 @@ -885,6 +898,7 @@ keypressed keypresses keyset kickstart +koehler kommentary kotlin kotlinc @@ -990,6 +1004,8 @@ luarc luarocks luasnip luaver +lunaperche +lunaperche/! luvit macchiato macchina @@ -1018,6 +1034,7 @@ md5 mdx mechatronics mem +mempak menuone menuselect mergetool @@ -1070,6 +1087,7 @@ mswin mtime multiband multispace +murphy mux muxed mypy @@ -1185,6 +1203,7 @@ osx outdir owo p7zip +pablo packadd packercompile packercomplete @@ -1374,6 +1393,7 @@ resolv restruct ret retab +retrobox retval reusability rf @@ -1414,6 +1434,7 @@ scaleability scanf schemastore scm +scp screenrc screensaver scrollback @@ -1444,6 +1465,7 @@ sfx sha sha1 sha256 +shada shader shaders shellcheck @@ -1584,6 +1606,8 @@ tabwidth tada taplo taskbar +taskwarrior +taskwarrior/! tautulli taz tbl @@ -1681,6 +1705,7 @@ undercurl undolevel undotree unescape +unescaped unicode unindent unittest @@ -1799,6 +1824,7 @@ wifi wikilink wikipedia wildcard +wildcharm wildignore wildmenu win @@ -1841,8 +1867,10 @@ xclock xconfig xdg xdg_dirs +xdigit xdotool xev +xfce xhost xinit xinitrc @@ -1869,9 +1897,11 @@ yamlls ylast yml youtube +zaibatsu zcompdump zdotdir zellij +zellner zenmode zettelkasten zfs From 07b5f876e1c3892ddb9e56bb8e551be125d7248f Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 07:52:25 -0700 Subject: [PATCH 033/153] feat: add user command to redirect output to a new buffer Added the `Redir` user command, which redirects the output of a given command to a new buffer. For example, `Redir lua = require("vim.lsp")` creates a modifiable, searchable buffer with the command's output. This is useful when the `messages` command falls short due to its lack of searchability and limited accessibility for larger outputs. --- lua/config/commands.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lua/config/commands.lua b/lua/config/commands.lua index 442bf9d2..7e493cd3 100644 --- a/lua/config/commands.lua +++ b/lua/config/commands.lua @@ -57,3 +57,20 @@ end, { return modules end, }) + +---Redirect the output of a command to a new buffer +---@param ctx table +local redirect_output = function(ctx) + local exec = vim.api.nvim_exec2(ctx.args, { output = true }) + local lines = vim.split(exec.output, "\n", { plain = true }) + vim.cmd.new() + vim.api.nvim_buf_set_lines(0, 0, -1, false, lines) + vim.opt_local.spell = false + vim.opt_local.modified = false +end + +-- Register commands: Redir +vim.api.nvim_create_user_command("Redir", redirect_output, { + complete = "command", + nargs = "+", +}) From e9ee916e92da239aa8e05e5362d36e26b1cfb21f Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 16 Aug 2024 08:36:54 -0700 Subject: [PATCH 034/153] feat(commands): enhance reload command with path handling Improved the `Reload` command to support module reloading by path string, added completion, and included confirmation output. Removed `pcall` to ensure proper error reporting during module reloads. --- lua/config/commands.lua | 53 +++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/lua/config/commands.lua b/lua/config/commands.lua index 7e493cd3..9756e179 100644 --- a/lua/config/commands.lua +++ b/lua/config/commands.lua @@ -33,29 +33,46 @@ vim.cmd.cnoreabbrev({ "xA", "xa" }) -- Delete buffer without closing window vim.cmd.cnoreabbrev({ "bdd", "bn|bd#" }) --- Plenary reload module -vim.api.nvim_create_user_command("R", function(ev) - local name = ev.args - if name == "" then - name = vim.fn.expand("%:."):gsub("%.lua", "") - end - local plenary_ok, _ = pcall(require, "plenary") - if plenary_ok then +---Load or reload a Lua module in the current Neovim session +---@param name string Path to the Lua file +---@return any +local reload_module = function(name) + if package.loaded["plenary"] then require("plenary.reload").reload_module(name, true) else package.loaded[name] = nil end - local _, module = pcall(require, name) - return module -end, { + return require(name) +end + +---Handle the reload command by parsing the module name +---@param ctx table Context containing the command arguments +local function reload_command_handler(ctx) + local name = ctx.args + if name == "" then + name = vim.fn.expand("%:.") + name = name:gsub("%.lua", "") + name = name:gsub("lua[/|\\]", "") + end + print(("Reloading module: %s"):format(name)) + reload_module(name) +end + +---Provide completion options for the reload command +---@return table +local reload_command_completion = function() + local modules = {} + for key, _ in pairs(package.loaded) do + table.insert(modules, key) + end + return modules +end + +-- Register commands: Reload +vim.cmd.cnoreabbrev({ "R", "Reload" }) +vim.api.nvim_create_user_command("Reload", reload_command_handler, { + complete = reload_command_completion, nargs = "?", - complete = function() - local modules = {} - for key, _ in pairs(package.loaded) do - table.insert(modules, key) - end - return modules - end, }) ---Redirect the output of a command to a new buffer From 1afcd443ff2db5ff3fadb476e1fc0c7b1a8d1dcf Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 06:38:07 -0700 Subject: [PATCH 035/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 0ab64292..6223a55d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "b84eeb3641b08324287587b426ec974b888390d9" }, - "auto-session": { "branch": "main", "commit": "96c06300c2b13d1c67dcf1c6c969b372c5543b7d" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "auto-session": { "branch": "main", "commit": "0caedb838e3cace2eaf52696ec7c8b6000f9ee30" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -13,66 +13,66 @@ "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, - "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, - "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, + "hex.nvim": { "branch": "master", "commit": "d0f553dcd2c08d226026d769119b2eb6b09b8dfd" }, "hop.nvim": { "branch": "master", "commit": "8f51ef02700bb3cdcce94e92eff16170a6343c4f" }, - "indent-blankline.nvim": { "branch": "master", "commit": "dddb5d21811c319eb6e51a993d8fb44b193aae3f" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, - "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f2acd4a21db1ca0a12559e7a9f7cdace3bdbfb09" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, + "neogit": { "branch": "master", "commit": "9959b58a897036ce89d47385021db1f716613399" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "ebb09961f1c0a377f9ed1685740cdf87b5cd39a8" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, - "nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" }, + "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, + "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "20a4859ebde1c9bc8e96f8cc11a20667e7fdd516" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" }, "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, - "nvim-lspconfig": { "branch": "master", "commit": "037ea0901ce9a28cfcaa36302618f06d2e164fbf" }, + "nvim-lspconfig": { "branch": "master", "commit": "efbfce341c9f546ca2a155a9316886fc1b80eace" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "00f128dd73086aa578dc3d9142de06c633b7c685" }, - "nvim-treesitter-context": { "branch": "master", "commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73" }, + "nvim-treesitter": { "branch": "master", "commit": "621f5901f0b3e762cc4c5ed0f9246cf1495193ad" }, + "nvim-treesitter-context": { "branch": "master", "commit": "3d5390c49e3f8fe457b376df2a49aa39d75b7911" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, - "nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" }, - "oil.nvim": { "branch": "master", "commit": "1fe476daf0b3c108cb8ee1fc1226cc282fa2c9c1" }, + "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, + "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "0f0d5bc67786c36edc2cb6fb5faa5c09dd1a6e10" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "c097f728a409d9923a3c70c1507e8389978a9b85" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "5f73b24aeb94f5274c218955573153c69ce4d1ee" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "sakura.nvim": { "branch": "master", "commit": "2fbf430890dd9466afc41a62a809c21871d126ef" }, - "satellite.nvim": { "branch": "main", "commit": "777ed56e1ef45ec808df701730b6597fc4fb0fbc" }, + "satellite.nvim": { "branch": "main", "commit": "dfc2b220f4969ebc49b0f2a94ab6faae240705bd" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, - "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, + "telescope.nvim": { "branch": "master", "commit": "b324469959908c1c7434eb65d80e87895e6828f7" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight.nvim": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, + "tokyonight.nvim": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vscode.nvim": { "branch": "main", "commit": "7de58b7a6d55fe48475d0ba2fddbcec871717761" }, - "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" }, + "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, - "zk-nvim": { "branch": "main", "commit": "dbf4eeab55b08856c9d6b6722dbff39630bb35eb" } + "zk-nvim": { "branch": "main", "commit": "8942fcc7ba2477e3e0d8097c806eec41cd844fd1" } } From d6e080403d5ced1b0c21f9b06ce977d96a35418d Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 07:01:06 -0700 Subject: [PATCH 036/153] fix(keymaps): use `` instead of `:` prefix to avoid mode flash Replaced the `:` prefix with `` in keymaps to prevent lualine from flashing the command mode highlight. Using `` provides the same result without causing a mode switch. Note: Visual line movement keymaps remain unchanged due to issues with handling multiple lines. The `:` prefix, despite causing lualine to flash, is necessary for maintaining correct behavior. This issue arises because removing `:` prevents Vim from exiting visual mode before using marks like `'<` and `'>`, which only affects fresh buffers or sessions. Further research is needed to resolve this issue, so the lualine flash bug will persist for these specific keymaps for the time being. --- lua/config/keymaps.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 17afc5b9..70cbc9e1 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -22,7 +22,7 @@ util.register_keymaps(defaults, { { "i", "", ":u" }, -- Remove highlight after search with ESCAPE - { "n", "", ":nohlsearch" }, + { "n", "", "nohlsearch" }, -- Jumplist center cursor { "n", "", "zz" }, @@ -45,8 +45,8 @@ util.register_keymaps(defaults, { { "v", "", ">gv" }, -- Navigate buffer - { "n", "[b", ":bprevious", { desc = "Previous buffer" } }, - { "n", "]b", ":bnext", { desc = "Next buffer" } }, + { "n", "[b", "bprevious", { desc = "Previous buffer" } }, + { "n", "]b", "bnext", { desc = "Next buffer" } }, -- Delete active buffer in window { "n", "d", "bn|bd#" }, From 50c796ba309378770bef53e45f8311bbe502f753 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 08:36:59 -0700 Subject: [PATCH 037/153] refactor(markdown): move zk-nvim config from LSP to markdown module Relocated zk-nvim plugin configuration from the LSP module to the Markdown module. This adjustment better organizes the configuration related to note management and Markdown file handling. --- lua/plugins/lsp/init.lua | 6 ------ lua/plugins/lsp/settings/zk.lua | 22 ---------------------- lua/plugins/markdown.lua | 19 ++++++++++++++++++- 3 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 lua/plugins/lsp/settings/zk.lua diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index e5e37285..f5ede9a5 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -16,8 +16,6 @@ return { { "mfussenegger/nvim-jdtls" }, -- Tools for better development in rust { "simrat39/rust-tools.nvim" }, - -- Neovim extension for zk - { "mickael-menu/zk-nvim" }, }, init = function() -- Initialize diagnostic settings @@ -73,10 +71,6 @@ return { ["jdtls"] = function() require("plugins/lsp/settings/jdtls") end, - - ["zk"] = function() - require("plugins/lsp/settings/zk") - end, }) end, }, diff --git a/lua/plugins/lsp/settings/zk.lua b/lua/plugins/lsp/settings/zk.lua deleted file mode 100644 index e3f825e7..00000000 --- a/lua/plugins/lsp/settings/zk.lua +++ /dev/null @@ -1,22 +0,0 @@ --- zk-nvim | Neovim extension for zk --- https://github.com/mickael-menu/zk-nvim -local zk_ok, zk = pcall(require, "zk") -if not zk_ok then - return -end - -zk.setup({ - -- can be "telescope", "fzf" or "select" (`vim.ui.select`) - -- it's recommended to use "telescope" or "fzf" - picker = "telescope", -}) - ---- Keymaps --- - -local util = require("config.util") -util.register_keymaps({ remap = false, silent = true }, { - { "n", "zn", "ZkNew { title = vim.fn.input('Title: ') }", { desc = "new note" } }, - { "n", "zb", "ZkBacklinks", { desc = "show backlinks" } }, - { "n", "zl", "ZkLinks", { desc = "show links" } }, - { "n", "zf", "ZkNotes", { desc = "show notes" } }, -}) diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index 45dc184f..eb4b76d7 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -1,4 +1,5 @@ --- lua/plugins/markdown.lua +-- Configures plugins for Markdown files and note management. +-- Includes tools for editing/previewing and exploring Markdown files. ---@type LazyPluginSpec[] return { @@ -21,4 +22,20 @@ return { } end, }, + { -- Neovim extension for zk + "zk-org/zk-nvim", + main = "zk", + event = "VeryLazy", + keys = { + { "zb", "ZkBacklinks", desc = "Show backlinks" }, + { "zf", "ZkNotes", desc = "Show notes" }, + { "zl", "ZkLinks", desc = "Show links" }, + { "zn", "ZkNew { title = vim.fn.input('Title: ') }", desc = "New note" }, + }, + opts = { + -- Can be "telescope", "fzf" or "select" (`vim.ui.select`) + -- It's recommended to use "telescope" or "fzf" + picker = "telescope", + }, + }, } From d1afb2e0531b9a9f9c5d6e729934b2d2b3f6ad55 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 08:55:21 -0700 Subject: [PATCH 038/153] refactor(mason): move LSP and DAP handlers to mason module - Moved LSP and DAP handlers to mason module. - Removed event from mason-nvim-dap to allow auto-install on startup. - Removed `runtime!` loading for dap/adapters modules. --- lua/plugins/dap/init.lua | 3 +-- lua/plugins/lsp/init.lua | 34 ---------------------------------- lua/plugins/mason.lua | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 36 deletions(-) diff --git a/lua/plugins/dap/init.lua b/lua/plugins/dap/init.lua index 4f295db6..e3684c93 100644 --- a/lua/plugins/dap/init.lua +++ b/lua/plugins/dap/init.lua @@ -61,8 +61,7 @@ return { vim.fn.sign_define(name, { text = text, texthl = texthl, linehl = sign[3], numhl = sign[3] }) end - -- Load adapters/config from settings directory - vim.cmd("runtime! lua/plugins/dap/adapters/*.lua") + -- Load launch settings from local directory require("dap.ext.vscode").load_launchjs() end, }, diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index f5ede9a5..63f287fd 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -32,46 +32,12 @@ return { end end, config = function() - -- Define default variables - local server_mpath = "plugins/lsp/settings" - local default_options = { - capabilities = require("plugins.lsp.capabilities"), - on_attach = require("plugins.lsp.attach"), - } - -- Override lspconfig default window options local windows = require("lspconfig.ui.windows") windows.default_options = { border = vim.g.border } -- Initialize local lsp modules require("plugins.lsp.handlers") - require("mason-lspconfig").setup_handlers({ - -- The first entry (without a key) will be the default handler - -- and will be called for each installed server that doesn't have - -- a dedicated handler. - ---@param server_name string - function(server_name) - local config -- Set default empty config table - local namespace = table.concat({ server_mpath, server_name }, "/") - local module_ok, module = pcall(require, namespace) - if module_ok and type(module) == "table" then - -- Set config to module return table if present - config = type(module.setup) == "function" and module.setup({}) or module - end - -- Extend default_options with module return table - config = vim.tbl_deep_extend("force", default_options, config or {}) - -- Initialize server with evaluated or empty config table - require("lspconfig")[server_name].setup(config) - end, - - ["rust_analyzer"] = function() - require("plugins/lsp/settings/rust_analyzer") - end, - - ["jdtls"] = function() - require("plugins/lsp/settings/jdtls") - end, - }) end, }, { -- Use Neovim as a language server diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 6c0306a8..8214d787 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -39,6 +39,33 @@ return { "taplo", "yamlls", }, + handlers = { + -- The first entry (without a key) will be the default handler + -- and will be called for each installed server that doesn't have + -- a dedicated handler. + ---@param server_name string + function(server_name) + -- Define default variables + local server_mpath = "plugins/lsp/settings" + local default_options = { + capabilities = require("plugins.lsp.capabilities"), + on_attach = require("plugins.lsp.attach"), + } + local namespace = table.concat({ server_mpath, server_name }, "/") + local _, module = pcall(require, namespace) + module = type(module) == "table" and module or {} + local config = vim.tbl_deep_extend("force", default_options, module or {}) + require("lspconfig")[server_name].setup(config) + end, + + ["rust_analyzer"] = function() + require("plugins/lsp/settings/rust_analyzer") + end, + + ["jdtls"] = function() + require("plugins/lsp/settings/jdtls") + end, + }, }, }, { @@ -66,6 +93,16 @@ return { automatic_installation = false, automatic_setup = true, ensure_installed = {}, + handlers = { + function(config) + local adapters_path = "plugins/dap/adapters" + local namespace = table.concat({ adapters_path, config.name }, "/") + local _, module = pcall(require, namespace) + module = type(module) == "table" and module or {} + config = vim.tbl_deep_extend("force", config, module or {}) + require("mason-nvim-dap").default_setup(config) + end, + }, }, }, } From 9d6a8b6d4a92da778752cf894a23d0ab3e91d3bf Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 20:18:49 -0700 Subject: [PATCH 039/153] refactor(dap): rename adapter modules to match adapter names - Renamed dap adapter modules to match the specific adapter names. - Split and adjusted module names where necessary. --- .../dap/adapters/{bash.lua => bashdb.lua} | 0 .../dap/adapters/{dotnet.lua => coreclr.lua} | 95 ++++++++----------- .../dap/adapters/{go.lua => delve.lua} | 8 +- .../dap/adapters/{lua.lua => local_lua.lua} | 0 .../dap/adapters/{perl.lua => perlsp.lua} | 0 .../dap/adapters/{node.lua => pwa_node.lua} | 0 lua/plugins/dap/adapters/unity.lua | 13 +++ 7 files changed, 58 insertions(+), 58 deletions(-) rename lua/plugins/dap/adapters/{bash.lua => bashdb.lua} (100%) rename lua/plugins/dap/adapters/{dotnet.lua => coreclr.lua} (63%) rename lua/plugins/dap/adapters/{go.lua => delve.lua} (87%) rename lua/plugins/dap/adapters/{lua.lua => local_lua.lua} (100%) rename lua/plugins/dap/adapters/{perl.lua => perlsp.lua} (100%) rename lua/plugins/dap/adapters/{node.lua => pwa_node.lua} (100%) create mode 100644 lua/plugins/dap/adapters/unity.lua diff --git a/lua/plugins/dap/adapters/bash.lua b/lua/plugins/dap/adapters/bashdb.lua similarity index 100% rename from lua/plugins/dap/adapters/bash.lua rename to lua/plugins/dap/adapters/bashdb.lua diff --git a/lua/plugins/dap/adapters/dotnet.lua b/lua/plugins/dap/adapters/coreclr.lua similarity index 63% rename from lua/plugins/dap/adapters/dotnet.lua rename to lua/plugins/dap/adapters/coreclr.lua index 7d26369a..e8890412 100644 --- a/lua/plugins/dap/adapters/dotnet.lua +++ b/lua/plugins/dap/adapters/coreclr.lua @@ -6,12 +6,6 @@ dap.adapters.coreclr = { args = { "--interpreter=vscode" }, } -dap.adapters.unity = { - type = "executable", - command = "/Commands/mono", - args = { "/unity.unity-debug-x.x.x/bin/UnityDebug.exe" }, -} - local dotnet_build_project = function() local default_path = vim.fn.getcwd() .. "/" if vim.g["dotnet_last_proj_path"] ~= nil then @@ -50,32 +44,6 @@ local dotnet_get_dll_path = function() return vim.g["dotnet_last_dll_path"] end -local config = {} - -table.insert(config, { - type = "coreclr", - request = "launch", - name = "Launch project (netcoredbg)", - console = "integratedTerminal", - program = function() - if vim.fn.confirm("Attempt to rebuild project?", "&yes\n&no", 2) == 1 then - dotnet_build_project() - end - return dotnet_get_dll_path() - end, -}) - -table.insert(config, { - type = "coreclr", - request = "launch", - name = "Launch DLL (netcoredbg)", - program = function() - local dir = vim.fn.expand("%:p:h") - local path = ("%s/bin/Debug/"):format(dir) - return vim.fn.input("Path to DLL: ", path, "file") - end, -}) - local telescope_picker = function() return coroutine.create(function(coro) local action_state = require("telescope.actions.state") @@ -101,29 +69,46 @@ local telescope_picker = function() end) end -table.insert(config, { - type = "coreclr", - request = "launch", - name = "Select DLL (telescope)", - program = telescope_picker, -}) - -table.insert(config, { - type = "coreclr", - request = "attach", - name = "Attach to PID (netcoredbg)", - processId = function() - local pid = require("dap.utils").pick_process() - vim.fn.setenv("NETCOREDBG_ATTACH_PID", pid) - return pid - end, -}) - -table.insert(config, { - name = "Launch unity editor", - type = "unity", - request = "attach", -}) +local config = { + { + type = "coreclr", + request = "launch", + name = "Launch project (netcoredbg)", + console = "integratedTerminal", + program = function() + if vim.fn.confirm("Attempt to rebuild project?", "&yes\n&no", 2) == 1 then + dotnet_build_project() + end + return dotnet_get_dll_path() + end, + }, + { + type = "coreclr", + request = "launch", + name = "Launch DLL (netcoredbg)", + program = function() + local dir = vim.fn.expand("%:p:h") + local path = ("%s/bin/Debug/"):format(dir) + return vim.fn.input("Path to DLL: ", path, "file") + end, + }, + { + type = "coreclr", + request = "launch", + name = "Select DLL (telescope)", + program = telescope_picker, + }, + { + type = "coreclr", + request = "attach", + name = "Attach to PID (netcoredbg)", + processId = function() + local pid = require("dap.utils").pick_process() + vim.fn.setenv("NETCOREDBG_ATTACH_PID", pid) + return pid + end, + }, +} dap.configurations.cs = config dap.configurations.fsharp = config diff --git a/lua/plugins/dap/adapters/go.lua b/lua/plugins/dap/adapters/delve.lua similarity index 87% rename from lua/plugins/dap/adapters/go.lua rename to lua/plugins/dap/adapters/delve.lua index d572ebea..63e35393 100644 --- a/lua/plugins/dap/adapters/go.lua +++ b/lua/plugins/dap/adapters/delve.lua @@ -1,6 +1,9 @@ +-- delve | DAP configuration for go +-- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#go local dap = require("dap") +local utils = require("dap.utils") -dap.adapters.go = { +dap.adapters.delve = { type = "server", port = "${port}", executable = { @@ -31,7 +34,6 @@ local function get_arguments() end end --- -- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md dap.configurations.go = { { type = "go", @@ -60,7 +62,7 @@ dap.configurations.go = { name = "Attach", mode = "local", request = "attach", - processId = require("dap.utils").pick_process, + processId = utils.pick_process, }, { type = "go", diff --git a/lua/plugins/dap/adapters/lua.lua b/lua/plugins/dap/adapters/local_lua.lua similarity index 100% rename from lua/plugins/dap/adapters/lua.lua rename to lua/plugins/dap/adapters/local_lua.lua diff --git a/lua/plugins/dap/adapters/perl.lua b/lua/plugins/dap/adapters/perlsp.lua similarity index 100% rename from lua/plugins/dap/adapters/perl.lua rename to lua/plugins/dap/adapters/perlsp.lua diff --git a/lua/plugins/dap/adapters/node.lua b/lua/plugins/dap/adapters/pwa_node.lua similarity index 100% rename from lua/plugins/dap/adapters/node.lua rename to lua/plugins/dap/adapters/pwa_node.lua diff --git a/lua/plugins/dap/adapters/unity.lua b/lua/plugins/dap/adapters/unity.lua new file mode 100644 index 00000000..fd183b64 --- /dev/null +++ b/lua/plugins/dap/adapters/unity.lua @@ -0,0 +1,13 @@ +local dap = require("dap") + +dap.adapters.unity = { + type = "executable", + command = "/Commands/mono", + args = { "/unity.unity-debug-x.x.x/bin/UnityDebug.exe" }, +} + +vim.tbl_extend("force", dap.configurations.cs, { + name = "Launch unity editor", + type = "unity", + request = "attach", +}) From 3a3b230a3f4a0b0e124bfa2eb22547fc24ba84d9 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 5 Sep 2024 20:20:24 -0700 Subject: [PATCH 040/153] refactor(lsp): revert settings module name to `lsp.servers` Reverts the previous rename of `lsp.servers` to `lsp.settings`. This change restores the original module name `lsp.servers` to align with how the DAP module names its settings as "adapters," providing more explicit naming and better organization. Note: This is the third time the naming has been reviewed. --- lua/plugins/lsp/{settings => servers}/bashls.lua | 0 lua/plugins/lsp/{settings => servers}/clangd.lua | 0 lua/plugins/lsp/{settings => servers}/html.lua | 0 lua/plugins/lsp/{settings => servers}/jdtls.lua | 0 lua/plugins/lsp/{settings => servers}/lua_ls.lua | 0 lua/plugins/lsp/{settings => servers}/powershell_es.lua | 0 lua/plugins/lsp/{settings => servers}/pyright.lua | 0 lua/plugins/lsp/{settings => servers}/ruff.lua | 0 lua/plugins/lsp/{settings => servers}/rust_analyzer.lua | 0 lua/plugins/lsp/{settings => servers}/taplo.lua | 0 lua/plugins/mason.lua | 2 +- 11 files changed, 1 insertion(+), 1 deletion(-) rename lua/plugins/lsp/{settings => servers}/bashls.lua (100%) rename lua/plugins/lsp/{settings => servers}/clangd.lua (100%) rename lua/plugins/lsp/{settings => servers}/html.lua (100%) rename lua/plugins/lsp/{settings => servers}/jdtls.lua (100%) rename lua/plugins/lsp/{settings => servers}/lua_ls.lua (100%) rename lua/plugins/lsp/{settings => servers}/powershell_es.lua (100%) rename lua/plugins/lsp/{settings => servers}/pyright.lua (100%) rename lua/plugins/lsp/{settings => servers}/ruff.lua (100%) rename lua/plugins/lsp/{settings => servers}/rust_analyzer.lua (100%) rename lua/plugins/lsp/{settings => servers}/taplo.lua (100%) diff --git a/lua/plugins/lsp/settings/bashls.lua b/lua/plugins/lsp/servers/bashls.lua similarity index 100% rename from lua/plugins/lsp/settings/bashls.lua rename to lua/plugins/lsp/servers/bashls.lua diff --git a/lua/plugins/lsp/settings/clangd.lua b/lua/plugins/lsp/servers/clangd.lua similarity index 100% rename from lua/plugins/lsp/settings/clangd.lua rename to lua/plugins/lsp/servers/clangd.lua diff --git a/lua/plugins/lsp/settings/html.lua b/lua/plugins/lsp/servers/html.lua similarity index 100% rename from lua/plugins/lsp/settings/html.lua rename to lua/plugins/lsp/servers/html.lua diff --git a/lua/plugins/lsp/settings/jdtls.lua b/lua/plugins/lsp/servers/jdtls.lua similarity index 100% rename from lua/plugins/lsp/settings/jdtls.lua rename to lua/plugins/lsp/servers/jdtls.lua diff --git a/lua/plugins/lsp/settings/lua_ls.lua b/lua/plugins/lsp/servers/lua_ls.lua similarity index 100% rename from lua/plugins/lsp/settings/lua_ls.lua rename to lua/plugins/lsp/servers/lua_ls.lua diff --git a/lua/plugins/lsp/settings/powershell_es.lua b/lua/plugins/lsp/servers/powershell_es.lua similarity index 100% rename from lua/plugins/lsp/settings/powershell_es.lua rename to lua/plugins/lsp/servers/powershell_es.lua diff --git a/lua/plugins/lsp/settings/pyright.lua b/lua/plugins/lsp/servers/pyright.lua similarity index 100% rename from lua/plugins/lsp/settings/pyright.lua rename to lua/plugins/lsp/servers/pyright.lua diff --git a/lua/plugins/lsp/settings/ruff.lua b/lua/plugins/lsp/servers/ruff.lua similarity index 100% rename from lua/plugins/lsp/settings/ruff.lua rename to lua/plugins/lsp/servers/ruff.lua diff --git a/lua/plugins/lsp/settings/rust_analyzer.lua b/lua/plugins/lsp/servers/rust_analyzer.lua similarity index 100% rename from lua/plugins/lsp/settings/rust_analyzer.lua rename to lua/plugins/lsp/servers/rust_analyzer.lua diff --git a/lua/plugins/lsp/settings/taplo.lua b/lua/plugins/lsp/servers/taplo.lua similarity index 100% rename from lua/plugins/lsp/settings/taplo.lua rename to lua/plugins/lsp/servers/taplo.lua diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 8214d787..62939acd 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -46,7 +46,7 @@ return { ---@param server_name string function(server_name) -- Define default variables - local server_mpath = "plugins/lsp/settings" + local server_mpath = "plugins/lsp/servers" local default_options = { capabilities = require("plugins.lsp.capabilities"), on_attach = require("plugins.lsp.attach"), From 73e3908d48e638441f2fe93b932cb38aec715cf4 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Sep 2024 06:20:11 -0700 Subject: [PATCH 041/153] build(make): set XDG_STATE_HOME for isolated state files Temporary instances were sharing sessions and history with the base Neovim config because XDG_STATE_HOME was unset. Setting it avoids errors with shared shada files, especially with upcoming changes that use shada for persistent variables, such as retaining the last set colorscheme across restarts. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4d1a9e9c..fbd037dc 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,9 @@ endif @export MYVIMRC="${ROOT_DIR}/init.lua" && \ export XDG_CACHE_HOME="${TEMP_DIR}/.cache" && \ export XDG_CONFIG_HOME="${TEMP_DIR}/.config" && \ - export XDG_LOCAL_HOME="${TEMP_DIR}/.local" && \ export XDG_DATA_HOME="${TEMP_DIR}/.local/share" && \ + export XDG_LOCAL_HOME="${TEMP_DIR}/.local" && \ + export XDG_STATE_HOME="${TEMP_DIR}/.local/state" && \ nvim # Launch nvim with patched xdg_dirs format: ## Run formatter: stylua From 8872ccc2ffe4ed3fb97ab65f257c626cc4468f43 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Sep 2024 07:17:36 -0700 Subject: [PATCH 042/153] fix(gitsigns): set sign priority based on signcolumn width sets an initial sign priority depending on the signcolumn value. this avoids conflicts with diagnostics and todo-comments and ensures consistent alignment of gitsigns diff status. note that neovim requires a restart for changes to take effect. --- lua/plugins/gitsigns.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 8a8d5e0e..caf6dbcc 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,12 +1,25 @@ -- gitsigns.nvim | Git integration for buffers -- https://github.com/lewis6991/gitsigns.nvim +---Sets a high sign priority if the signcolumn width is greater than 2. +---@return number? +local priority = function() + local number = tonumber(vim.o.signcolumn:match("^[^:]+:(%d+)$")) + if number and number >= 2 then + return 1000 + end +end + ---@type LazyPluginSpec return { "lewis6991/gitsigns.nvim", event = { "BufReadPost", "BufNewFile" }, dependencies = { "nvim-lua/plenary.nvim" }, opts = { + sign_priority = priority(), + signs_staged_enable = false, + current_line_blame = true, + current_line_blame_formatter = " , - ", signs = { add = { text = "▎" }, change = { text = "▎" }, @@ -23,9 +36,6 @@ return { changedelete = { text = "▎" }, untracked = { text = "▎" }, }, - signs_staged_enable = false, - current_line_blame = true, - current_line_blame_formatter = " , - ", on_attach = function(bufnr) local gitsigns = require("gitsigns") local function map(mode, l, r, opts) From 7e887e8e02315ca2dfe4ddda4c0f34fe2d3ccd50 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 8 Sep 2024 11:42:24 -0700 Subject: [PATCH 043/153] perf(lazy): refactor LSP initialization to improve startup - Moved diagnostic settings and file watcher override from `init` to `config` function. This avoids running `init` during plugin parsing, improving startup speed by applying configurations only when `lspconfig` is fully loaded. - Wrapped file watcher override in version check. The override is now applied only for Neovim versions < 0.10.0. This prevents excessive CPU usage with certain LSP servers while allowing newer Neovim versions to use the default file watcher implementation. --- lua/plugins/lsp/init.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index 63f287fd..a519f29b 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -17,27 +17,26 @@ return { -- Tools for better development in rust { "simrat39/rust-tools.nvim" }, }, - init = function() - -- Initialize diagnostic settings - require("plugins.lsp.diagnostics") - - -- Prevent high cpu usage due to new watch files implementation. - -- NOTE: https://github.com/neovim/neovim/issues/23725#issuecomment-1561364086 - local ok, wf = pcall(require, "vim.lsp._watchfiles") - if ok then - -- disable lsp watcher. Too slow on linux - wf._watchfunc = function() - return function() end - end - end - end, config = function() -- Override lspconfig default window options local windows = require("lspconfig.ui.windows") windows.default_options = { border = vim.g.border } -- Initialize local lsp modules + require("plugins.lsp.diagnostics") require("plugins.lsp.handlers") + + -- Prevent high cpu usage due to new watch files implementation. + -- NOTE: https://github.com/neovim/neovim/issues/23725#issuecomment-1561364086 + if vim.fn.has("nvim-0.10") == 0 then + local ok, wf = pcall(require, "vim.lsp._watchfiles") + if ok then + -- disable lsp watcher. Too slow on linux + wf._watchfunc = function() + return function() end + end + end + end end, }, { -- Use Neovim as a language server From a42475656f27f805e46a4104b5764f6ad3b308b6 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 10:29:00 -0700 Subject: [PATCH 044/153] fix(telescope): disable previewer and on_complete for colorscheme picker Disable telescope.nvim previewer and on_complete callback functions for the colorscheme picker. This prevents the issue where the completion does not properly handle restoring the `vim.b.background` properly, resulting in the final selection having an incorrect background value. --- lua/plugins/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 23888b3e..8ad9d741 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -149,7 +149,11 @@ return { lsp_document_symbols = { path_display = { "hidden" } }, lsp_references = { path_display = { "shorten" } }, lsp_workspace_symbols = { path_display = { "shorten" } }, - colorscheme = { previewer = false, layout_config = { height = 12 } }, + colorscheme = { + previewer = false, + on_complete = false, + layout_config = { height = 12 }, + }, find_files = { hidden = true }, buffers = { sort_mru = true, From 592a0a3746dccf1d3235bf9248e26d63b27b4f11 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 07:07:08 -0700 Subject: [PATCH 045/153] fix(toggleterm): set terminal highlight for NormalFloat Added a highlight link for `NormalFloat` to ensure that floating terminals in toggleterm.nvim are styled consistently with the rest of the UI. This ensures proper theming for floating terminals. --- lua/plugins/toggleterm.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index be50b4c5..702fa77a 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -76,6 +76,7 @@ return { on_close = on_close, highlights = { Normal = { link = "Normal" }, + NormalFloat = { link = "NormalFloat" }, FloatBorder = { link = "FloatBorder" }, }, -- Commands will be generate to open apps as floating terminals From 4ec8ab770f05233b78a6c8bee0d2dc95b35c3afe Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 3 Aug 2024 13:48:38 -0700 Subject: [PATCH 046/153] feat(colors): make colorscheme persistent Added a mechanism to remember and reload the last used colorscheme on Neovim startup. This change ensures the selected colorscheme persists across sessions by storing the colorscheme name in a global variable. The autocmd for 'VimEnter' now loads the last used colorscheme, while the 'ColorScheme' autocmd updates this variable whenever a new colorscheme is applied. fix(colors): wrap colorscheme loader in pcall to prevent errors docs(colors): improve wording in autocmd desc for colorscheme loader --- lua/config/colors.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index a6e8afc9..abf18508 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -3,7 +3,9 @@ local M = {} ----Check if colorscheme filename is available in the runtimepath. +vim.g.COLORSCHEME = "default" + +---Check if colorscheme filename is available in the runtimepath ---@param colors_name string ---@return boolean M.is_available = function(colors_name) @@ -109,11 +111,21 @@ end local group = vim.api.nvim_create_augroup("ColorSchemeFix", {}) -vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { - desc = "Automatically load/reload colorscheme changes", +vim.api.nvim_create_autocmd({ "VimEnter" }, { + desc = "Start neovim with the previously loaded colorscheme", + group = group, + nested = true, + callback = function() + pcall(vim.cmd.colorscheme, vim.g.COLORSCHEME) + end, +}) + +vim.api.nvim_create_autocmd({ "ColorScheme" }, { + desc = "Save the current colorscheme as a global", group = group, callback = function(ev) - M.load(vim.g.colors_name and ev.match or "default") + vim.g.COLORSCHEME = vim.g.colors_name or ev.match + M.load(vim.g.COLORSCHEME) end, }) From b21f9ba280d53d05e3cae657bb82703ce305d222 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 5 Dec 2023 04:10:56 -0800 Subject: [PATCH 047/153] fix(colors): improve hl overrides for new default colorscheme Neovim core recently improved the default colorscheme with a set of custom color values, which are much easier on the eyes than vim's default colorscheme. - NOTE: This patch will result in errors in earlier versions of neovim. The new Nvim prefixed color values eg. `NvimLightGray1` are not defined in earlier versions, which will cause an invalid color error. - Add cterm values to allow custom highlights in limited terminals. - Patch colorscheme plugins that don't have the WinSeparator highlight group defined, resulting in the default colors being used for the line between splits/windows. --- after/colors/default.lua | 79 ++++++++++++++++++++++++++-------------- after/colors/vim.lua | 34 +++++++++++++++++ 2 files changed, 85 insertions(+), 28 deletions(-) create mode 100644 after/colors/vim.lua diff --git a/after/colors/default.lua b/after/colors/default.lua index 1313c2ca..6b28deeb 100644 --- a/after/colors/default.lua +++ b/after/colors/default.lua @@ -1,34 +1,57 @@ local M = {} M.colors = { - Normal = { bg = "none", fg = "Grey93" }, - ColorColumn = { bg = "Gray10" }, - CursorLineNr = { fg = "Gold", underline = false }, - CursorLine = { bg = "Gray15" }, - LineNr = { fg = "Gray30" }, - NonText = { fg = "Gray15" }, - SignColumn = { bg = "none" }, - VertSplit = { fg = "Gray27" }, - FloatBorder = { fg = "Gray" }, - Visual = { bg = "Gray20" }, - - DiffAdd = { link = "Type" }, - DiffChange = { link = "Statement" }, - DiffDelete = { fg = "Red", bg = "none" }, - - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, - - -- Indent Blankline - IndentBlanklineChar = { link = "LineNr" }, - - -- Whichkey - WhichKey = { link = "Define" }, - -- WhichKeyFloat = { bg = "none" }, + ColorColumn = { bg = "NvimDarkBlue" }, + Constant = { fg = "NvimLightRed" }, + CursorLineNr = { ctermfg = 222, fg = "NvimLightYellow" }, + FloatBorder = { link = "WinSeparator" }, + NonText = { ctermfg = 239, fg = "Gray15" }, + Normal = { ctermfg = 253, bg = "none", fg = "NvimLightGrey2" }, + PmenuSel = { bg = "NvimDarkGrey3" }, + Statement = { fg = "NvimLightMagenta" }, + StatusLine = { bg = "none" }, + Type = { fg = "NvimLightCyan" }, + WinSeparator = { ctermfg = 236, fg = "NvimDarkGrey3" }, + + -- Git + GitSignsAdd = { ctermfg = 157, fg = "NvimLightGreen", bold = true }, + GitSignsChange = { ctermfg = 222, fg = "NvimLightYellow", bold = true }, + GitSignsDelete = { ctermfg = 217, fg = "NvimLightRed", bold = true }, + + -- LSP + ["@lsp.mod.defaultLibrary.lua"] = { link = "@namespace" }, + + -- Treesitter + ["@variable"] = { link = "Identifier" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { fg = "NvimLightBlue", nocombine = true }, + RainbowDelimiterCyan = { fg = "NvimLightCyan", nocombine = true }, + RainbowDelimiterGreen = { fg = "NvimLightGreen", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 221, fg = "LightGoldenrod2", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 210, fg = "LightCoral", nocombine = true }, + RainbowDelimiterRed = { fg = "NvimLightRed", nocombine = true }, + RainbowDelimiterViolet = { fg = "NvimLightMagenta", nocombine = true }, + RainbowDelimiterYellow = { fg = "NvimLightYellow", nocombine = true }, + + -- Dashboard + DashboardHeader = { link = "Special" }, + DashboardDesc = { link = "String" }, + DashboardFooter = { link = "Comment" }, + DashboardIcon = { link = "String" }, + DashboardShortCut = { link = "Keyword" }, } +-- Neovim 0.10+ introduces a new default colorscheme. +-- In older versions, `default` refers to the old scheme, now renamed `vim` in newer versions. +-- Support older versions by loading the appropriate color definitions. +if vim.fn.has("nvim-0.10") == 0 then + M.colors = require("after.colors.vim") +end + +-- Don't modify Normal if background is set to light mode. +if vim.o.background == "light" then + M.colors["Normal"] = nil +end + return M diff --git a/after/colors/vim.lua b/after/colors/vim.lua new file mode 100644 index 00000000..1313c2ca --- /dev/null +++ b/after/colors/vim.lua @@ -0,0 +1,34 @@ +local M = {} + +M.colors = { + Normal = { bg = "none", fg = "Grey93" }, + ColorColumn = { bg = "Gray10" }, + CursorLineNr = { fg = "Gold", underline = false }, + CursorLine = { bg = "Gray15" }, + LineNr = { fg = "Gray30" }, + NonText = { fg = "Gray15" }, + SignColumn = { bg = "none" }, + VertSplit = { fg = "Gray27" }, + FloatBorder = { fg = "Gray" }, + Visual = { bg = "Gray20" }, + + DiffAdd = { link = "Type" }, + DiffChange = { link = "Statement" }, + DiffDelete = { fg = "Red", bg = "none" }, + + -- Telescope + TelescopeNormal = { link = "Normal" }, + TelescopePreviewBorder = { fg = "Gray" }, + TelescopePromptBorder = { fg = "Gray" }, + TelescopeResultsBorder = { fg = "Gray" }, + TelescopeSelection = { bg = "Gray23" }, + + -- Indent Blankline + IndentBlanklineChar = { link = "LineNr" }, + + -- Whichkey + WhichKey = { link = "Define" }, + -- WhichKeyFloat = { bg = "none" }, +} + +return M From 04d0c027fc1ce249f8f4643a0bfb65ccf8b1e12e Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 08:00:55 -0700 Subject: [PATCH 048/153] feat(colors): improve highlights for builtin colorschemes Made significant updates to `after/colors` files to improve and override existing builtin colorschemes. These changes include enhanced color definitions for many of the current files and the addition of new files, now meaning we have overrides for nearly every builtin colorscheme in Neovim! Future work will further refine these highlight definitions. More deliberation is required to determine whether we should fully extend the global overrides table `vim.g.colors` with additional settings, or construct each file independently to account for edge cases, such as handling light and dark mode switching via `vim.o.background`. --- after/colors/blue.lua | 34 +++++++++++---- after/colors/darkblue.lua | 47 ++++++++++++++++++++ after/colors/default.lua | 70 +++++++++++++++++------------- after/colors/delek.lua | 6 ++- after/colors/desert.lua | 25 ++++++++--- after/colors/elflord.lua | 58 +++++++++++++++++-------- after/colors/evening.lua | 32 ++++++++++++++ after/colors/habamax.lua | 62 ++++++++++++++++++++------ after/colors/industry.lua | 45 +++++++++++++++---- after/colors/koehler.lua | 20 +++++++++ after/colors/lunaperche.lua | 54 +++++++++++++++++++++++ after/colors/morning.lua | 31 ++++--------- after/colors/murphy.lua | 53 +++++++++++++++++++++++ after/colors/pablo.lua | 22 ++++++++++ after/colors/peachpuff.lua | 26 +++++++++++ after/colors/quiet.lua | 19 ++++++++ after/colors/retrobox.lua | 50 +++++++++++++++++++++ after/colors/ron.lua | 54 +++++++++++------------ after/colors/shine.lua | 14 ++++++ after/colors/slate.lua | 45 +++++++++++++++++++ after/colors/sorbet.lua | 55 ++++++++++++++++++++++++ after/colors/torte.lua | 45 +++++++++++++++++++ after/colors/vim.lua | 86 +++++++++++++++++++++++++++---------- after/colors/wildcharm.lua | 47 ++++++++++++++++++++ after/colors/zaibatsu.lua | 57 ++++++++++++++++++++++++ after/colors/zellner.lua | 25 +++++++++++ 26 files changed, 924 insertions(+), 158 deletions(-) create mode 100644 after/colors/darkblue.lua create mode 100644 after/colors/evening.lua create mode 100644 after/colors/koehler.lua create mode 100644 after/colors/lunaperche.lua create mode 100644 after/colors/murphy.lua create mode 100644 after/colors/pablo.lua create mode 100644 after/colors/peachpuff.lua create mode 100644 after/colors/quiet.lua create mode 100644 after/colors/retrobox.lua create mode 100644 after/colors/shine.lua create mode 100644 after/colors/slate.lua create mode 100644 after/colors/sorbet.lua create mode 100644 after/colors/torte.lua create mode 100644 after/colors/wildcharm.lua create mode 100644 after/colors/zaibatsu.lua create mode 100644 after/colors/zellner.lua diff --git a/after/colors/blue.lua b/after/colors/blue.lua index 7f37528f..d3356f2c 100644 --- a/after/colors/blue.lua +++ b/after/colors/blue.lua @@ -1,15 +1,33 @@ +-- Define colors for builtin colorscheme: blue + local M = {} M.colors = { + CurSearch = { link = "IncSearch" }, + CursorLine = { ctermbg = 25, bg = "#003562" }, + CursorLineNr = { ctermfg = 87, fg = "#5fffff", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { ctermfg = 220, fg = "#ffd700" }, + Error = { ctermfg = 209, fg = "#ff7f50" }, + ErrorMsg = { link = "Error" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { bg = "Grey12" }, + IncSearch = { ctermfg = 40, bg = "Green" }, + LineNr = { fg = "Grey37" }, + MatchParen = { bg = "Grey37" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, - FloatBorder = { link = "VertSplit" }, - CursorLinrNr = { bg = "none" }, - EndOfBuffer = { fg = "DodgerBlue3" }, - VertSplit = { bg = "none" }, - - DiffAdd = { bg = "none" }, - DiffChange = { bg = "none" }, - DiffDelete = { bg = "none" }, + PmenuSel = { ctermbg = 231, bg = "Turquoise4" }, + Statement = { fg = "Violet" }, + VertSplit = { link = "WinSeparator" }, + Visual = { ctermfg = 231, ctermbg = 30, bg = "Turquoise4" }, + + -- Diff + DiffAdd = { ctermfg = 231, ctermbg = 65, bg = "#293a29", fg = "none" }, + DiffChange = { ctermfg = 231, ctermbg = 67, bg = "#354b62", fg = "none" }, + DiffDelete = { ctermfg = 231, ctermbg = 133, bg = "#623562", fg = "#af5faf" }, + DiffText = { ctermfg = 16, ctermbg = 251, bg = "#415b7b", fg = "none" }, } return M diff --git a/after/colors/darkblue.lua b/after/colors/darkblue.lua new file mode 100644 index 00000000..e8040759 --- /dev/null +++ b/after/colors/darkblue.lua @@ -0,0 +1,47 @@ +-- Define colors for builtin colorscheme: darkblue + +local M = {} + +M.colors = { + CurSearch = { link = "IncSearch" }, + CursorLine = { ctermbg = 236, bg = "Grey19" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineNr = { ctermfg = 3, fg = "Yellow" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + Error = { ctermfg = 217, fg = "#ffa0a0" }, + ErrorMsg = { link = "Error" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + IncSearch = { ctermfg = 40, bg = "Green" }, + LineNr = { ctermfg = 239, fg = "Grey30" }, + MatchParen = { ctermbg = 241, bg = "Grey39" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = 105, bg = "#00004d" }, + PmenuSel = { ctermbg = 59, bg = "Grey32" }, + Statement = { ctermfg = 177, fg = "Violet" }, + StatusLine = { ctermfg = 239, ctermbg = 18, fg = "Grey30", bg = "#000040" }, + StatusLineNC = { ctermbg = 18, ctermfg = 239, fg = "Grey30", bg = "#000080" }, + VertSplit = { link = "WinSeparator" }, + Visual = { ctermbg = 105, bg = "#000080" }, + WinSeparator = { ctermfg = 239, fg = "Grey30" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 12, ctermfg = 196, fg = "#bb4c4c" }, + DiffText = { ctermbg = 23, bg = "#005498" }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, +} + +return M diff --git a/after/colors/default.lua b/after/colors/default.lua index 6b28deeb..765a80ef 100644 --- a/after/colors/default.lua +++ b/after/colors/default.lua @@ -1,45 +1,55 @@ +-- Define colors for builtin colorscheme: default + local M = {} M.colors = { - ColorColumn = { bg = "NvimDarkBlue" }, - Constant = { fg = "NvimLightRed" }, - CursorLineNr = { ctermfg = 222, fg = "NvimLightYellow" }, + ColorColumn = { ctermbg = 24, bg = "NvimDarkBlue" }, + Constant = { ctermfg = 217, fg = "NvimLightRed" }, + CursorLineNr = { ctermfg = 222, fg = "NvimLightYellow", bold = true }, + Error = { ctermfg = 217, fg = "NvimLightRed" }, + ErrorMsg = { ctermfg = 217, ctermbg = 9, fg = "NvimLightRed", bg = "NvimDarkRed" }, FloatBorder = { link = "WinSeparator" }, - NonText = { ctermfg = 239, fg = "Gray15" }, - Normal = { ctermfg = 253, bg = "none", fg = "NvimLightGrey2" }, - PmenuSel = { bg = "NvimDarkGrey3" }, - Statement = { fg = "NvimLightMagenta" }, - StatusLine = { bg = "none" }, - Type = { fg = "NvimLightCyan" }, - WinSeparator = { ctermfg = 236, fg = "NvimDarkGrey3" }, + Folded = { ctermbg = 234, bg = "NvimDarkGrey2" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermfg = 253, fg = "NvimLightGrey2" }, + PmenuSel = { ctermbg = 254, ctermfg = 16, bg = "NvimLightGrey2", fg = "Black" }, + Statement = { ctermfg = 177, fg = "Violet" }, + StatusLine = { ctermbg = "none", bg = "none" }, + Title = { link = "Special" }, + Type = { ctermfg = 153, fg = "NvimLightBlue" }, + WinSeparator = { ctermfg = 237, fg = "NvimDarkGrey4" }, + WinBar = { link = "Normal" }, + WinBarNC = { link = "Normal" }, + VertSplit = { link = "WinSeparator" }, -- Git - GitSignsAdd = { ctermfg = 157, fg = "NvimLightGreen", bold = true }, - GitSignsChange = { ctermfg = 222, fg = "NvimLightYellow", bold = true }, - GitSignsDelete = { ctermfg = 217, fg = "NvimLightRed", bold = true }, + Added = { ctermfg = 157, fg = "NvimLightGreen", bold = true }, + Changed = { ctermfg = 222, fg = "NvimLightYellow", bold = true }, + Removed = { ctermfg = 217, fg = "NvimLightRed", bold = true }, + + -- Diff + DiffAdd = { ctermbg = 236, ctermfg = 40, bg = "NvimDarkGreen" }, + DiffChange = { ctermbg = 236, ctermfg = 75, bg = "NvimDarkBlue" }, + DiffDelete = { ctermbg = 236, ctermfg = 196, fg = "NvimLightRed" }, + DiffText = { ctermbg = 236, bg = "Grey19" }, -- LSP ["@lsp.mod.defaultLibrary.lua"] = { link = "@namespace" }, + ["@lsp.mod.global.lua"] = { ctermfg = 217, fg = "NvimLightRed" }, -- Treesitter + ["@string.special.url.comment"] = { ctermfg = 153, fg = "NvimLightBlue", underline = true }, ["@variable"] = { link = "Identifier" }, -- Rainbow Delimiters - RainbowDelimiterBlue = { fg = "NvimLightBlue", nocombine = true }, - RainbowDelimiterCyan = { fg = "NvimLightCyan", nocombine = true }, - RainbowDelimiterGreen = { fg = "NvimLightGreen", nocombine = true }, - RainbowDelimiterOrange = { ctermfg = 221, fg = "LightGoldenrod2", nocombine = true }, - RainbowDelimiterPink = { ctermfg = 210, fg = "LightCoral", nocombine = true }, - RainbowDelimiterRed = { fg = "NvimLightRed", nocombine = true }, - RainbowDelimiterViolet = { fg = "NvimLightMagenta", nocombine = true }, - RainbowDelimiterYellow = { fg = "NvimLightYellow", nocombine = true }, - - -- Dashboard - DashboardHeader = { link = "Special" }, - DashboardDesc = { link = "String" }, - DashboardFooter = { link = "Comment" }, - DashboardIcon = { link = "String" }, - DashboardShortCut = { link = "Keyword" }, + RainbowDelimiterBlue = { ctermfg = 153, fg = "NvimLightBlue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 123, fg = "NvimLightCyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 157, fg = "NvimLightGreen", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 209, fg = "Salmon", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 217, fg = "NvimLightRed", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 211, fg = "PaleVioletRed1", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 222, fg = "NvimLightYellow", nocombine = true }, } -- Neovim 0.10+ introduces a new default colorscheme. @@ -51,7 +61,9 @@ end -- Don't modify Normal if background is set to light mode. if vim.o.background == "light" then - M.colors["Normal"] = nil + M.colors.Constant = { fg = "NvimDarkRed" } + M.colors.Normal = nil + M.colors.Statement = { fg = "DarkViolet", bold = true } end return M diff --git a/after/colors/delek.lua b/after/colors/delek.lua index 34f47ce1..345b05b2 100644 --- a/after/colors/delek.lua +++ b/after/colors/delek.lua @@ -1,11 +1,13 @@ local M = {} M.colors = { - FloatBorder = { link = "VertSplit" }, + FloatBorder = { link = "WinSeparator" }, NonText = { fg = "Gray15" }, SignColumn = { bg = "none" }, - VertSplit = { fg = "Gray" }, + WinSeparator = { fg = "Gray" }, + VertSplit = { link = "WinSeparator" }, + -- Git DiffAdd = { fg = "Green", bg = "none" }, DiffChange = { fg = "Yellow", bg = "none" }, DiffDelete = { fg = "Red", bg = "none" }, diff --git a/after/colors/desert.lua b/after/colors/desert.lua index 34f47ce1..2f95ab76 100644 --- a/after/colors/desert.lua +++ b/after/colors/desert.lua @@ -1,17 +1,30 @@ +-- Define colors for builtin colorscheme: desert + local M = {} M.colors = { - FloatBorder = { link = "VertSplit" }, + FloatBorder = { link = "WinSeparator" }, NonText = { fg = "Gray15" }, SignColumn = { bg = "none" }, - VertSplit = { fg = "Gray" }, + Special = { ctermfg = 147, fg = "LightSteelBlue2" }, + StatusLine = { ctermfg = 238, fg = "Grey27" }, + StatusLineNC = { ctermfg = 242, ctermbg = 144, fg = "Gray42", bg = "#555238" }, + VertSplit = { link = "WinSeparator" }, + Visual = { ctermbg = 237, bg = "#48442a" }, + WinSeparator = { ctermfg = 144, fg = "#c2bfa5" }, + + -- Diff + Added = { ctermfg = 115, fg = "DarkSeaGreen3" }, + Changed = { ctermfg = 231, fg = "LightSteelBlue3" }, + Removed = { ctermfg = 211, fg = "PaleVioletRed1" }, - DiffAdd = { fg = "Green", bg = "none" }, - DiffChange = { fg = "Yellow", bg = "none" }, - DiffDelete = { fg = "Red", bg = "none" }, + DiffAdd = { bg = "#303222" }, + DiffChange = { bg = "#2e3644" }, + DiffDelete = { fg = "PaleVioletRed1" }, + DiffText = { bg = "#5e5838" }, -- Telescope - TelescopeNormal = { bg = "none" }, + TelescopeTitle = { link = "Title" }, } return M diff --git a/after/colors/elflord.lua b/after/colors/elflord.lua index 545a2e2e..11f3558c 100644 --- a/after/colors/elflord.lua +++ b/after/colors/elflord.lua @@ -1,27 +1,51 @@ +-- Define colors for builtin colorscheme: elflord + local M = {} M.colors = { - Normal = { bg = "none" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineNr = { ctermfg = 3, fg = "Yellow", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { link = "NonText" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { ctermbg = 235, bg = "Grey15" }, + IncSearch = { ctermbg = 214, bg = "LightBlue" }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { ctermfg = 44, fg = "#00cdcd" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalBorder = { link = "WinSeparator" }, NormalFloat = { link = "Normal" }, - NormalBorder = { link = "VertSplit" }, - CursorLinrNr = { bg = "none" }, - EndOfBuffer = { fg = "red" }, - FloatBorder = { fg = "Gray" }, - VertSplit = { bg = "none" }, + Pmenu = { link = "NormalFloat" }, + TablineFill = { ctermbg = "none", bg = "none" }, + WinSeparator = { ctermfg = 44, fg = "#00cdcd" }, + VertSplit = { link = "WinSeparator" }, + + -- Git + Added = { ctermfg = 46, fg = "#00ff00" }, + Changed = { ctermfg = 63, fg = "#3a66ff" }, + Removed = { ctermfg = 201, fg = "#f564f5" }, - DiffAdd = { bg = "none", fg = "#5f875f" }, - DiffChange = { bg = "none", fg = "#5f87af" }, - DiffDelete = { bg = "none", fg = "#af5faf" }, + -- Diff + DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 12, ctermfg = 196, fg = "#c24fc2" }, + DiffText = { ctermbg = 23, bg = "#005498" }, - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, - -- Whichkey - WhichKey = { link = "Define" }, + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, } return M diff --git a/after/colors/evening.lua b/after/colors/evening.lua new file mode 100644 index 00000000..a99c1ad1 --- /dev/null +++ b/after/colors/evening.lua @@ -0,0 +1,32 @@ +-- Define colors for builtin colorscheme: evening + +local M = {} + +M.colors = { + LineNr = { fg = "Grey49" }, + CursorLine = { bg = "Gray15" }, + CursorLineNr = { ctermfg = 3, bg = "none", fg = "Yellow", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { ctermfg = 153, ctermbg = "none", fg = "LightSkyBlue1", bg = "none" }, + FloatBorder = { link = "VertSplit" }, + NonText = { ctermfg = 153, ctermbg = "none", fg = "LightSkyBlue1", bg = "none" }, + NormalFloat = { ctermbg = "none", bg = "none" }, + Pmenu = { link = "NormalFloat" }, + StatusLine = { ctermbg = "none", ctermfg = 234, bg = "none", fg = "Grey62" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey46", fg = "Grey11" }, + Title = { link = "Define" }, + WinSeparator = { ctermbg = "none", ctermfg = 243, bg = "none", fg = "Grey46" }, + Visual = { ctermfg = 231, ctermbg = 246, bg = "Grey46" }, + + -- Diff + DiffAdd = { ctermbg = 232, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 232, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 232, ctermfg = 196, fg = "Red" }, + DiffText = { ctermbg = 238, bg = "Grey27" }, + + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, +} + +return M diff --git a/after/colors/habamax.lua b/after/colors/habamax.lua index 94eff523..8b5752db 100644 --- a/after/colors/habamax.lua +++ b/after/colors/habamax.lua @@ -1,21 +1,55 @@ +-- Define colors for builtin colorscheme: habamax + local M = {} M.colors = { - Normal = { bg = "none" }, + CursorLineNr = { fg = "#d7af87", bold = true }, + Error = { ctermfg = 131, ctermbg = 234, fg = "#af5f5f", bg = "#1c1c1c" }, + ErrorMsg = { link = "Error" }, + FloatBorder = { link = "WinSeparator" }, + MatchParen = { ctermbg = 240, bg = "Grey35" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, - FloatBorder = { link = "VertSplit" }, - VertSplit = { bg = "none" }, - - DiffAdd = { bg = "none" }, - DiffChange = { bg = "none" }, - DiffDelete = { bg = "none" }, - - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, + NvimInternalError = { link = "ErrorMsg" }, + Special = { ctermfg = 66, fg = "#68a4a4" }, + StatusLine = { ctermfg = 234, fg = "Grey62" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey27", fg = "Grey17" }, + Title = { link = "Define" }, + Underlined = { ctermfg = 66, fg = "#68a4a4", underline = true }, + WinSeparator = { ctermfg = 243, fg = "Grey46" }, + Visual = { ctermbg = 109, ctermfg = 16, bg = "DeepSkyBlue4" }, + VertSplit = { link = "WinSeparator" }, + + -- LSP + DiagnosticWarn = { link = "WarningMsg" }, + DiagnosticError = { link = "Error" }, + + -- Git + Added = { ctermfg = 77, fg = "#5c925c" }, + Changed = { ctermfg = 215, fg = "#568ca6" }, + Removed = { ctermfg = 167, fg = "#ac5e5e" }, + + -- Diff + DiffAdd = { ctermbg = 71, bg = "#243224" }, + DiffChange = { ctermbg = 67, bg = "#243240" }, + DiffDelete = { ctermfg = 131, fg = "#af5f5f" }, + DiffText = { ctermbg = 139, bg = "#364a62" }, + + -- Neogit + NeogitCommitViewDescription = { link = "Normal" }, + NeogitDiffAdd = { bg = "#243224", fg = "#4e904e" }, + NeogitDiffDelete = { bg = "#583030", fg = "#af5f5f" }, + NeogitObjectId = { ctermfg = 139, fg = "#af87af" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 74, fg = "#5fafd7" }, + RainbowDelimiterCyan = { ctermfg = 109, fg = "#87afaf" }, + RainbowDelimiterGreen = { ctermfg = 114, fg = "#87d787" }, + RainbowDelimiterOrange = { ctermfg = 180, fg = "#d7af87" }, + RainbowDelimiterRed = { ctermfg = 168, fg = "#d75f87" }, + RainbowDelimiterViolet = { ctermfg = 176, fg = "#d787d7" }, + RainbowDelimiterYellow = { ctermfg = 186, fg = "#d7c387" }, } return M diff --git a/after/colors/industry.lua b/after/colors/industry.lua index 59471ed1..5850fe80 100644 --- a/after/colors/industry.lua +++ b/after/colors/industry.lua @@ -1,15 +1,44 @@ +-- Define colors for builtin colorscheme: industry + local M = {} M.colors = { + CursorLine = { bg = "Gray15" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + CursorLinrNr = { ctermbg = "none", bg = "none" }, + FloatBorder = { link = "WinSeparator" }, + LineNr = { ctermfg = 240, fg = "Grey35" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, - FloatBorder = { link = "VertSplit" }, - CursorLinrNr = { bg = "none" }, - StatusLine = { bg = "none" }, - VertSplit = { bg = "none" }, - - DiffAdd = { bg = "none" }, - DiffChange = { bg = "none" }, - DiffDelete = { bg = "none" }, + Pmenu = { ctermbg = "none", bg = "none" }, + PmenuSel = { ctermbg = 4, ctermfg = 16, bg = "DarkYellow", fg = "Black" }, + Statement = { fg = "HotPink" }, + StatusLine = { ctermbg = 81, ctermfg = 16 }, + StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey15", fg = "White" }, + WinSeparator = { ctermfg = 242, fg = "#6c6c6c" }, + Visual = { ctermbg = 81, ctermfg = 16, bg = "Grey27" }, + VertSplit = { link = "WinSeparator" }, + + -- Diff + Added = { ctermfg = 10, fg = "Green2" }, + Removed = { ctermfg = 9, fg = "Magenta2" }, + Changed = { ctermfg = 14, fg = "Cyan" }, + + DiffAdd = { ctermfg = 231, ctermbg = 65, bg = "#003000" }, + DiffChange = { ctermfg = 231, ctermbg = 67, bg = "#002850" }, + DiffDelete = { ctermbg = 231, ctermfg = 133, fg = "#9e009e" }, + DiffText = { ctermfg = 16, ctermbg = 251, bg = "#003b76" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { fg = "Blue" }, + RainbowDelimiterCyan = { fg = "Cyan" }, + RainbowDelimiterGreen = { fg = "Green" }, + RainbowDelimiterOrange = { fg = "Orange" }, + RainbowDelimiterPink = { fg = "Pink" }, + RainbowDelimiterRed = { fg = "Red" }, + RainbowDelimiterViolet = { fg = "Violet" }, + RainbowDelimiterYellow = { fg = "Yellow" }, } return M diff --git a/after/colors/koehler.lua b/after/colors/koehler.lua new file mode 100644 index 00000000..5ae5a932 --- /dev/null +++ b/after/colors/koehler.lua @@ -0,0 +1,20 @@ +-- Define colors for builtin colorscheme: koehler + +local M = {} + +M.colors = { + CursorLine = { bg = "Gray15" }, + CursorLineNr = { bg = "Gray15", fg = "Yellow", bold = true }, + Folded = { bg = "Gray12" }, + IncSearch = { ctermbg = 52, bg = "DarkRed" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = "none", bg = "none" }, + Statement = { fg = "Violet" }, + StatusLine = { ctermfg = 234, bg = "Gray24", fg = "Grey11" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey46", fg = "Grey11" }, + WinSeparator = { fg = "Gray32" }, + Visual = { ctermbg = 241, bg = "Grey39" }, +} + +return M diff --git a/after/colors/lunaperche.lua b/after/colors/lunaperche.lua new file mode 100644 index 00000000..054fab32 --- /dev/null +++ b/after/colors/lunaperche.lua @@ -0,0 +1,54 @@ +-- Define colors for builtin colorscheme: lunaperche + +local M = {} + +M.colors = { + CursorLineNr = { ctermfg = 75, fg = "#5fafff", bold = true }, + Error = { ctermfg = 16, ctermbg = 203, fg = "Black", bg = "IndianRed1" }, + ErrorMsg = { link = "Error" }, + Identifier = { ctermfg = 251, fg = "Grey79" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = "none", bg = "none" }, + Statement = { fg = "IndianRed1" }, + StatusLine = { ctermfg = 16, fg = "Grey67" }, + StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey22", fg = "White" }, + Title = { link = "Define" }, + Underlined = { ctermfg = 73, fg = "#5fd7d7", underline = true }, + WinSeparator = { ctermfg = 243, fg = "Grey46" }, + Visual = { ctermbg = 24, bg = "#005f87" }, + VertSplit = { link = "WinSeparator" }, + + -- Git + Added = { ctermfg = 77, fg = "#5fd75f" }, + Changed = { ctermfg = 75, fg = "#5fafff" }, + Removed = { ctermfg = 203, fg = "#ff5f5f" }, + + -- Diff + DiffAdd = { ctermfg = 96, bg = "#202d20" }, + DiffChange = { ctermfg = 59, bg = "#1e2b38" }, + DiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#ff5f5f" }, + DiffText = { ctermfg = 66, bg = "#3a5252" }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 113, bg = "#004e2a", fg = "#5fd75f" }, + NeogitDiffAddHighlight = { fg = "#ffd787", bg = "Grey17" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 110, bg = "#202a3e", fg = "#87afd7" }, + NeogitDiffContext = { bg = "#26292e" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#ff5f5f" }, + NeogitDiffDeleteHighlight = { fg = "Black", bg = "Black" }, + NeogitDiffText = { ctermbg = 213, bg = "#3a4772" }, + NeogitHunkHeader = { bg = "Gray31", fg = "#ff87ff" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { ctermfg = 75, fg = "#5fafff", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 80, fg = "#5fd7d7", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 77, fg = "#5fd75f", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 215, fg = "#ffa75f", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 203, fg = "#ff5f5f", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 213, fg = "#ff87ff", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 222, fg = "#ffd787", nocombine = true }, +} + +return M diff --git a/after/colors/morning.lua b/after/colors/morning.lua index 897c3db6..62cc6d57 100644 --- a/after/colors/morning.lua +++ b/after/colors/morning.lua @@ -1,30 +1,17 @@ +-- Define colors for builtin colorscheme: morning + local M = {} M.colors = { - -- Normal = { bg = "none" }, - NormalFloat = { link = "Normal" }, - NormalBorder = { link = "VertSplit" }, + Constant = { ctermbg = "none", ctermfg = 201, bg = "none", fg = "#ff00ff" }, CursorLinrNr = { bg = "none" }, + EndOfBuffer = { ctermbg = 252, ctermfg = 21, bg = "none", fg = "#0000ff", bold = true }, NonText = { bg = "none" }, - EndOfBuffer = { fg = "red" }, - FloatBorder = { fg = "Gray" }, - VertSplit = { bg = "none" }, - Whitespace = { bg = "none" }, - -- StatusLineNC = { bg = "Gray15" }, - - DiffAdd = { bg = "none", fg = "#5f875f" }, - DiffChange = { bg = "none", fg = "#5f87af" }, - DiffDelete = { bg = "none", fg = "#af5faf" }, - - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, - - -- Whichkey - WhichKey = { link = "Define" }, + Normal = { ctermfg = 16, ctermbg = 254, fg = "Black", bg = "#e4e4e4" }, + NormalBorder = { link = "VertSplit" }, + NormalFloat = { link = "Normal" }, + StatusLineNC = { bg = "Gray4" }, + WinSeparator = { bg = "none" }, } return M diff --git a/after/colors/murphy.lua b/after/colors/murphy.lua new file mode 100644 index 00000000..1e23cdd4 --- /dev/null +++ b/after/colors/murphy.lua @@ -0,0 +1,53 @@ +-- Define colors for builtin colorscheme: murphy + +local M = {} + +M.colors = { + CursorLine = { bg = "Gray15" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + CursorLinrNr = { ctermbg = "none", bg = "none", fg = "Yellow", bold = true }, + EndOfBuffer = { ctermfg = 21, fg = "Blue1" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { bg = "Gray12" }, + IncSearch = { ctermfg = 40, bg = "Green" }, + NormalFloat = { link = "Normal" }, + Normal = { ctermbg = "none", bg = "none" }, + PmenuSel = { ctermbg = 21, bg = "Blue1" }, + Statement = { fg = "Violet" }, + WinSeparator = { fg = "Gray32" }, + Constant = { fg = "IndianRed" }, + Visual = { ctermbg = 22, bg = "#005f00" }, + VertSplit = { link = "WinSeparator" }, + MsgSeparator = { link = "WinSeparator" }, + Error = { ctermbg = 196, bg = "#ff0000" }, + ErrorMsg = { link = "Error" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 12, ctermfg = 196, fg = "#bb4c4c" }, + DiffText = { ctermbg = 23, bg = "#005498" }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, +} + +return M diff --git a/after/colors/pablo.lua b/after/colors/pablo.lua new file mode 100644 index 00000000..4c149ce0 --- /dev/null +++ b/after/colors/pablo.lua @@ -0,0 +1,22 @@ +-- Define colors for builtin colorscheme: pablo + +local M = {} + +M.colors = { + CursorLine = { bg = "Gray15" }, + CursorLineNr = { ctermfg = 226, fg = "Yellow", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { ctermfg = 226, fg = "Yellow" }, + LineNr = { ctermfg = 242, fg = "Gray42" }, + NonText = { link = "Comment" }, + Normal = { ctermbg = "none", bg = "none" }, + Pmenu = { ctermbg = "none", bg = "none" }, + PmenuSel = { ctermbg = 20, bg = "Blue4" }, + SignColumn = { ctermbg = "none", bg = "none" }, + Special = { fg = "LightBlue" }, + StatusLineNC = { ctermfg = 242, bg = "Blue4", fg = "Gray2" }, + Title = { ctermfg = 145, fg = "Yellow" }, + WinSeparator = { ctermfg = 238, fg = "Gray32" }, +} + +return M diff --git a/after/colors/peachpuff.lua b/after/colors/peachpuff.lua new file mode 100644 index 00000000..7d65fefb --- /dev/null +++ b/after/colors/peachpuff.lua @@ -0,0 +1,26 @@ +-- Define colors for builtin colorscheme: peachpuff + +local M = {} + +M.colors = { + ColorColumn = { ctermbg = 173, bg = "#cc8c6c" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + TabLineFill = { ctermbg = "none", bg = "none" }, + WinSeparator = { ctermfg = 243, fg = "Black" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "DarkBlue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "DarkCyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "DarkGreen", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "DarkOrange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "DarkRed", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "DarkMagenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "DarkYellow", nocombine = true }, + + -- Telescope + TelescopeSelection = { link = "CursorLine" }, + TelescopeSelectionCaret = { ctermbg = 180, ctermfg = 16, bg = "#f5c195", fg = "Black" }, +} + +return M diff --git a/after/colors/quiet.lua b/after/colors/quiet.lua new file mode 100644 index 00000000..6678069d --- /dev/null +++ b/after/colors/quiet.lua @@ -0,0 +1,19 @@ +-- Define colors for builtin colorscheme: quiet + +local M = {} + +M.colors = { + ErrorMsg = { link = "Error" }, + IncSearch = { ctermbg = 52, bg = "DarkRed" }, + MsgSeparator = { link = "WinSeparator" }, + NormalFloat = { link = "Normal" }, + WinSeparator = { ctermfg = 239, fg = "Grey32" }, + VertSplit = { link = "WinSeparator" }, + + -- Git + Added = { ctermfg = 10, fg = "NvimLightGreen", bold = true }, + Removed = { ctermfg = 9, fg = "NvimLightRed", bold = true }, + Changed = { ctermfg = 14, fg = "NvimLightCyan", bold = true }, +} + +return M diff --git a/after/colors/retrobox.lua b/after/colors/retrobox.lua new file mode 100644 index 00000000..36f3c034 --- /dev/null +++ b/after/colors/retrobox.lua @@ -0,0 +1,50 @@ +-- Define colors for builtin colorscheme: retrobox + +local M = {} + +M.colors = { + ColorColumn = { ctermbg = 233, bg = "Grey7" }, + CursorLineNr = { ctermfg = 215, fg = "#fabd2f", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + Error = { ctermfg = 203, ctermbg = 234, fg = "#fb4934", bg = "#1c1c1c", bold = true }, + ErrorMsg = { link = "Error" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { ctermbg = 234, bg = "Grey12" }, + IncSearch = { ctermbg = 208, ctermfg = 234, bg = "#fe8019", fg = "Grey11" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Operator = { ctermfg = 208, fg = "#fe8019" }, + SignColumn = { ctermbg = "none", bg = "none" }, + StatusLine = { ctermfg = 246, fg = "#a89984" }, + WinSeparator = { ctermfg = 238, fg = "Grey32" }, + Visual = { ctermbg = 238, bg = "#47403a" }, + + -- Git + Added = { ctermfg = 142, fg = "#b8bb26" }, + Removed = { ctermfg = 203, fg = "#fb4934" }, + Changed = { ctermfg = 208, fg = "#fe8019" }, + + -- Diff + DiffAdd = { ctermfg = 142, ctermbg = 235, bg = "#2c2c07" }, + DiffChange = { ctermfg = 208, ctermbg = 235, bg = "#2a3531" }, + DiffDelete = { ctermfg = 203, ctermbg = 235, bg = "#47140e", fg = "#ae3224" }, + DiffText = { ctermfg = 208, ctermbg = 235, bg = "#3a4844" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 108, fg = "#83a598", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 108, fg = "#8ec07c", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 142, fg = "#b8bb26", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 208, fg = "#fe8019", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 203, fg = "#fb4934", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 175, fg = "#d3869b", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 215, fg = "#fabd2f", nocombine = true }, +} + +-- Don't modify Normal if background is set to light mode. +if vim.o.background == "light" then + M.colors.Normal = nil + M.colors.StatusLine = nil +end + +return M diff --git a/after/colors/ron.lua b/after/colors/ron.lua index 8874ac80..7ed5d6e5 100644 --- a/after/colors/ron.lua +++ b/after/colors/ron.lua @@ -1,37 +1,31 @@ +-- Define colors for builtin colorscheme: ron + local M = {} M.colors = { - Normal = { bg = "none" }, - Comment = { fg = "Gray45" }, - CursorLine = { bg = "none" }, - CursorLineNr = { bg = "none", fg = "Yellow" }, - EndOfBuffer = { fg = "Grey17" }, - LineNr = { fg = "Gray35" }, - MsgSeparator = { link = "VertSplit" }, - NonText = { fg = "Gray15" }, - FloatBorder = { link = "VertSplit" }, - SignColumn = { bg = "none" }, - StatusLine = { bg = "Blue", fg = "Gray80" }, - StatusLineNC = { bg = "NavyBlue" }, - VertSplit = { fg = "Gray35" }, - - DiffAdd = { fg = "Green", bg = "none" }, - DiffChange = { fg = "Yellow", bg = "none" }, - DiffDelete = { fg = "Red", bg = "none" }, - - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, - - -- Indent Blankline - IndentBlanklineChar = { link = "LineNr" }, + CursorLine = { bg = "Gray15" }, + CursorLineNr = { ctermfg = 226, bg = "Gray15", fg = "Yellow", bold = true }, + EndOfBuffer = { ctermfg = 226, fg = "Yellow" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { ctermbg = 234, bg = "Gray12" }, + LineNr = { ctermfg = 242, fg = "Gray42" }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { fg = "Gray25" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = "none", bg = "none" }, + SignColumn = { ctermbg = "none", bg = "none" }, + StatusLine = { ctermfg = 242, bg = "Blue", fg = "Gray2" }, + Title = { ctermfg = 145, fg = "Yellow" }, + WinSeparator = { ctermfg = 238, fg = "Gray32" }, + Visual = { ctermbg = 18, bg = "Gray24" }, + VertSplit = { link = "WinSeparator" }, - -- Whichkey - WhichKey = { link = "Define" }, - WhichKeyFloat = { bg = "Gray5" }, + -- Diff + DiffAdd = { ctermbg = "none", bg = "none" }, + DiffChange = { ctermbg = "none", bg = "none" }, + DiffDelete = { ctermbg = "none", bg = "none" }, + DiffText = { ctermbg = "none", bg = "none" }, } return M diff --git a/after/colors/shine.lua b/after/colors/shine.lua new file mode 100644 index 00000000..4a19a7ef --- /dev/null +++ b/after/colors/shine.lua @@ -0,0 +1,14 @@ +-- Define colors for builtin colorscheme: shine + +local M = {} + +M.colors = { + NonText = { fg = "Gray15" }, + NormalFloat = { bg = "Gray82" }, + SignColumn = { ctermbg = "none", bg = "none" }, + StatusLine = { ctermbg = "none", ctermfg = 234, bg = "White", fg = "Grey7" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey36", fg = "Grey11" }, + WinSeparator = { fg = "Gray" }, +} + +return M diff --git a/after/colors/slate.lua b/after/colors/slate.lua new file mode 100644 index 00000000..ac3dee10 --- /dev/null +++ b/after/colors/slate.lua @@ -0,0 +1,45 @@ +-- Define colors for builtin colorscheme: slate + +local M = {} + +M.colors = { + CursorLine = { bg = "Gray15" }, + CursorLineNr = { fg = "#d7d787" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { bg = "Gray12" }, + NonText = { fg = "Gray25" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = "none", bg = "none" }, + SignColumn = { ctermbg = "none", bg = "none" }, + Statement = { fg = "Violet" }, + StatusLineNC = { bg = "Gray15" }, + Structure = { ctermfg = 64, fg = "#5f8700" }, + WinSeparator = { fg = "Gray32" }, + Visual = { ctermfg = 186, ctermbg = 64, fg = "#d7d787", bg = "#5f8700" }, + VertSplit = { link = "WinSeparator" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermfg = 231, ctermbg = 65, fg = "#ffffff", bg = "#5f875f" }, + DiffChange = { ctermfg = 231, ctermbg = 67, fg = "#ffffff", bg = "#5f87af" }, + DiffDelete = { ctermfg = 231, ctermbg = 133, fg = "#ffffff", bg = "#af5faf" }, + DiffText = { ctermfg = 16, ctermbg = 251, fg = "Black", bg = "#c6c6c6" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 68, fg = "#5f87d7", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 117, fg = "#87d7ff", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 46, fg = "#5f8700", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 173, fg = "#d7875f", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 217, fg = "#ffafaf", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 210, fg = "#ff8787", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 177, fg = "#d787ff", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 186, fg = "#d7d787", nocombine = true }, +} + +return M diff --git a/after/colors/sorbet.lua b/after/colors/sorbet.lua new file mode 100644 index 00000000..b979d2a3 --- /dev/null +++ b/after/colors/sorbet.lua @@ -0,0 +1,55 @@ +-- Define colors for builtin colorscheme: sorbet + +local M = {} + +M.colors = { + CursorLine = { ctermbg = 237, bg = "#2f3347" }, + CursorLineNr = { fg = "#d7af5f", bold = true }, + Error = { ctermfg = 203, fg = "#ff5f5f", bold = true }, + ErrorMsg = { link = "Error" }, + FloatBorder = { link = "WinSeparator" }, + NonText = { ctermfg = 60, fg = "#575c84" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = 236, bg = "#2e2e30" }, + PmenuSel = { ctermfg = 15, ctermbg = 60, fg = "White", bg = "MediumPurple4" }, + Statement = { ctermfg = 177, fg = "Violet" }, + StatusLine = { ctermbg = "none", ctermfg = 8, fg = "Grey" }, + StatusLineNC = { ctermfg = 60, ctermbg = 16, fg = "MediumPurple4", bg = "Grey0", reverse = false }, + Underlined = { ctermfg = 73, fg = "#5fafaf", underline = true }, + Visual = { ctermbg = 94, bg = "#523c18" }, + + -- Search + CurSearch = { link = "IncSearch" }, + IncSearch = { ctermfg = 214, ctermbg = 16, fg = "#ffaf00", bg = "#000000" }, + Search = { ctermfg = 39, ctermbg = 16, fg = "#00afff", bg = "#000000" }, + + -- Git + Added = { ctermfg = 113, fg = "#87d75f" }, + Changed = { ctermfg = 110, fg = "#87afd7" }, + Removed = { ctermfg = 167, fg = "#d75f5f" }, + + -- Diff + DiffAdd = { ctermbg = 35, bg = "#004e2a" }, + DiffChange = { ctermbg = 111, bg = "#202a3e" }, + DiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#d75f5f" }, + DiffText = { ctermbg = 213, bg = "#3a4772" }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 113, bg = "#004e2a", fg = "#87d75f" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 110, bg = "#202a3e", fg = "#87afd7" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#d75f5f" }, + NeogitDiffText = { ctermbg = 213, bg = "#3a4772" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { fg = "#87afd7", nocombine = true }, + RainbowDelimiterCyan = { fg = "#5fafaf", nocombine = true }, + RainbowDelimiterGreen = { fg = "#87d75f", nocombine = true }, + RainbowDelimiterOrange = { fg = "#cc9b6e", nocombine = true }, + RainbowDelimiterPink = { fg = "#c46cc4", nocombine = true }, + RainbowDelimiterRed = { fg = "#d75f5f", nocombine = true }, + RainbowDelimiterViolet = { fg = "#af87d7", nocombine = true }, + RainbowDelimiterYellow = { fg = "#d7af5f", nocombine = true }, +} + +return M diff --git a/after/colors/torte.lua b/after/colors/torte.lua new file mode 100644 index 00000000..d490ecce --- /dev/null +++ b/after/colors/torte.lua @@ -0,0 +1,45 @@ +-- Define colors for builtin colorscheme: torte + +local M = {} + +M.colors = { + CursorLine = { bg = "Grey15" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineNr = { fg = "Yellow" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + FloatBorder = { link = "VertSplit" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + NonText = { fg = "Grey25" }, + Normal = { bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = "none", bg = "none" }, + PmenuSel = { ctermfg = 16, ctermbg = 226, fg = "Black", bg = "Yellow1" }, + StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey15", fg = "White" }, + TablineFill = { ctermbg = "none", bg = "none" }, + WinSeparator = { ctermfg = 239, fg = "Grey30" }, + Visual = { ctermbg = 238, bg = "Grey27" }, + + -- Search + CurSearch = { link = "IncSearch" }, + IncSearch = { ctermfg = 40, bg = "Green" }, + Search = { ctermbg = 3, ctermfg = 16, bg = "Yellow", fg = "Black" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermbg = 232, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 232, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 232, ctermfg = 196, fg = "Red" }, + DiffText = { ctermbg = 238, bg = "Grey27" }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, +} + +return M diff --git a/after/colors/vim.lua b/after/colors/vim.lua index 1313c2ca..d25d72b0 100644 --- a/after/colors/vim.lua +++ b/after/colors/vim.lua @@ -1,34 +1,76 @@ +-- Define colors for builtin colorscheme: vim + local M = {} M.colors = { - Normal = { bg = "none", fg = "Grey93" }, - ColorColumn = { bg = "Gray10" }, - CursorLineNr = { fg = "Gold", underline = false }, - CursorLine = { bg = "Gray15" }, - LineNr = { fg = "Gray30" }, - NonText = { fg = "Gray15" }, - SignColumn = { bg = "none" }, - VertSplit = { fg = "Gray27" }, - FloatBorder = { fg = "Gray" }, - Visual = { bg = "Gray20" }, - - DiffAdd = { link = "Type" }, - DiffChange = { link = "Statement" }, - DiffDelete = { fg = "Red", bg = "none" }, + ColorColumn = { ctermbg = 234, bg = "Grey10" }, + Cursor = { ctermfg = 220, bg = "Gold" }, + CursorLine = { ctermbg = 235, bg = "Grey15" }, + CursorLineNr = { ctermfg = 220, fg = "Gold", underline = false }, + FloatBorder = { link = "WinSeparator" }, + FoldColumn = { link = "Normal" }, + Folded = { ctermbg = 237, bg = "Grey23" }, + Identifier = { ctermfg = 14, fg = "Cyan" }, + LineNr = { ctermfg = 239, fg = "Grey30" }, + MatchParen = { ctermbg = 243, bg = "Grey46" }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { ctermfg = 235, fg = "Grey15" }, + Normal = { ctermfg = 255, fg = "Grey93" }, + Pmenu = { ctermbg = "none", bg = "none" }, + PmenuSel = { ctermbg = 238, ctermfg = 15, bg = "Grey27" }, + SignColumn = { ctermbg = "none", bg = "none" }, + Title = { link = "Special" }, + WinSeparator = { ctermfg = 238, fg = "Grey27" }, + Visual = { ctermfg = 15, ctermbg = 240, bg = "Grey35" }, + VertSplit = { link = "WinSeparator" }, + + -- StatusLine + StatusLine = { ctermbg = "none", bg = "none" }, + StatusLineNC = { ctermbg = "none", bg = "none" }, + TabLineFill = { ctermbg = "none", bg = "none" }, + + -- Search + CurSearch = { ctermbg = 3, ctermfg = 16, bg = "Yellow", fg = "Black" }, + IncSearch = { reverse = true }, + Search = { ctermbg = 172, ctermfg = 16, bg = "Orange", fg = "Black" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, + DiffDelete = { ctermbg = 12, ctermfg = 196, fg = "#bb4c4c" }, + DiffText = { ctermbg = 23, bg = "#005498" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, -- Telescope TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, - - -- Indent Blankline - IndentBlanklineChar = { link = "LineNr" }, + TelescopePreviewBorder = { link = "FloatBorder" }, + TelescopePromptBorder = { link = "FloatBorder" }, + TelescopeResultsBorder = { link = "FloatBorder" }, + TelescopeSelection = { ctermbg = 236, bg = "Grey23" }, + TelescopeSelectionCaret = { ctermfg = 214, fg = "Orange" }, -- Whichkey WhichKey = { link = "Define" }, - -- WhichKeyFloat = { bg = "none" }, } return M diff --git a/after/colors/wildcharm.lua b/after/colors/wildcharm.lua new file mode 100644 index 00000000..3dfe769a --- /dev/null +++ b/after/colors/wildcharm.lua @@ -0,0 +1,47 @@ +-- Define colors for builtin colorscheme: wildcharm + +local M = {} + +M.colors = { + CursorLineNr = { ctermfg = 213, fg = "Orchid1", bold = true }, + Error = { ctermfg = 161, fg = "#d7005f" }, + ErrorMsg = { link = "Error" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + StatusLine = { ctermbg = 81, ctermfg = 15, fg = "White" }, + StatusLineNC = { ctermbg = 237, ctermfg = 243, bg = "Grey23", fg = "White" }, + Title = { link = "Define" }, + Underlined = { ctermfg = 39, fg = "#00afff", underline = true }, + VertSplit = { link = "WinSeparator" }, + Visual = { ctermbg = 25, ctermfg = 16, bg = "#144454" }, + WinSeparator = { ctermfg = 240, fg = "#585858" }, + + -- Git + Added = { ctermfg = 35, fg = "#00d75f" }, + Changed = { ctermfg = 32, fg = "#00afff" }, + Removed = { ctermfg = 161, fg = "#ff5f87" }, + + -- Diff + DiffAdd = { ctermfg = "none", ctermbg = 65, fg = "none", bg = "#122e20" }, + DiffChange = { ctermfg = "none", ctermbg = 59, fg = "none", bg = "#1e383e" }, + DiffDelete = { ctermfg = 217, ctermbg = 234, fg = "#ff5f87", bg = "#31121a" }, + DiffText = { ctermfg = "none", ctermbg = 66, fg = "none", bg = "#305252" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { ctermfg = 39, fg = "#00afff", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 44, fg = "#00d7d7", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 41, fg = "#00d75f", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "#ffaf00", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 213, fg = "#ff87ff", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 204, fg = "#ff5f87", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 99, fg = "#875fff", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 220, fg = "#ffe800", nocombine = true }, +} + +-- Force transparent background in dark mode. +if vim.o.background == "light" then + M.colors.Normal = nil +end + +return M diff --git a/after/colors/zaibatsu.lua b/after/colors/zaibatsu.lua new file mode 100644 index 00000000..eb05a595 --- /dev/null +++ b/after/colors/zaibatsu.lua @@ -0,0 +1,57 @@ +-- Define colors for builtin colorscheme: zaibatsu + +local M = {} + +M.colors = { + CursorLineNr = { ctermfg = 227, fg = "#ffff5f", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { ctermfg = 147, fg = "#afafff" }, + Error = { ctermbg = 160, ctermfg = 9, bg = "#d70000", fg = "#ff5faf" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { ctermbg = 235, bg = "#261e34" }, + LineNr = { ctermfg = 240, fg = "#4d4d70" }, + MatchParen = { ctermbg = 236, bg = "#4d4d70" }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { ctermfg = 103, fg = "#878092" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Pmenu = { ctermbg = 60, bg = "#52416f" }, + PmenuSel = { ctermbg = 237, bg = "#362b49" }, + StatusLine = { ctermfg = 16, fg = "White" }, + StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey15", fg = "White" }, + Title = { link = "Special" }, + WinSeparator = { ctermfg = 53, fg = "#362b49" }, + Visual = { ctermbg = 24, bg = "#283851" }, + VertSplit = { link = "WinSeparator" }, + + -- Search + CurSearch = { link = "IncSearch" }, + IncSearch = { ctermbg = 214, ctermfg = 16, bg = "#ffaf00", fg = "Black" }, + Search = { ctermbg = 123, ctermfg = 16, bg = "#87ffff", fg = "Black" }, + + -- Git + Added = { ctermfg = 10, fg = "#00d700" }, + Removed = { ctermfg = 9, fg = "#ff5faf" }, + Changed = { ctermfg = 14, fg = "#8787ff" }, + + -- Diff + DiffAdd = { ctermfg = 118, ctermbg = 237, fg = "#87ff00", bg = "#362b49" }, + DiffChange = { ctermfg = 147, ctermbg = 237, fg = "#8787ff", bg = "#362b49" }, + DiffDelete = { ctermfg = 205, ctermbg = 237, fg = "#ff5faf" }, + DiffText = { ctermfg = 189, ctermbg = 237, fg = "#d7d5db", bg = "#362b49" }, + + -- Dap + DapStoppedLine = { bg = "#514f27" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 39, fg = "#00afff", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 123, fg = "#87ffff", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 118, fg = "#87ff00", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "#ffaf00", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 219, fg = "#ffafff", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 205, fg = "#ff5faf", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 14, fg = "#8787ff", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 227, fg = "#ffff5f", nocombine = true }, +} + +return M diff --git a/after/colors/zellner.lua b/after/colors/zellner.lua new file mode 100644 index 00000000..f6271c31 --- /dev/null +++ b/after/colors/zellner.lua @@ -0,0 +1,25 @@ +-- Define colors for builtin colorscheme: zellner + +local M = {} + +M.colors = { + NonText = { ctermfg = 235, fg = "Grey15" }, + NormalFloat = { bg = "Grey82" }, + SignColumn = { ctermbg = 15, bg = "none" }, + StatusLine = { ctermbg = "none", ctermfg = 234, bg = "White", fg = "Grey7" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey36", fg = "Grey11" }, + TablineFill = { ctermbg = 16, bg = "none" }, + WinSeparator = { ctermfg = 7, fg = "Grey" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, +} + +return M From b86d323e5724c013b1b7d795abc35b42afe7a7c1 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 13:41:52 -0800 Subject: [PATCH 049/153] refactor(colors): change highlight definitions schema for after/colors Revised the data structure in `after/colors` modules to a flat table format. Highlight definitions were previously nested within `M.colors`, which required additional handling in the loader function. - Improve documentation header comment for the `config/colors` module. - Fix minor inconsistencies in LuaDoc comments for `config/colors`. - Add type aliases for highlight definition formats. - Apply new `config.Highlights` type alias to `after/colors` modules. - Refactor `set_hl` callback to populate the `ret` highlight table, implicitly returning highlight definitions instead of requiring an explicit table return value. --- after/colors/blue.lua | 7 ++----- after/colors/darkblue.lua | 7 ++----- after/colors/default.lua | 15 +++++++------- after/colors/delek.lua | 7 +++---- after/colors/desert.lua | 7 ++----- after/colors/elflord.lua | 7 ++----- after/colors/evening.lua | 7 ++----- after/colors/habamax.lua | 7 ++----- after/colors/industry.lua | 7 ++----- after/colors/koehler.lua | 7 ++----- after/colors/lunaperche.lua | 7 ++----- after/colors/morning.lua | 7 ++----- after/colors/murphy.lua | 7 ++----- after/colors/pablo.lua | 7 ++----- after/colors/peachpuff.lua | 7 ++----- after/colors/quiet.lua | 7 ++----- after/colors/retrobox.lua | 11 +++++----- after/colors/ron.lua | 7 ++----- after/colors/shine.lua | 7 ++----- after/colors/slate.lua | 7 ++----- after/colors/sorbet.lua | 7 ++----- after/colors/torte.lua | 7 ++----- after/colors/vim.lua | 7 ++----- after/colors/wildcharm.lua | 9 ++++---- after/colors/zaibatsu.lua | 7 ++----- after/colors/zellner.lua | 7 ++----- lua/config/colors.lua | 41 +++++++++++++++++++++++-------------- 27 files changed, 89 insertions(+), 148 deletions(-) diff --git a/after/colors/blue.lua b/after/colors/blue.lua index d3356f2c..d3a93ba9 100644 --- a/after/colors/blue.lua +++ b/after/colors/blue.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: blue -local M = {} - -M.colors = { +---@type config.Highlights +return { CurSearch = { link = "IncSearch" }, CursorLine = { ctermbg = 25, bg = "#003562" }, CursorLineNr = { ctermfg = 87, fg = "#5fffff", bold = true }, @@ -29,5 +28,3 @@ M.colors = { DiffDelete = { ctermfg = 231, ctermbg = 133, bg = "#623562", fg = "#af5faf" }, DiffText = { ctermfg = 16, ctermbg = 251, bg = "#415b7b", fg = "none" }, } - -return M diff --git a/after/colors/darkblue.lua b/after/colors/darkblue.lua index e8040759..a9b705c0 100644 --- a/after/colors/darkblue.lua +++ b/after/colors/darkblue.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: darkblue -local M = {} - -M.colors = { +---@type config.Highlights +return { CurSearch = { link = "IncSearch" }, CursorLine = { ctermbg = 236, bg = "Grey19" }, CursorLineFold = { ctermbg = "none", bg = "none" }, @@ -43,5 +42,3 @@ M.colors = { NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, } - -return M diff --git a/after/colors/default.lua b/after/colors/default.lua index 765a80ef..1d5e6653 100644 --- a/after/colors/default.lua +++ b/after/colors/default.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: default -local M = {} - -M.colors = { +---@type config.Highlights +local colors = { ColorColumn = { ctermbg = 24, bg = "NvimDarkBlue" }, Constant = { ctermfg = 217, fg = "NvimLightRed" }, CursorLineNr = { ctermfg = 222, fg = "NvimLightYellow", bold = true }, @@ -56,14 +55,14 @@ M.colors = { -- In older versions, `default` refers to the old scheme, now renamed `vim` in newer versions. -- Support older versions by loading the appropriate color definitions. if vim.fn.has("nvim-0.10") == 0 then - M.colors = require("after.colors.vim") + colors = require("after.colors.vim") end -- Don't modify Normal if background is set to light mode. if vim.o.background == "light" then - M.colors.Constant = { fg = "NvimDarkRed" } - M.colors.Normal = nil - M.colors.Statement = { fg = "DarkViolet", bold = true } + colors.Constant = { fg = "NvimDarkRed" } + colors.Normal = nil + colors.Statement = { fg = "DarkViolet", bold = true } end -return M +return colors diff --git a/after/colors/delek.lua b/after/colors/delek.lua index 345b05b2..20dff7ba 100644 --- a/after/colors/delek.lua +++ b/after/colors/delek.lua @@ -1,6 +1,7 @@ -local M = {} +-- Define colors for builtin colorscheme: delek -M.colors = { +---@type config.Highlights +return { FloatBorder = { link = "WinSeparator" }, NonText = { fg = "Gray15" }, SignColumn = { bg = "none" }, @@ -15,5 +16,3 @@ M.colors = { -- Telescope TelescopeNormal = { bg = "none" }, } - -return M diff --git a/after/colors/desert.lua b/after/colors/desert.lua index 2f95ab76..5ddd79bf 100644 --- a/after/colors/desert.lua +++ b/after/colors/desert.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: desert -local M = {} - -M.colors = { +---@type config.Highlights +return { FloatBorder = { link = "WinSeparator" }, NonText = { fg = "Gray15" }, SignColumn = { bg = "none" }, @@ -26,5 +25,3 @@ M.colors = { -- Telescope TelescopeTitle = { link = "Title" }, } - -return M diff --git a/after/colors/elflord.lua b/after/colors/elflord.lua index 11f3558c..3fca3901 100644 --- a/after/colors/elflord.lua +++ b/after/colors/elflord.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: elflord -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLineFold = { ctermbg = "none", bg = "none" }, CursorLineNr = { ctermfg = 3, fg = "Yellow", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, @@ -47,5 +46,3 @@ M.colors = { NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, } - -return M diff --git a/after/colors/evening.lua b/after/colors/evening.lua index a99c1ad1..786f3851 100644 --- a/after/colors/evening.lua +++ b/after/colors/evening.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: evening -local M = {} - -M.colors = { +---@type config.Highlights +return { LineNr = { fg = "Grey49" }, CursorLine = { bg = "Gray15" }, CursorLineNr = { ctermfg = 3, bg = "none", fg = "Yellow", bold = true }, @@ -28,5 +27,3 @@ M.colors = { Changed = { ctermfg = 75, fg = "SteelBlue2" }, Removed = { ctermfg = 196, fg = "Red" }, } - -return M diff --git a/after/colors/habamax.lua b/after/colors/habamax.lua index 8b5752db..d52c3165 100644 --- a/after/colors/habamax.lua +++ b/after/colors/habamax.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: habamax -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLineNr = { fg = "#d7af87", bold = true }, Error = { ctermfg = 131, ctermbg = 234, fg = "#af5f5f", bg = "#1c1c1c" }, ErrorMsg = { link = "Error" }, @@ -51,5 +50,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 176, fg = "#d787d7" }, RainbowDelimiterYellow = { ctermfg = 186, fg = "#d7c387" }, } - -return M diff --git a/after/colors/industry.lua b/after/colors/industry.lua index 5850fe80..85e8608c 100644 --- a/after/colors/industry.lua +++ b/after/colors/industry.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: industry -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineSign = { ctermbg = "none", bg = "none" }, CursorLinrNr = { ctermbg = "none", bg = "none" }, @@ -40,5 +39,3 @@ M.colors = { RainbowDelimiterViolet = { fg = "Violet" }, RainbowDelimiterYellow = { fg = "Yellow" }, } - -return M diff --git a/after/colors/koehler.lua b/after/colors/koehler.lua index 5ae5a932..7d956a7a 100644 --- a/after/colors/koehler.lua +++ b/after/colors/koehler.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: koehler -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineNr = { bg = "Gray15", fg = "Yellow", bold = true }, Folded = { bg = "Gray12" }, @@ -16,5 +15,3 @@ M.colors = { WinSeparator = { fg = "Gray32" }, Visual = { ctermbg = 241, bg = "Grey39" }, } - -return M diff --git a/after/colors/lunaperche.lua b/after/colors/lunaperche.lua index 054fab32..7dfd9be4 100644 --- a/after/colors/lunaperche.lua +++ b/after/colors/lunaperche.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: lunaperche -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLineNr = { ctermfg = 75, fg = "#5fafff", bold = true }, Error = { ctermfg = 16, ctermbg = 203, fg = "Black", bg = "IndianRed1" }, ErrorMsg = { link = "Error" }, @@ -50,5 +49,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 213, fg = "#ff87ff", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 222, fg = "#ffd787", nocombine = true }, } - -return M diff --git a/after/colors/morning.lua b/after/colors/morning.lua index 62cc6d57..4614f69e 100644 --- a/after/colors/morning.lua +++ b/after/colors/morning.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: morning -local M = {} - -M.colors = { +---@type config.Highlights +return { Constant = { ctermbg = "none", ctermfg = 201, bg = "none", fg = "#ff00ff" }, CursorLinrNr = { bg = "none" }, EndOfBuffer = { ctermbg = 252, ctermfg = 21, bg = "none", fg = "#0000ff", bold = true }, @@ -13,5 +12,3 @@ M.colors = { StatusLineNC = { bg = "Gray4" }, WinSeparator = { bg = "none" }, } - -return M diff --git a/after/colors/murphy.lua b/after/colors/murphy.lua index 1e23cdd4..b245194a 100644 --- a/after/colors/murphy.lua +++ b/after/colors/murphy.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: murphy -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineSign = { ctermbg = "none", bg = "none" }, CursorLinrNr = { ctermbg = "none", bg = "none", fg = "Yellow", bold = true }, @@ -49,5 +48,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, } - -return M diff --git a/after/colors/pablo.lua b/after/colors/pablo.lua index 4c149ce0..ff8fa4a1 100644 --- a/after/colors/pablo.lua +++ b/after/colors/pablo.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: pablo -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineNr = { ctermfg = 226, fg = "Yellow", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, @@ -18,5 +17,3 @@ M.colors = { Title = { ctermfg = 145, fg = "Yellow" }, WinSeparator = { ctermfg = 238, fg = "Gray32" }, } - -return M diff --git a/after/colors/peachpuff.lua b/after/colors/peachpuff.lua index 7d65fefb..37a37ae2 100644 --- a/after/colors/peachpuff.lua +++ b/after/colors/peachpuff.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: peachpuff -local M = {} - -M.colors = { +---@type config.Highlights +return { ColorColumn = { ctermbg = 173, bg = "#cc8c6c" }, CursorLineSign = { ctermbg = "none", bg = "none" }, TabLineFill = { ctermbg = "none", bg = "none" }, @@ -22,5 +21,3 @@ M.colors = { TelescopeSelection = { link = "CursorLine" }, TelescopeSelectionCaret = { ctermbg = 180, ctermfg = 16, bg = "#f5c195", fg = "Black" }, } - -return M diff --git a/after/colors/quiet.lua b/after/colors/quiet.lua index 6678069d..97933e87 100644 --- a/after/colors/quiet.lua +++ b/after/colors/quiet.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: quiet -local M = {} - -M.colors = { +---@type config.Highlights +return { ErrorMsg = { link = "Error" }, IncSearch = { ctermbg = 52, bg = "DarkRed" }, MsgSeparator = { link = "WinSeparator" }, @@ -15,5 +14,3 @@ M.colors = { Removed = { ctermfg = 9, fg = "NvimLightRed", bold = true }, Changed = { ctermfg = 14, fg = "NvimLightCyan", bold = true }, } - -return M diff --git a/after/colors/retrobox.lua b/after/colors/retrobox.lua index 36f3c034..7fe53e00 100644 --- a/after/colors/retrobox.lua +++ b/after/colors/retrobox.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: retrobox -local M = {} - -M.colors = { +---@type config.Highlights +local colors = { ColorColumn = { ctermbg = 233, bg = "Grey7" }, CursorLineNr = { ctermfg = 215, fg = "#fabd2f", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, @@ -43,8 +42,8 @@ M.colors = { -- Don't modify Normal if background is set to light mode. if vim.o.background == "light" then - M.colors.Normal = nil - M.colors.StatusLine = nil + colors.Normal = nil + colors.StatusLine = nil end -return M +return colors diff --git a/after/colors/ron.lua b/after/colors/ron.lua index 7ed5d6e5..bc9dea44 100644 --- a/after/colors/ron.lua +++ b/after/colors/ron.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: ron -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineNr = { ctermfg = 226, bg = "Gray15", fg = "Yellow", bold = true }, EndOfBuffer = { ctermfg = 226, fg = "Yellow" }, @@ -27,5 +26,3 @@ M.colors = { DiffDelete = { ctermbg = "none", bg = "none" }, DiffText = { ctermbg = "none", bg = "none" }, } - -return M diff --git a/after/colors/shine.lua b/after/colors/shine.lua index 4a19a7ef..d527dda9 100644 --- a/after/colors/shine.lua +++ b/after/colors/shine.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: shine -local M = {} - -M.colors = { +---@type config.Highlights +return { NonText = { fg = "Gray15" }, NormalFloat = { bg = "Gray82" }, SignColumn = { ctermbg = "none", bg = "none" }, @@ -10,5 +9,3 @@ M.colors = { StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey36", fg = "Grey11" }, WinSeparator = { fg = "Gray" }, } - -return M diff --git a/after/colors/slate.lua b/after/colors/slate.lua index ac3dee10..30482e1f 100644 --- a/after/colors/slate.lua +++ b/after/colors/slate.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: slate -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Gray15" }, CursorLineNr = { fg = "#d7d787" }, CursorLineSign = { ctermbg = "none", bg = "none" }, @@ -41,5 +40,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 177, fg = "#d787ff", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 186, fg = "#d7d787", nocombine = true }, } - -return M diff --git a/after/colors/sorbet.lua b/after/colors/sorbet.lua index b979d2a3..00878b94 100644 --- a/after/colors/sorbet.lua +++ b/after/colors/sorbet.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: sorbet -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { ctermbg = 237, bg = "#2f3347" }, CursorLineNr = { fg = "#d7af5f", bold = true }, Error = { ctermfg = 203, fg = "#ff5f5f", bold = true }, @@ -51,5 +50,3 @@ M.colors = { RainbowDelimiterViolet = { fg = "#af87d7", nocombine = true }, RainbowDelimiterYellow = { fg = "#d7af5f", nocombine = true }, } - -return M diff --git a/after/colors/torte.lua b/after/colors/torte.lua index d490ecce..8a870fd5 100644 --- a/after/colors/torte.lua +++ b/after/colors/torte.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: torte -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLine = { bg = "Grey15" }, CursorLineFold = { ctermbg = "none", bg = "none" }, CursorLineNr = { fg = "Yellow" }, @@ -41,5 +40,3 @@ M.colors = { NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, } - -return M diff --git a/after/colors/vim.lua b/after/colors/vim.lua index d25d72b0..2e17d81b 100644 --- a/after/colors/vim.lua +++ b/after/colors/vim.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: vim -local M = {} - -M.colors = { +---@type config.Highlights +return { ColorColumn = { ctermbg = 234, bg = "Grey10" }, Cursor = { ctermfg = 220, bg = "Gold" }, CursorLine = { ctermbg = 235, bg = "Grey15" }, @@ -72,5 +71,3 @@ M.colors = { -- Whichkey WhichKey = { link = "Define" }, } - -return M diff --git a/after/colors/wildcharm.lua b/after/colors/wildcharm.lua index 3dfe769a..33156c71 100644 --- a/after/colors/wildcharm.lua +++ b/after/colors/wildcharm.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: wildcharm -local M = {} - -M.colors = { +---@type config.Highlights +local colors = { CursorLineNr = { ctermfg = 213, fg = "Orchid1", bold = true }, Error = { ctermfg = 161, fg = "#d7005f" }, ErrorMsg = { link = "Error" }, @@ -41,7 +40,7 @@ M.colors = { -- Force transparent background in dark mode. if vim.o.background == "light" then - M.colors.Normal = nil + colors.Normal = nil end -return M +return colors diff --git a/after/colors/zaibatsu.lua b/after/colors/zaibatsu.lua index eb05a595..644c9d69 100644 --- a/after/colors/zaibatsu.lua +++ b/after/colors/zaibatsu.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: zaibatsu -local M = {} - -M.colors = { +---@type config.Highlights +return { CursorLineNr = { ctermfg = 227, fg = "#ffff5f", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, EndOfBuffer = { ctermfg = 147, fg = "#afafff" }, @@ -53,5 +52,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 14, fg = "#8787ff", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 227, fg = "#ffff5f", nocombine = true }, } - -return M diff --git a/after/colors/zellner.lua b/after/colors/zellner.lua index f6271c31..e34fdc76 100644 --- a/after/colors/zellner.lua +++ b/after/colors/zellner.lua @@ -1,8 +1,7 @@ -- Define colors for builtin colorscheme: zellner -local M = {} - -M.colors = { +---@type config.Highlights +return { NonText = { ctermfg = 235, fg = "Grey15" }, NormalFloat = { bg = "Grey82" }, SignColumn = { ctermbg = 15, bg = "none" }, @@ -21,5 +20,3 @@ M.colors = { RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, } - -return M diff --git a/lua/config/colors.lua b/lua/config/colors.lua index abf18508..a144891b 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -1,11 +1,18 @@ --- Utility functions for loading and managing neovim colorschemes. --- Provides color handling, highlight setup, and event-based updates. +-- colors.lua: Utility for managing and customizing Neovim colorschemes +-- +-- Provides functions to load colorschemes, manage highlight groups, +-- and apply custom highlight definitions dynamically during ColorScheme events. +-- Supports autocommands to ensure custom highlights are re-applied when changing themes. + +---@alias config.HighlightsTbl table +---@alias config.HighlightsFn fun(hl?: config.HighlightsTbl): nil +---@alias config.Highlights config.HighlightsTbl|config.HighlightsFn local M = {} vim.g.COLORSCHEME = "default" ----Check if colorscheme filename is available in the runtimepath +---Check if colorscheme filename is available in the runtimepath. ---@param colors_name string ---@return boolean M.is_available = function(colors_name) @@ -20,7 +27,7 @@ end ---Get color table from highlight group. ---@param name string higroup name. ----@return table +---@return config.HighlightsTbl M.get_hl = function(name) local labels = { "bg", "fg", "sp" } local colors = vim.api.nvim_get_hl(0, { name = name }) @@ -37,27 +44,31 @@ end ---Extend table for highlight definitions for `nvim_set_hl`. ---@param group string ----@param tbl table ----@return table -M.extend_hl = function(group, tbl) - local colors = M.get_highlights(group) - return vim.tbl_extend("force", colors, tbl) +---@param colors config.HighlightsTbl +---@return config.HighlightsTbl +M.extend_hl = function(group, colors) + local group_colors = M.get_highlight(group) + return vim.tbl_extend("force", group_colors, colors) end ----Wrapper for `nvim_set_hl` that applies higroups from table definitions. ----@param colors table|fun(): table +---Wrapper for nvim_set_hl that applies higroups from table/func definitions. +---@param colors config.Highlights +---@return nil M.set_hl = function(colors) + local ret = {} if type(colors) == "function" then - colors = colors() + colors(ret) + elseif type(colors) == "table" then + ret = colors end - for group, hl in pairs(colors) do + for group, hl in pairs(ret) do vim.api.nvim_set_hl(0, group, hl) end end ---Registers an autocmd to set highlights on `ColorScheme` event. ---@param name string? Name of the colorscheme for the autocmd pattern; use `"*"` or `nil` to match all colorschemes. ----@param colors table Table of highlight definitions (e.g., { Normal = { fg = "#ffffff", bg = "#000000" } }). +---@param colors config.Highlights Table of highlight definitions. M.set_hl_autocmd = function(name, colors) local pattern = name or "*" M._hl_cache = vim.tbl_deep_extend("force", M._hl_cache or {}, { [pattern] = colors }) @@ -98,7 +109,7 @@ M.load = function(name) -- Safely load lua file for theme highlights local theme_ok, theme = pcall(dofile, filepath) if theme_ok and type(theme) == "table" then - M.set_hl(theme["colors"] or {}) + M.set_hl(theme or {}) end -- Apply global highlights variable for all colorschemes. From dc86e47ce14e1cee8d04068b6cc814113ae01269 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 13:53:30 -0800 Subject: [PATCH 050/153] refactor(colors): improve dark/light variants for colorscheme: quiet --- after/colors/quiet.lua | 112 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 107 insertions(+), 5 deletions(-) diff --git a/after/colors/quiet.lua b/after/colors/quiet.lua index 97933e87..e836f512 100644 --- a/after/colors/quiet.lua +++ b/after/colors/quiet.lua @@ -1,7 +1,7 @@ -- Define colors for builtin colorscheme: quiet ----@type config.Highlights -return { +---@type config.HighlightsTbl +local colors = { ErrorMsg = { link = "Error" }, IncSearch = { ctermbg = 52, bg = "DarkRed" }, MsgSeparator = { link = "WinSeparator" }, @@ -10,7 +10,109 @@ return { VertSplit = { link = "WinSeparator" }, -- Git - Added = { ctermfg = 10, fg = "NvimLightGreen", bold = true }, - Removed = { ctermfg = 9, fg = "NvimLightRed", bold = true }, - Changed = { ctermfg = 14, fg = "NvimLightCyan", bold = true }, + Added = { ctermfg = 40, fg = "Green4" }, + Changed = { ctermfg = 75, fg = "SteelBlue3" }, + Removed = { ctermfg = 196, fg = "Red3" }, + + -- Diff + DiffAdd = { ctermbg = 34, bg = "#00af00" }, + DiffChange = { ctermbg = 110, bg = "#87afd7" }, + DiffDelete = { ctermfg = 167, fg = "#d75f5f" }, + DiffText = { ctermbg = 176, bg = "#d787d7" }, +} + +---@type string[] +local terminal_dark = { + "#000000", + "#d7005f", + "#00af5f", + "#d78700", + "#0087d7", + "#d787d7", + "#00afaf", + "#dadada", + "#707070", + "#ff005f", + "#00d75f", + "#ffaf00", + "#5fafff", + "#ff87ff", + "#00d7d7", + "#ffffff", +} + +---@type config.HighlightsTbl +local dark = { + CursorLine = { ctermbg = 235, bg = "Grey15" }, + CursorLineNr = { ctermfg = 7, fg = "White", bold = true }, + Error = { ctermfg = 197, ctermbg = 16, fg = "#d7005f", bg = "Black", bold = true }, + Folded = { ctermbg = 233, bg = "Grey7" }, + MatchParen = { ctermbg = 237, bg = "Grey37", bold = true }, + Normal = {}, + Pmenu = { ctermbg = 239, ctermfg = 248, fg = "#a8a8a8", bg = "#4e4e4e" }, + StatusLine = { ctermfg = 248, fg = "Grey66" }, + StatusLineNC = { ctermfg = 234, ctermbg = 243, bg = "Grey32", fg = "Grey11" }, + Underlined = { ctermfg = 248, fg = "Grey67", underline = true }, + Visual = { ctermbg = 239, ctermfg = 16, bg = "#4b4b4b" }, + WarningMsg = { ctermfg = 3, fg = "#d78700" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 7, fg = "Grey79", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 7, fg = "Grey79", nocombine = true }, } + +---@type string[] +local terminal_light = { + "#ffffff", + "#af0000", + "#005f00", + "#af5f00", + "#005faf", + "#870087", + "#008787", + "#626262", + "#d7d7d7", + "#d70000", + "#008700", + "#d78700", + "#0087d7", + "#af00af", + "#00afaf", + "#000000", +} + +---@type config.HighlightsTbl +local light = { + CursorLineNr = { ctermfg = 16, fg = "Black" }, + Error = { ctermfg = 197, fg = "#af0000", bold = true }, + MatchParen = { ctermbg = 237, bg = "Grey77", bold = true }, + Underlined = { ctermfg = 59, fg = "Grey37", underline = true }, + Visual = { ctermfg = 248, ctermbg = 16, fg = "#a8a8a8", bg = "Black" }, + WarningMsg = { ctermfg = 3, fg = "#af5f00" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 8, fg = "Grey9", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 8, fg = "Grey9", nocombine = true }, +} + +if vim.o.background == "light" then + for i = 0, 15 do + vim.g["terminal_color" .. i] = terminal_light[i] + end + return vim.tbl_extend("force", colors, light) +else + for i = 0, 15 do + vim.g["terminal_color" .. i] = terminal_dark[i] + end + return vim.tbl_extend("force", colors, dark) +end From c89a76f1586b2be93ad22f165d42765596d82981 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 08:15:35 -0700 Subject: [PATCH 051/153] fix(colors): update global highlight groups with default flag - Prefer `WinSeparator` over `VertSplit` - Added `default = true` to global highlight groups to ensure that colorschemes can overwrite user defaults without issues. - Included default highlight groups for `telescope.nvim` and `dashboard.nvim` to standardize appearance across colorschemes. - Added comments to `vim.g.colors` for better understanding of its purpose and usage. --- lua/config/options.lua | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 8d3fd94d..380258f0 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -200,10 +200,33 @@ vim.opt.fillchars = { } -- Global highlight overrides +-- Many of these are manually set to default so that colorschemes are able to overwrite them. +-- Using default prevents issues with themes that don't explicitly set the same highlight groups. +---@type table vim.g.colors = { - LspInfoBorder = { link = "FloatBorder" }, - MsgSeparator = { link = "VertSplit" }, - NormalFloat = { link = "Normal" }, + FloatBorder = { link = "WinSeparator", default = true }, + LspInfoBorder = { link = "FloatBorder", default = true }, + MsgSeparator = { link = "WinSeparator", default = true }, + NormalFloat = { link = "Normal", default = true }, + VertSplit = { link = "WinSeparator", default = true }, + + -- Dashboard + DashboardDesc = { link = "String", default = true }, + DashboardFooter = { link = "Comment", default = true }, + DashboardHeader = { link = "Special", default = true }, + DashboardIcon = { link = "String", default = true }, + DashboardKey = { link = "Comment", default = true }, + DashboardShortCut = { link = "Keyword", default = true }, + + -- Telescope + TelescopeBorder = { link = "WinSeparator", default = true }, + TelescopeSelection = { link = "CursorLine", default = true }, + TelescopeTitle = { link = "Title", default = true }, + + -- WhichKey + WhichKeyNormal = { link = "Normal", default = true }, + WhichKeySeparator = { link = "WinSeparator", default = true }, + WhichKeyTitle = { link = "Title", default = true }, } -- Netrw specific options From fd313c39f6f2143b5590c439b18c6632c8fa3c8f Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 6 Dec 2024 00:28:58 -0800 Subject: [PATCH 052/153] fix(colors): move plugin-specific highlights to initialization Some plugins either lack default highlights or apply undesirable settings. To maintain modularity, move these highlights to their respective configuration files instead of defining them centrally. The `config.color` utility function dynamically creates an autocmd for setting highlights whenever the colorscheme changes, simplifying the process. - Remove background hl from treesitter context by linking to `Normal`. Affected plugin: - dashboard - neogit - rainbow-delimiters.nvim - telescope - treesitter - treesitter-context - which-key --- lua/config/options.lua | 18 ------------------ lua/plugins/dashboard.lua | 10 ++++++++++ lua/plugins/neogit.lua | 7 +++++++ lua/plugins/telescope.lua | 11 +++++++++++ lua/plugins/treesitter.lua | 32 +++++++++++++++++++++++++++++--- lua/plugins/which-key.lua | 8 ++++++++ 6 files changed, 65 insertions(+), 21 deletions(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 380258f0..29ca5545 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -209,24 +209,6 @@ vim.g.colors = { MsgSeparator = { link = "WinSeparator", default = true }, NormalFloat = { link = "Normal", default = true }, VertSplit = { link = "WinSeparator", default = true }, - - -- Dashboard - DashboardDesc = { link = "String", default = true }, - DashboardFooter = { link = "Comment", default = true }, - DashboardHeader = { link = "Special", default = true }, - DashboardIcon = { link = "String", default = true }, - DashboardKey = { link = "Comment", default = true }, - DashboardShortCut = { link = "Keyword", default = true }, - - -- Telescope - TelescopeBorder = { link = "WinSeparator", default = true }, - TelescopeSelection = { link = "CursorLine", default = true }, - TelescopeTitle = { link = "Title", default = true }, - - -- WhichKey - WhichKeyNormal = { link = "Normal", default = true }, - WhichKeySeparator = { link = "WinSeparator", default = true }, - WhichKeyTitle = { link = "Title", default = true }, } -- Netrw specific options diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index 05e171e8..83713992 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -85,6 +85,16 @@ return { }, }, init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + DashboardDesc = { link = "String", default = true }, + DashboardFooter = { link = "Comment", default = true }, + DashboardHeader = { link = "Special", default = true }, + DashboardIcon = { link = "String", default = true }, + DashboardKey = { link = "Comment", default = true }, + DashboardShortCut = { link = "Keyword", default = true }, + }) + vim.api.nvim_create_autocmd("FileType", { desc = "Apply local settings to Dashboard buffer", group = vim.api.nvim_create_augroup("Dashboard_ftplugin", {}), diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 60e006fb..bb473003 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -25,6 +25,13 @@ return { commit_popup = { kind = "split_above" }, }, init = function() + -- Set default highlights + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + NeogitCommitViewDescription = { link = "Normal" }, + NeogitWinSeparator = { link = "WinSeparator" }, + }) + vim.api.nvim_create_autocmd("FileType", { desc = "Local options to apply to neogit filetypes", group = vim.api.nvim_create_augroup("NeogitBufferOptions", {}), diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 8ad9d741..9c2dd989 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -209,4 +209,15 @@ return { command = "setlocal wrap", }) end, + init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + TelescopeBorder = { link = "WinSeparator", default = true }, + TelescopePreviewBorder = { link = "WinSeparator", default = true }, + TelescopePromptBorder = { link = "WinSeparator", default = true }, + TelescopeResultsBorder = { link = "WinSeparator", default = true }, + TelescopeSelection = { link = "CursorLine", default = true }, + TelescopeTitle = { link = "Title", default = true }, + }) + end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 3712ec4d..f6eb43a4 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,6 +1,22 @@ -- nvim-treesitter | Nvim Treesitter configurations and abstraction layer -- https://github.com/nvim-treesitter/nvim-treesitter +---Set default highlights for rainbow-delimiters +---NOTE: Prevents errors when switching colorschemes which don't have these highlights set. +local init_default_highlights = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + RainbowDelimiterBlue = { ctermfg = 4, fg = "NvimLightBlue", default = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "NvimLightCyan", default = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "NvimLightGreen", default = true }, + RainbowDelimiterOrange = { ctermfg = 221, fg = "LightGoldenrod2", default = true }, + RainbowDelimiterPink = { ctermfg = 210, fg = "LightCoral", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "NvimLightRed", default = true }, + RainbowDelimiterViolet = { ctermfg = 177, fg = "NvimLightMagenta", default = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "NvimLightYellow", default = true }, + }) +end + ---@type LazyPluginSpec return { "nvim-treesitter/nvim-treesitter", @@ -9,8 +25,6 @@ return { event = { "BufReadPost", "BufNewFile" }, cond = not vim.g.vscode, dependencies = { - -- Rainbow delimiters for Neovim with Tree-sitter - { "hiphish/rainbow-delimiters.nvim" }, -- Treesitter auto html tags { "windwp/nvim-ts-autotag" }, -- set commentstring based on the cursor location @@ -19,8 +33,20 @@ return { { "nvim-treesitter/nvim-treesitter-textobjects" }, -- Treesitter playground integrated into Neovim { "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" }, + -- Rainbow delimiters for Neovim with Tree-sitter + { "hiphish/rainbow-delimiters.nvim", init = init_default_highlights }, -- Alternative to context.vim using nvim-treesitter - { "nvim-treesitter/nvim-treesitter-context", opts = { max_lines = 1 } }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = { max_lines = 1 }, + init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + TreesitterContext = { link = "Normal" }, + TreesitterContextLineNumber = { link = "Normal" }, + }) + end, + }, }, config = function(_, opts) require("nvim-treesitter.configs").setup(opts) diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 9f17988d..131e6a86 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -5,6 +5,14 @@ return { "folke/which-key.nvim", event = { "VeryLazy" }, + init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + WhichKeyNormal = { link = "Normal", default = true }, + WhichKeySeparator = { link = "WinSeparator", default = true }, + WhichKeyTitle = { link = "Title", default = true }, + }) + end, ---@class wk.Opts opts = { preset = "classic", From 7a936cd477cd6713a91d5ec974a52e0652ec1c1e Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 24 Aug 2024 05:41:57 -0700 Subject: [PATCH 053/153] refactor(colors): remove pcall from dofile call Removed `pcall` from the `dofile` function call in the theme highlight loader. This change ensures that errors in the sourced file are not suppressed, allowing issues to be detected and addressed promptly. --- lua/config/colors.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index a144891b..c53ceda9 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -106,10 +106,9 @@ M.load = function(name) vim.cmd.source(filepath) end - -- Safely load lua file for theme highlights - local theme_ok, theme = pcall(dofile, filepath) - if theme_ok and type(theme) == "table" then - M.set_hl(theme or {}) + -- Load lua file for theme highlights + if filepath and filepath:match(".+%.lua") then + M.set_hl(dofile(filepath) or {}) end -- Apply global highlights variable for all colorschemes. From d382682df4ff3b75c1580dff7df38a697a07b623 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 24 Aug 2024 06:38:58 -0700 Subject: [PATCH 054/153] refactor(colors): encapsulate autocmds and improve function naming - Encapsulated autocmds in functions to allow optional activation and better organization. - Removed default value for `COLORSCHEME`, as the autocmds handle this automatically. - Renamed loader function to `load_after_colors` - Added nil check for `name` in `load_after_colors` to avoid loading the `after/colors` module without a specified name. - Updated autocmd group names to be more descriptive and aligned with events. - Renamed and modified `M.is_available` to `M.check_colorscheme_exists` for better clarity, and ensured it ignores paths in the `after/colors` directory. --- lua/config/colors.lua | 116 ++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 43 deletions(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index c53ceda9..cbc62968 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -10,15 +10,15 @@ local M = {} -vim.g.COLORSCHEME = "default" - ----Check if colorscheme filename is available in the runtimepath. ----@param colors_name string +---Check if colorscheme filename is available in the runtimepath +---@param name string ---@return boolean -M.is_available = function(colors_name) - for _, theme in pairs(vim.api.nvim_get_runtime_file("colors/*.*", true)) do - local theme_file = string.match(theme, "/colors/(%w+)%.[lua|vim]") - if theme_file == colors_name then +M.check_colorscheme_exists = function(name) + for _, path in pairs(vim.api.nvim_get_runtime_file("colors/*.*", true)) do + local basename = string.match(path, "/colors/(%w+)%.[lua|vim]") + local is_after = string.match(path, "/after/colors/") + -- Ensure the path does not located in the `after/` directory. + if basename and basename == name and not is_after then return true end end @@ -96,10 +96,14 @@ local get_colors_file = function(name, rtp) end end ----Load colorscheme from runtime path: `after/colors` ----@param name string Name of the desired colorscheme. -M.load = function(name) - local filepath = get_colors_file(name, "after/colors") +---Load highlight overrides for the specified colorscheme and apply global overrides. +---@param name string Colorscheme name used to look for a matching `after/colors` module. +---@return nil +M.load_after_colors = function(name) + local filepath + if name then + filepath = get_colors_file(name, "after/colors") + end -- Match extension for loading vimscript files if filepath and filepath:match(".+%.vim") then @@ -117,36 +121,62 @@ M.load = function(name) end end ---- Autocmds --- - -local group = vim.api.nvim_create_augroup("ColorSchemeFix", {}) - -vim.api.nvim_create_autocmd({ "VimEnter" }, { - desc = "Start neovim with the previously loaded colorscheme", - group = group, - nested = true, - callback = function() - pcall(vim.cmd.colorscheme, vim.g.COLORSCHEME) - end, -}) - -vim.api.nvim_create_autocmd({ "ColorScheme" }, { - desc = "Save the current colorscheme as a global", - group = group, - callback = function(ev) - vim.g.COLORSCHEME = vim.g.colors_name or ev.match - M.load(vim.g.COLORSCHEME) - end, -}) - -vim.api.nvim_create_autocmd({ "ColorSchemePre" }, { - desc = "Unset global terminal color variables before changing colorscheme", - group = group, - callback = function() - for i = 0, 15 do - vim.g["terminal_color_" .. i] = nil - end - end, -}) +---Persist and restore colorscheme across sessions +---This function sets up autocommands to save the current colorscheme in a +---global variable and reload it when Neovim starts. +---@return nil +M.persist_colorscheme = function() + local group = vim.api.nvim_create_augroup("ColorScheme#Persist", { clear = true }) + vim.api.nvim_create_autocmd({ "ColorScheme" }, { + desc = "Save current colorscheme to an environment variable", + group = group, + callback = function(ev) + vim.g.COLORSCHEME = ev.match + end, + }) + vim.api.nvim_create_autocmd({ "VimEnter" }, { + desc = "Restore the saved global colorscheme on startup", + group = group, + nested = true, + callback = function() + pcall(vim.cmd.colorscheme, vim.g.COLORSCHEME or "default") + end, + }) +end + +---Enable automatic reloading of colorscheme changes +---This function sets up autocommands for reloading the colorscheme when +---the ColorScheme or VimEnter events are triggered. +---@return nil +M.hook_colorscheme_change = function() + vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { + desc = "Load custom highlight definitions from after/colors matching the active colorscheme", + group = vim.api.nvim_create_augroup("ColorScheme#AfterColors", { clear = true }), + callback = function() + M.load_after_colors(vim.g.colors_name) + end, + }) +end + +---Fix terminal color variables when changing colorscheme +---This function sets up an autocommand to unset global terminal color +---variables before a colorscheme change to prevent issues with terminal colors. +---@return nil +M.reset_terminal_colors = function() + vim.api.nvim_create_autocmd({ "ColorSchemePre" }, { + desc = "Clear terminal color variables before applying a new colorscheme", + group = vim.api.nvim_create_augroup("ColorScheme#ClearTermColros", { clear = true }), + callback = function() + for i = 0, 15 do + vim.g["terminal_color_" .. i] = nil + end + end, + }) +end + +-- Initialize autocmds +M.hook_colorscheme_change() +M.persist_colorscheme() +M.reset_terminal_colors() return M From de8b595fc01642443930d664f67d08b6cf0f1629 Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 23 Sep 2024 21:06:24 -0700 Subject: [PATCH 055/153] refactor(colors): add autocmd to clear default LSP comment highlights - Introduced `refresh_lsp_highlights` function to set default semantic highlight groups for LSP types and ensure consistency by linking them to existing highlight groups. - Added an autocmd triggered on `LspTokenUpdate` to clear all comment-associated highlights. This removes unnecessary LSP comment highlights that may interfere with styling. --- lua/config/colors.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index cbc62968..468971bf 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -174,9 +174,49 @@ M.reset_terminal_colors = function() }) end +---Sets default semantic highlight groups for LSP types and clears any comment-related +---highlights on token updates. This helps ensure consistent styling by linking LSP +---types to existing highlight groups and removing unnecessary comment highlights. +---@return nil +M.refresh_lsp_highlights = function() + -- Set defaults for semantic highlights + local links = { + ["@lsp.type.class"] = "@type", + ["@lsp.type.decorator"] = "@function", + ["@lsp.type.enum"] = "@type", + ["@lsp.type.enumMember"] = "@constant", + ["@lsp.type.function"] = "@function", + ["@lsp.type.interface"] = "@type", + ["@lsp.type.macro"] = "@macro", + ["@lsp.type.method"] = "@method", + ["@lsp.type.namespace"] = "@namespace", + ["@lsp.type.parameter"] = "@parameter", + ["@lsp.type.property"] = "@property", + ["@lsp.type.struct"] = "@structure", + ["@lsp.type.type"] = "@type", + ["@lsp.type.variable"] = "@variable", + } + for new_hlgroup, old_hlgroup in pairs(links) do + vim.api.nvim_set_hl(0, new_hlgroup, { link = old_hlgroup, default = true }) + end + + vim.api.nvim_create_autocmd("LspTokenUpdate", { + desc = "Clear all comment associated highlights when updating tokens", + group = vim.api.nvim_create_augroup("LspTokenUpdate#DisableComments", { clear = true }), + callback = function() + -- NOTE: This could cause problems with luadocs + -- Clear all lsp highlights associated with comment strings + for _, group in ipairs(vim.fn.getcompletion("@lsp.type.comment", "highlight")) do + vim.api.nvim_set_hl(0, group, {}) + end + end, + }) +end + -- Initialize autocmds M.hook_colorscheme_change() M.persist_colorscheme() +M.refresh_lsp_highlights() M.reset_terminal_colors() return M From 5853b065e47db74f4471416724b053df5231c10f Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 6 Dec 2024 00:47:17 -0800 Subject: [PATCH 056/153] fix(colors): show error message when set_hl fails Add error handling to the `set_hl` function. If applying a highlight group fails, an error message is displayed using `vim.notify`, showing the name of the group that could not be applied. --- lua/config/colors.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index 468971bf..4ae67865 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -62,7 +62,13 @@ M.set_hl = function(colors) ret = colors end for group, hl in pairs(ret) do - vim.api.nvim_set_hl(0, group, hl) + if not pcall(vim.api.nvim_set_hl, 0, group, hl) then + vim.notify( + ("Error occured applying highlight group: %s"):format(group), + vim.log.levels.ERROR, + nil + ) + end end end From 3642135bc078005e86ef1ec7a8761b0ab97cd05c Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 14:56:30 -0800 Subject: [PATCH 057/153] refactor(colors)!: remove colorscheme plugin: sakura.nvim --- lazy-lock.json | 1 - lua/plugins/colors/sakura.lua | 22 ---------------------- 2 files changed, 23 deletions(-) delete mode 100644 lua/plugins/colors/sakura.lua diff --git a/lazy-lock.json b/lazy-lock.json index 6223a55d..dbb4fc32 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -60,7 +60,6 @@ "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "5f73b24aeb94f5274c218955573153c69ce4d1ee" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, - "sakura.nvim": { "branch": "master", "commit": "2fbf430890dd9466afc41a62a809c21871d126ef" }, "satellite.nvim": { "branch": "main", "commit": "dfc2b220f4969ebc49b0f2a94ab6faae240705bd" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, "telescope.nvim": { "branch": "master", "commit": "b324469959908c1c7434eb65d80e87895e6828f7" }, diff --git a/lua/plugins/colors/sakura.lua b/lua/plugins/colors/sakura.lua deleted file mode 100644 index 02a64d72..00000000 --- a/lua/plugins/colors/sakura.lua +++ /dev/null @@ -1,22 +0,0 @@ --- Sakura.nvim | Nice color scheme for neovim --- https://github.com/numToStr/Sakura.nvim - ----@type LazyPluginSpec -return { - "numtostr/sakura.nvim", - lazy = false, - priority = 1000, - opts = { - transparent = true, - }, - init = function() - local colors = require("config.colors") - colors.set_hl_autocmd("sakura", { - NormalFloat = { link = "Normal" }, - FloatBorder = { fg = "#6e6a86" }, - CursorLineNr = { fg = "#f6c177" }, - SpecialChar = { fg = "#56b1bb" }, - String = { fg = "#cbaa73" }, - }) - end, -} From de7d90b2c602d2d4e7e53debc262778b7e42579b Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 15 Aug 2024 08:41:21 -0700 Subject: [PATCH 058/153] feat(colors): refine config for colorscheme plugin: tokyonight - Improve `DiffDelete` readability with custom fillchars - Darken `CursorLine` for enhanced text legibility - Link Telescope borders to `FloatBorder` for consistency - Define custom highlight for `Underlined` --- lua/plugins/colors/tokyonight.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lua/plugins/colors/tokyonight.lua b/lua/plugins/colors/tokyonight.lua index f3ff63d4..e9f3208d 100644 --- a/lua/plugins/colors/tokyonight.lua +++ b/lua/plugins/colors/tokyonight.lua @@ -28,17 +28,22 @@ return { ---You can override specific highlights to use other groups or a hex color ---function will be called with a Highlights and ColorScheme table ---@param hl tokyonight.Highlights - ---@param _c ColorScheme - on_highlights = function(hl, _c) + ---@param c ColorScheme + on_highlights = function(hl, c) + hl.CursorLine = { bg = "#1b1e2b" } hl.NormalFloat = { link = "Normal" } - hl.WinSeparator = { fg = "#39394e" } + hl.Underlined = { fg = c.blue, underline = true } hl.VertSplit = { link = "WinSeparator" } + hl.WinSeparator = { fg = "#39394e" } + + -- Diff + hl.DiffDelete = { fg = c.git.delete, bg = c.bg_highlight } -- Telescope hl.TelescopeSelection = { link = "PmenuSel" } - hl.TelescopePreviewBorder = { link = "WinSeparator" } - hl.TelescopePromptBorder = { link = "WinSeparator" } - hl.TelescopeResultsBorder = { link = "WinSeparator" } + hl.TelescopePreviewBorder = { link = "FloatBorder" } + hl.TelescopePromptBorder = { link = "FloatBorder" } + hl.TelescopeResultsBorder = { link = "FloatBorder" } -- Treesitter hl.TreesitterContext = { bg = "none" } From 5401a0eb122faa93e7a652d75544e616db1ef108 Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 23 Sep 2024 20:00:17 -0700 Subject: [PATCH 059/153] feat(colors): refine config for colorscheme plugin: gruvbox - Add LuaDoc for module type hints - Include type hints for gruvbox options table - Change contrast setting from 'hard' to 'soft' - Alphabetize options and highlight definitions - Disable emphasis italics for better readability - Darken `CursorLine` and `Visual` highlights - Link float borders to `GruvboxGray` - Enhance diff highlights for improved readability - Link Treesitter URLs to `Underlined` - Apply `Normal` for DAP UI transparency - Set custom highlight for LSP hover references - Link `NormalFloat` to `Normal` for transparency --- lua/plugins/colors/gruvbox.lua | 68 +++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/lua/plugins/colors/gruvbox.lua b/lua/plugins/colors/gruvbox.lua index b583f863..776b4ef9 100644 --- a/lua/plugins/colors/gruvbox.lua +++ b/lua/plugins/colors/gruvbox.lua @@ -1,34 +1,92 @@ -- Lua port of the most famous vim colorscheme -- https://github.com/ellisonleao/gruvbox.nvim +---@module "gruvbox" + +local terminal = { + "#32302f", + "#cc241d", + "#98971a", + "#d79921", + "#458588", + "#b16286", + "#689d6a", + "#a89984", + "#453e37", + "#fb4934", + "#b8bb26", + "#fabd2f", + "#83a598", + "#d3869b", + "#8ec07c", + "#ebdbb2", +} ---@type LazyPluginSpec return { "ellisonleao/gruvbox.nvim", lazy = false, priority = 1000, + ---@type GruvboxConfig opts = { - contrast = "hard", -- can be "hard", "soft" or empty string + contrast = "soft", -- can be "hard", "soft" or empty string + bold = false, inverse = false, -- invert background for search, diffs, statusline and errors transparent_mode = true, - bold = false, italic = { comments = false, + emphasis = false, folds = false, operators = false, strings = false, }, palette_overrides = {}, overrides = { - -- General + CursorLine = { bg = "#262322" }, CursorLineNr = { bg = "none" }, ErrorMsg = { link = "Error" }, - FloatBorder = { bg = "none", fg = "#756a60" }, + FloatBorder = { link = "GruvboxGray" }, MsgSeparator = { link = "VertSplit" }, + NormalFloat = { link = "Normal" }, + StatusLine = { bg = "#282828" }, + Visual = { bg = "#47403a" }, + WinBar = { bg = "none" }, + WinBarNC = { bg = "none" }, + + -- Diff + DiffAdd = { ctermfg = 142, ctermbg = 235, fg = "none", bg = "#2c2c07" }, + DiffChange = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#2a3531" }, + DiffDelete = { ctermfg = 203, ctermbg = 235, fg = "#ae3224", bg = "#47140e" }, + DiffText = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#3a4844" }, + + -- Neogit + NeogitDiffAdd = { fg = "#8fa35c", bg = "#2c2c07" }, + + -- Treesitter + ["@string.special.url"] = { link = "Underlined" }, + + -- LSP + LspReferenceWrite = { fg = "#fe8019", bg = "#3c3836" }, -- Telescope TelescopeBorder = { link = "FloatBorder" }, - TelescopePromptBorder = { link = "FloatBorder" }, TelescopePreviewBorder = { link = "FloatBorder" }, + TelescopePromptBorder = { link = "FloatBorder" }, + TelescopeResultsBorder = { link = "FloatBorder" }, + TelescopeSelection = { bg = "#3c3836", fg = "#fe8019" }, + + -- Dap + DapUINormal = { link = "Normal" }, + DapUINormalNC = { link = "Normal" }, }, }, + init = function() + require("config.colors").set_hl_autocmd("gruvbox", function(_hl) + if vim.o.background == "dark" then + -- Apply terminal color overrides + for i, color in ipairs(terminal) do + vim.g["terminal_color_" .. i - 1] = color + end + end + end) + end, } From afecab18461bb625b7b7cac5ff683b0d9fb66f5b Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 24 Aug 2024 07:41:24 -0700 Subject: [PATCH 060/153] feat(colors): refine config for colorscheme plugin: vscode - Add LuaDoc for module type hints - Alphabetize options and highlight definitions - Remove color override for folded regions - Set `fg` color and underline for Treesitter matched URL comments - Highlight LSP Lua default library patterns (e.g., `require`, `table`) - Update Dashboard.nvim "key" section with a darker gray - Customize Telescope prompt and caret icon colors - Link null-ls info buffer border to `FloatBorder` - Improve diff highlights for better readability - Ensure Git highlights align with theme colors - Link `Title` to `Special` for Telescope buffer titles - Use ANSI color names for applicable highlights - Link relevant highlights to `WinSeparator` instead of `VertSplit` - Clear statusline and tabline backgrounds to prevent lualine flashing - Add autocmd to adjust terminal colors (e.g., brighten gray) - Define custom highlights for Neogit status buffer - Set `WinSeparator` highlight group --- lua/plugins/colors/vscode.lua | 102 +++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 15 deletions(-) diff --git a/lua/plugins/colors/vscode.lua b/lua/plugins/colors/vscode.lua index d3588be4..5f5b00c3 100644 --- a/lua/plugins/colors/vscode.lua +++ b/lua/plugins/colors/vscode.lua @@ -1,5 +1,25 @@ -- Neovim/Vim color scheme inspired by Dark+ and Light+ -- https://github.com/Mofiqul/vscode.nvim +---@module "vscode" + +local terminal = { + "#000000", + "#CD3131", + "#0DBC79", + "#E5E510", + "#2472C8", + "#BC3FBC", + "#11A8CD", + "#E5E5E5", + "#484848", + "#F14C4C", + "#23D18B", + "#F5F543", + "#3B8EEA", + "#D670D6", + "#29B8DB", + "#E5E5E5", +} ---@type LazyPluginSpec return { @@ -15,23 +35,33 @@ return { disable_nvimtree_bg = true, color_overrides = {}, group_overrides = { - -- General - NormalFloat = { link = "Normal" }, - FloatBorder = { fg = "#5A5A5A", bg = "none" }, - ColorColumn = { bg = "#0f0f0f" }, + ColorColumn = { bg = "Grey7" }, CurSearch = { link = "IncSearch" }, - CursorLine = { bg = "Gray8" }, + CursorLine = { bg = "Grey12" }, CursorLineNr = { link = "Number" }, - EndOfBuffer = { fg = "#222222" }, - MsgSeparator = { link = "VertSplit" }, + EndOfBuffer = { fg = "Grey1" }, + FloatBorder = { fg = "Grey35", bg = "none" }, + MsgSeparator = { link = "WinSeparator" }, + NormalFloat = { link = "Normal" }, SpecialChar = { fg = c.vscBlue }, + StatusLine = { bg = "none" }, + Tabline = { bg = "none" }, + TablineFill = { bg = "none" }, + Title = { link = "Special" }, + WarningMsg = { fg = c.vscYellowOrange, bold = true }, - -- Git status - DiffAdd = { bg = "#212D19", fg = "none" }, - DiffChange = { bg = "#3B3814", fg = "none" }, - DiffDelete = { bg = "none", fg = "indianred" }, + -- Git + Added = { fg = c.vscGitAdded }, + Changed = { fg = c.vscDiffRedDark }, + Removed = { fg = c.vscRed }, - -- Diagnostic + -- Diff + DiffAdd = { bg = "#242b16" }, + DiffChange = { bg = "#181818" }, + DiffDelete = { bg = c.vscDiffRedDark, fg = c.vscGitDeleted }, + DiffText = { bg = "#42401f" }, + + -- Diagnostics DiagnosticVirtualTextError = { bg = c.vscBack, fg = c.vscRed }, DiagnosticVirtualTextWarn = { bg = c.vscBack, fg = c.vscYellow }, DiagnosticVirtualTextInfo = { bg = c.vscBack, fg = c.vscBlue }, @@ -42,7 +72,18 @@ return { LspFloatWinNormal = { link = "NormalFloat" }, LspInfoBorder = { link = "FloatBorder" }, - -- Treesitter Rainbow | Treesitter/Indent-Blankline + ["@lsp.mod.defaultLibrary.lua"] = { link = "@namespace" }, + + -- Null-LS + NullLsInfoBorder = { link = "FloatBorder" }, + + -- DAP + NvimDapVirtualText = { link = "LspCodeLens" }, + + -- Treesitter + ["@string.special.url"] = { fg = c.vscBlue }, + + -- Rainbow Delimiters RainbowDelimiterBlue = { fg = c.vscBlue, nocombine = true }, RainbowDelimiterCyan = { fg = c.vscBlueGreen, nocombine = true }, RainbowDelimiterGreen = { fg = c.vscGreen, nocombine = true }, @@ -52,9 +93,40 @@ return { RainbowDelimiterViolet = { fg = c.vscViolet, nocombine = true }, RainbowDelimiterYellow = { fg = c.vscYellow, nocombine = true }, - -- Whichkey - WhichKeyFloat = { link = "StatusLineNC" }, + -- Dashboard + DashboardKey = { fg = c.vscGray }, + + -- Telescope + TelescopePromptPrefix = { fg = c.vscBlue }, + TelescopeSelectionCaret = { bg = c.vscUiBlue, fg = c.vscYellow }, + + -- Neogit + NeogitBranch = { fg = c.vscYellow }, + NeogitCommitViewHeader = { fg = c.vscBlue }, + NeogitDiffAdditions = { fg = c.vscGitAdded }, + NeogitObjectId = { fg = c.vscBlueGreen }, + NeogitStash = { fg = c.vscViolet }, + + -- Hop + HopCursor = { link = "Cursor" }, + HopNextKey = { fg = c.vscRed, bold = true }, + HopNextKey1 = { fg = c.vscBlue, bold = true }, + HopNextKey2 = { fg = c.vscBlueGreen, bold = true }, + HopPreview = { link = "IncSearch" }, + HopUnmatched = { fg = c.vscGray }, }, } end, + init = function() + vim.api.nvim_create_autocmd("ColorScheme", { + desc = "Replace terminal colors for colorscheme: vscode", + group = vim.api.nvim_create_augroup("ColorScheme#VscodeTerminal", { clear = true }), + pattern = "vscode", + callback = function() + for i, color in ipairs(terminal) do + vim.g["terminal_color_" .. i - 1] = color + end + end, + }) + end, } From 53ba9dcb3a10af8620d235464c7ddbabd330d7aa Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 14:55:15 -0800 Subject: [PATCH 061/153] feat(colors): add colorscheme plugin: rose-pine --- lazy-lock.json | 1 + lua/plugins/colors/rose-pine.lua | 89 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 lua/plugins/colors/rose-pine.lua diff --git a/lazy-lock.json b/lazy-lock.json index dbb4fc32..3fdae9c7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -59,6 +59,7 @@ "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "5f73b24aeb94f5274c218955573153c69ce4d1ee" }, + "rose-pine": { "branch": "main", "commit": "e4b08d74b7272cb21e4e9c71b8b9e0830fd722fe" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "satellite.nvim": { "branch": "main", "commit": "dfc2b220f4969ebc49b0f2a94ab6faae240705bd" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, diff --git a/lua/plugins/colors/rose-pine.lua b/lua/plugins/colors/rose-pine.lua new file mode 100644 index 00000000..31c54c44 --- /dev/null +++ b/lua/plugins/colors/rose-pine.lua @@ -0,0 +1,89 @@ +-- rose-pine | All natural pine, faux fur and a bit of soho vibes for the classy minimalist. +-- https://github.com/rose-pine/neovim +---@module "rose-pine" + +---@type LazyPluginSpec +return { + "rose-pine/neovim", + name = "rose-pine", + lazy = false, + priority = 1000, + opts = { + variant = "auto", -- auto, main, moon, or dawn + dark_variant = "main", -- main, moon, or dawn + dim_inactive_windows = false, + extend_background_behind_borders = true, + enable = { + terminal = true, + legacy_highlights = true, -- Improve compatibility for previous versions of Neovim + migrations = true, -- Handle deprecated options automatically + }, + styles = { + bold = false, + italic = false, + transparency = true, + }, + groups = { + border = "highlight_med", + link = "iris", + panel = "surface", + + error = "love", + hint = "iris", + info = "foam", + note = "pine", + todo = "rose", + warn = "gold", + + git_add = "foam", + git_change = "gold", + git_delete = "love", + git_dirty = "rose", + git_ignore = "muted", + git_merge = "iris", + git_rename = "pine", + git_stage = "iris", + git_text = "rose", + git_untracked = "subtle", + + h1 = "iris", + h2 = "foam", + h3 = "rose", + h4 = "gold", + h5 = "pine", + h6 = "foam", + }, + ---@type table + highlight_groups = { + CursorLineNr = { fg = "gold" }, + LineNr = { fg = "highlight_med" }, + MatchParen = { bg = "subtle" }, + Pmenu = { bg = "surface" }, + Underlined = { fg = "iris", underline = true }, + WinBar = { bg = "none" }, + WinBarNC = { bg = "none" }, + + -- Diff + DiffAdd = { bg = "#2a383a", inherit = false }, + DiffChange = { bg = "#4a3824", inherit = false }, + DiffDelete = { bg = "#381a22", fg = "love", inherit = false }, + DiffText = { bg = "#2e395c", inherit = false }, + + -- Neogit + NeogitDiffAdd = { link = "DiffAdd" }, + NeogitDiffChange = { link = "DiffChange" }, + NeogitDiffDelete = { link = "DiffDelete" }, + NeogitDiffText = { link = "DiffText" }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { fg = "foam", nocombine = true }, + RainbowDelimiterCyan = { fg = "foam", nocombine = true }, + RainbowDelimiterGreen = { fg = "iris", nocombine = true }, + RainbowDelimiterOrange = { fg = "gold", nocombine = true }, + RainbowDelimiterPink = { fg = "rose", nocombine = true }, + RainbowDelimiterRed = { fg = "rose", nocombine = true }, + RainbowDelimiterViolet = { fg = "iris", nocombine = true }, + RainbowDelimiterYellow = { fg = "gold", nocombine = true }, + }, + }, +} From c0334510097dedd9cf41d371397c519448d12a73 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 09:49:39 -0700 Subject: [PATCH 062/153] feat(colors): add colorscheme plugin: kanagawa --- lazy-lock.json | 11 +++--- lua/plugins/colors/kanagawa.lua | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 lua/plugins/colors/kanagawa.lua diff --git a/lazy-lock.json b/lazy-lock.json index 3fdae9c7..1d5be455 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -18,11 +18,12 @@ "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, - "hex.nvim": { "branch": "master", "commit": "d0f553dcd2c08d226026d769119b2eb6b09b8dfd" }, - "hop.nvim": { "branch": "master", "commit": "8f51ef02700bb3cdcce94e92eff16170a6343c4f" }, - "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, - "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, - "lazydev.nvim": { "branch": "main", "commit": "491452cf1ca6f029e90ad0d0368848fac717c6d2" }, + "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, + "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, + "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "kanagawa.nvim": { "branch": "master", "commit": "bfa818c7bf6259152f1d89cf9fbfba3554c93695" }, + "lazy.nvim": { "branch": "main", "commit": "8f6225751138329da339eb6554d40158768d23ff" }, + "lazydev.nvim": { "branch": "main", "commit": "02f1055a777264d4b65896051ec28d0f322f7932" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, diff --git a/lua/plugins/colors/kanagawa.lua b/lua/plugins/colors/kanagawa.lua new file mode 100644 index 00000000..a6046dbb --- /dev/null +++ b/lua/plugins/colors/kanagawa.lua @@ -0,0 +1,70 @@ +-- kanagawa.nvim | dark colorscheme inspired by famous painting of Katsushika Hokusai +-- https://github.com/rebelot/kanagawa.nvim +---@module "kanagawa" + +---@type LazyPluginSpec +return { + "rebelot/kanagawa.nvim", + lazy = false, + priority = 1000, + ---@type KanagawaConfig + opts = { + transparent = true, + commentStyle = { italic = false }, + keywordStyle = { italic = false }, + colors = { + theme = { + all = { + ui = { + -- Remove the background of LineNr, {Sign,Fold}Column and friends! + -- Only applies when transparent is enabled. + bg_gutter = "none", + }, + }, + }, + }, + -- Add/Modify highlights + overrides = function(colors) + local theme = colors.theme + return { + CursorLine = { bg = theme.ui.bg_dim }, + FloatBorder = { bg = "none" }, + MsgSeparator = { link = "WinSeparator" }, + NormalFloat = { bg = "none" }, + Title = { bg = "none", fg = theme.syn.special1, bold = true }, + WinSeparator = { fg = theme.ui.bg_p1, bg = "none" }, + + -- Search + CurSearch = { bg = theme.ui.bg_search, fg = "black", bold = true }, + IncSearch = { bg = theme.diag.warning, fg = "black", bold = true }, + Search = { bg = theme.ui.bg_search, fg = "black" }, + + -- Pmenu + Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1, blend = vim.o.pumblend }, + PmenuSbar = { bg = theme.ui.bg_m1 }, + PmenuSel = { fg = "none", bg = theme.ui.bg_p2 }, + PmenuThumb = { bg = theme.ui.bg_p2 }, + + -- Treesitter + ["@string.special.url.comment"] = { fg = colors.palette.springBlue, underline = true }, + + -- Rainbow Delimiters + RainbowDelimiterBlue = { fg = colors.palette.springBlue, nocombine = true }, + RainbowDelimiterCyan = { fg = colors.palette.waveAqua1, nocombine = true }, + RainbowDelimiterGreen = { fg = colors.palette.springGreen, nocombine = true }, + RainbowDelimiterOrange = { fg = colors.palette.surimiOrange, nocombine = true }, + RainbowDelimiterPink = { fg = colors.palette.sakuraPink, nocombine = true }, + RainbowDelimiterRed = { fg = colors.palette.peachRed, nocombine = true }, + RainbowDelimiterViolet = { fg = colors.palette.oniViolet, nocombine = true }, + RainbowDelimiterYellow = { fg = colors.palette.carpYellow, nocombine = true }, + + -- Telescope + TelescopeBorder = { ctermbg = "none", ctermfg = 240, bg = "none", fg = theme.ui.bg_p2 }, + TelescopeTitle = { link = "Title" }, + + -- WhichKey + WhichkeyTitle = { link = "Title" }, + } + end, + }, +} From cdc4d33915e95b3158d281005e00f65d3403fc76 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 09:48:39 -0700 Subject: [PATCH 063/153] feat(colors): add colorscheme plugin: material --- lazy-lock.json | 1 + lua/plugins/colors/material.lua | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 lua/plugins/colors/material.lua diff --git a/lazy-lock.json b/lazy-lock.json index 1d5be455..249d260d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -33,6 +33,7 @@ "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "material.nvim": { "branch": "main", "commit": "ba56aeea3db29c8c9ffd55158aed7b2e6a749a46" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, "neogit": { "branch": "master", "commit": "9959b58a897036ce89d47385021db1f716613399" }, "none-ls-extras.nvim": { "branch": "main", "commit": "ebb09961f1c0a377f9ed1685740cdf87b5cd39a8" }, diff --git a/lua/plugins/colors/material.lua b/lua/plugins/colors/material.lua new file mode 100644 index 00000000..88d23500 --- /dev/null +++ b/lua/plugins/colors/material.lua @@ -0,0 +1,69 @@ +-- material.nvim | Material colorscheme for NeoVim written in Lua +-- https://github.com/marko-cerovac/material.nvim +---@module "material + +---@type LazyPluginSpec +return { + "marko-cerovac/material.nvim", + lazy = false, + priority = 1000, + init = function() + vim.g.material_style = "darker" + end, + opts = function() + local c = require("material.colors") + return { + lualine_style = "stealth", + high_visibility = { + darker = false, + lighter = true, + }, + disable = { + background = true, + }, + plugins = { + "dap", + "dashboard", + "gitsigns", + "hop", + "indent-blankline", + "neogit", + "nvim-cmp", + "nvim-navic", + "nvim-tree", + "nvim-web-devicons", + "telescope", + "trouble", + "which-key", + }, + -- Overwrite default colors with your own + custom_colors = {}, + -- Overwrite highlights with your own + custom_highlights = { + CursorLine = { bg = "Grey15" }, + MsgSeparator = { link = "WinSeparator" }, + + -- Diff + DiffAdd = { bg = "#2c351e" }, + DiffChange = { bg = "#1a2438" }, + DiffDelete = { fg = c.git.removed, bg = "#5c272b" }, + DiffText = { bg = "#263553" }, + + -- Neogit + NeogitDiffAdd = { fg = c.git.added, bg = "#2c351e" }, + NeogitDiffChange = { fg = c.git.modified, bg = "#1a2438" }, + NeogitDiffDelete = { fg = c.git.removed, bg = "#5c272b" }, + NeogitDiffText = { bg = "#263553" }, + + -- Treesitter + TSField = { link = "TSVariable" }, + ["@property"] = { link = "Identifier" }, + ["@string.special.url.comment"] = { fg = c.editor.link, underline = true }, + + -- WhichKey + WhichKeyFloat = { link = "StatusLineNC" }, + WhichKeySeparator = { link = "WinSeparator" }, + }, + } + end, +} From bf557820b0e682bc3bc4a6f421a1398539b8c4a7 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 09:47:40 -0700 Subject: [PATCH 064/153] feat(colors): add colorscheme plugin: moonfly --- lazy-lock.json | 5 +- lua/plugins/colors/moonify.lua | 92 ++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 lua/plugins/colors/moonify.lua diff --git a/lazy-lock.json b/lazy-lock.json index 249d260d..73af36cf 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -35,8 +35,9 @@ "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "material.nvim": { "branch": "main", "commit": "ba56aeea3db29c8c9ffd55158aed7b2e6a749a46" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "neogit": { "branch": "master", "commit": "9959b58a897036ce89d47385021db1f716613399" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "ebb09961f1c0a377f9ed1685740cdf87b5cd39a8" }, + "moonfly": { "branch": "master", "commit": "339fbb83a1bf2fb77305b20c37686b3224adfb8f" }, + "neogit": { "branch": "master", "commit": "af1d8d88f426a4da63c913f3b81a37350dbe8d02" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, diff --git a/lua/plugins/colors/moonify.lua b/lua/plugins/colors/moonify.lua new file mode 100644 index 00000000..1018f37b --- /dev/null +++ b/lua/plugins/colors/moonify.lua @@ -0,0 +1,92 @@ +-- vim-moonfly-colors | A dark charcoal theme for modern Neovim & classic Vim +-- https://github.com/bluz71/vim-moonfly-colors + +local terminal = { + "#141414", + "#ff5454", + "#8cc85f", + "#e3c78a", + "#80a0ff", + "#cf87e8", + "#79dac8", + "#c6c6c6", + "#474747", + "#ff5189", + "#36c692", + "#c6c684", + "#74b2ff", + "#ae81ff", + "#85dc85", + "#e4e4e4", +} + +---@type LazyPluginSpec +return { + "bluz71/vim-moonfly-colors", + name = "moonfly", + lazy = false, + priority = 1000, + config = function() + vim.g.moonflyCursorColor = true + vim.g.moonflyItalics = false + vim.g.moonflyNormalFloat = true + vim.g.moonflyTransparent = true + vim.g.moonflyUnderlineMatchParen = true + vim.g.moonflyVirtualTextColor = true + vim.g.moonflyWinSeparator = 2 + + local palette = require("moonfly").palette + local colors = require("config.colors") + colors.set_hl_autocmd("moonfly", { + -- General + CursorLineNr = { fg = palette.blue, bold = true }, + FloatBorder = { link = "MoonflyGrey39" }, + Folded = { fg = "Grey50", bg = "Grey19" }, + MsgSeparator = { link = "WinSeparator" }, + VertSplit = { link = "WinSeparator" }, + Visual = { bg = palette.bay }, + WinBar = { bg = "none" }, + WinBarNC = { bg = "none" }, + WinSeparator = { link = "MoonflyGrey27" }, + + -- Diff + DiffAdd = { bg = "#2d3e38" }, + DiffChange = { bg = "#2e2e2e" }, + DiffDelete = { bg = "#542b2b", fg = "#b23a3a" }, + DiffText = { bg = "#313b5a" }, + + -- Neogit + NeogitDiffAdd = { link = "DiffAdd" }, + NeogitDiffChange = { link = "DiffChange" }, + NeogitDiffDelete = { link = "DiffDelete" }, + NeogitDiffText = { link = "DiffText" }, + + -- Treesitter + TreesitterContextBottom = {}, + + -- Treesitter Rainbow + RainbowDelimiterBlue = { link = "MoonflyBlue" }, + RainbowDelimiterCyan = { link = "MoonflySky" }, + RainbowDelimiterGreen = { link = "MoonflyGreen" }, + RainbowDelimiterOrange = { link = "MoonflyOrange" }, + RainbowDelimiterRed = { link = "MoonflyRed" }, + RainbowDelimiterViolet = { link = "MoonflyViolet" }, + RainbowDelimiterYellow = { link = "MoonflyYellow" }, + + -- Telescope + TelescopeTitle = { link = "Title", bold = true }, + }) + end, + init = function() + vim.api.nvim_create_autocmd("ColorScheme", { + desc = "Replace terminal colors for colorscheme: moonfly", + group = vim.api.nvim_create_augroup("ColorScheme#MoonflyTerminal", { clear = true }), + pattern = "moonfly", + callback = function() + for i, color in ipairs(terminal) do + vim.g["terminal_color_" .. i - 1] = color + end + end, + }) + end, +} From 61c1aec5db860932f99842615b51b125e3fc12c8 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 1 Aug 2024 09:45:27 -0700 Subject: [PATCH 065/153] feat(colors): add colorscheme plugin: ayu fix(colors): refactor ayu overrides to resolve highlight bugs Refactored the `opts.overrides` table into a callback function for the ayu theme. This change moves the overrides logic from the plugin spec scope to the plugin setup scope, allowing the palette and highlights to be correctly updated on theme load. This fixes issues with highlight groups when switching between theme variants. Additionally, a check was added to remove the `Normal` group definition when `vim.o.background` is set to "light", preserving the background color for the ayu-light variant and preventing unwanted transparency. --- lazy-lock.json | 5 +-- lua/plugins/colors/ayu.lua | 65 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 lua/plugins/colors/ayu.lua diff --git a/lazy-lock.json b/lazy-lock.json index 73af36cf..c6883146 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,8 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "auto-session": { "branch": "main", "commit": "0caedb838e3cace2eaf52696ec7c8b6000f9ee30" }, + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, + "auto-session": { "branch": "main", "commit": "08c279882d4117a3e6ade1a014f7cf4af7c34fec" }, + "ayu": { "branch": "master", "commit": "0a9804db5c08dba63be9774a57e4214fd0473ce1" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, diff --git a/lua/plugins/colors/ayu.lua b/lua/plugins/colors/ayu.lua new file mode 100644 index 00000000..896e5420 --- /dev/null +++ b/lua/plugins/colors/ayu.lua @@ -0,0 +1,65 @@ +-- neovim-ayu | Ayu theme for Neovim +-- https://github.com/Shatur/neovim-ayu +---@module "ayu" + +---@type LazyPluginSpec +return { + "Shatur/neovim-ayu", + name = "ayu", + lazy = false, + priority = 1000, + opts = { + overrides = function() + local c = require("ayu.colors") + local overrides = { + -- General + Comment = { fg = c.comment }, + CursorLineNr = { fg = c.accent }, + Error = { fg = c.error }, + FloatBorder = { fg = "#394050" }, + FoldColumn = { fg = c.fg_idle }, + Folded = { fg = c.fg_idle, bg = "#2a2a2a" }, + IncSearch = { fg = c.bg, bg = c.special }, + LineNr = { fg = c.fg_idle }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { fg = c.guide_active }, + Normal = { bg = "none" }, + NormalFloat = { link = "Normal" }, + PmenuSel = { bg = c.selection_inactive }, + SignColumn = { bg = "none" }, + Underlined = { fg = c.accent, underline = true }, + Visual = { bg = c.selection_bg }, + WinBar = { link = "Normal" }, + WinBarNC = { link = "Normal" }, + WinSeparator = { fg = c.guide_normal }, + + -- Diff + DiffDelete = { fg = c.vcs_removed, bg = "#321619" }, + + -- LSP + ["@lsp.mod.global.lua"] = { fg = c.markup }, + + -- Treesitter Rainbow + RainbowDelimiterBlue = { fg = c.vcs_modified }, + RainbowDelimiterCyan = { fg = c.regexp }, + RainbowDelimiterGreen = { fg = c.vcs_added }, + RainbowDelimiterOrange = { fg = c.operator }, + RainbowDelimiterRed = { fg = c.vcs_removed }, + RainbowDelimiterViolet = { fg = c.lsp_parameter }, + RainbowDelimiterYellow = { fg = c.special }, + } + + -- Conditionally override colors for `h background + if vim.o.background == "light" then + overrides.DiffDelete = { fg = c.vcs_removed, bg = "#ebecec" } + overrides.Folded = { fg = c.fg_idle, bg = "#c2c2c2" } + overrides.Normal = nil + else + vim.g.terminal_color_8 = "#394050" + vim.g.terminal_color_15 = "#fffcf2" + end + + return overrides + end, + }, +} From ec9f08d1d87f94aad12c0d2ae51b0e4cba960cce Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 23 Sep 2024 23:59:57 -0700 Subject: [PATCH 066/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 100 ++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index c6883146..f9371944 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,8 +1,8 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "auto-session": { "branch": "main", "commit": "08c279882d4117a3e6ade1a014f7cf4af7c34fec" }, - "ayu": { "branch": "master", "commit": "0a9804db5c08dba63be9774a57e4214fd0473ce1" }, + "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, + "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, + "ayu": { "branch": "master", "commit": "2839c88cd297a069e93df1aab542c087e8f6e8c0" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -10,73 +10,73 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, - "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, - "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, - "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" }, "guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" }, - "hex.nvim": { "branch": "master", "commit": "cbffd2ce4b8be089360e3c95d5909cd511d8840c" }, - "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, - "kanagawa.nvim": { "branch": "master", "commit": "bfa818c7bf6259152f1d89cf9fbfba3554c93695" }, - "lazy.nvim": { "branch": "main", "commit": "8f6225751138329da339eb6554d40158768d23ff" }, - "lazydev.nvim": { "branch": "main", "commit": "02f1055a777264d4b65896051ec28d0f322f7932" }, + "hex.nvim": { "branch": "master", "commit": "fcff75fcf43b5a6c5b471eed65b3a06c412d6020" }, + "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, + "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, + "kanagawa.nvim": { "branch": "master", "commit": "ad3dddecd606746374ba4807324a08331dfca23c" }, + "lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" }, + "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, - "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, - "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "material.nvim": { "branch": "main", "commit": "ba56aeea3db29c8c9ffd55158aed7b2e6a749a46" }, + "material.nvim": { "branch": "main", "commit": "31429eef4b7233ebdae3ddb57b7165ee4f1bd653" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "moonfly": { "branch": "master", "commit": "339fbb83a1bf2fb77305b20c37686b3224adfb8f" }, - "neogit": { "branch": "master", "commit": "af1d8d88f426a4da63c913f3b81a37350dbe8d02" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, + "moonfly": { "branch": "master", "commit": "49701afd56b6ad7877dd20a192016f74f518e291" }, + "neogit": { "branch": "master", "commit": "a38945a585794c716b2ff9b25668bb5c089e8cd7" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "f50d4dece9f91813f049f8100d188933f7d654d9" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, - "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, - "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, - "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" }, - "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, - "nvim-jdtls": { "branch": "master", "commit": "99e4b2081de1d9162666cc7b563cbeb01c26b66b" }, - "nvim-lspconfig": { "branch": "master", "commit": "efbfce341c9f546ca2a155a9316886fc1b80eace" }, + "none-ls.nvim": { "branch": "main", "commit": "58866c670d68ef80397c317a3a1ee5f53ca646fd" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-dap": { "branch": "master", "commit": "580d6e526358afd0e4bba053e68fd59cf581a161" }, + "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, + "nvim-highlight-colors": { "branch": "main", "commit": "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e" }, + "nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" }, + "nvim-lspconfig": { "branch": "master", "commit": "47f236c058f0511702286a21ba53bbf42abbd8a8" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "621f5901f0b3e762cc4c5ed0f9246cf1495193ad" }, - "nvim-treesitter-context": { "branch": "master", "commit": "3d5390c49e3f8fe457b376df2a49aa39d75b7911" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, - "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, - "oil.nvim": { "branch": "master", "commit": "1360be5fda9c67338331abfcd80de2afbb395bcd" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "0f0d5bc67786c36edc2cb6fb5faa5c09dd1a6e10" }, + "nvim-treesitter": { "branch": "master", "commit": "894cb3cebbad0535fb4e319ada5d875dbc48d8b9" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b9e30333ece125297cfc5d652465cbc9a23b4916" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, + "nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" }, + "oil.nvim": { "branch": "master", "commit": "9a59256c8e88b29d2150e99b5960b2f111e51f75" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "7f47c3297eeed1364be3c6ad915b1df2beb2b2f4" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "5f73b24aeb94f5274c218955573153c69ce4d1ee" }, - "rose-pine": { "branch": "main", "commit": "e4b08d74b7272cb21e4e9c71b8b9e0830fd722fe" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "e9dfb4582b9ca0ab7e987c65999f662242bd6f61" }, + "rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, - "satellite.nvim": { "branch": "main", "commit": "dfc2b220f4969ebc49b0f2a94ab6faae240705bd" }, - "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, - "telescope.nvim": { "branch": "master", "commit": "b324469959908c1c7434eb65d80e87895e6828f7" }, + "satellite.nvim": { "branch": "main", "commit": "bce591cb5e379bd989623993c604c774633e7ed9" }, + "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight.nvim": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" }, - "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, + "toggleterm.nvim": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" }, + "tokyonight.nvim": { "branch": "main", "commit": "355e2842291dbf51b2c5878e9e37281bbef09783" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "vscode.nvim": { "branch": "main", "commit": "7de58b7a6d55fe48475d0ba2fddbcec871717761" }, - "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }, + "vscode.nvim": { "branch": "main", "commit": "18097b7aa47538afa780c821309c8b992972d726" }, + "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, - "zk-nvim": { "branch": "main", "commit": "8942fcc7ba2477e3e0d8097c806eec41cd844fd1" } + "zk-nvim": { "branch": "main", "commit": "42dc341d897ac4da3d4a9c5c506a36153473f021" } } From 3344d4b6a6f241ecce858bd9157c31bfbb705c67 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 4 Oct 2024 10:20:38 -0700 Subject: [PATCH 067/153] chore: update spell dictionary --- spell/en.utf-8.add | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 38a00d2a..5e18b23f 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -20,6 +20,7 @@ BufWritePost BufWritePre Bufferline BusyBox +CIELAB COLORTERM CSharp CapsLock @@ -54,6 +55,7 @@ GIFs GTK2 Gdiffsplit HKEY_CURRENT_USER +HSV IIFE IOError IPython @@ -964,6 +966,7 @@ localleader localoptions localstate lockfile +lockfiles lockscreen loclist loglevel @@ -1114,6 +1117,7 @@ neorg neoterm neovide neovim +neovim's nerdfix nerdfont nerdfonts @@ -1137,6 +1141,7 @@ nodesource nodex nofile nohlsearch +noice noinsert nologo nomodifiable @@ -1227,6 +1232,7 @@ pbm pc pcall pdm +peachpuff perf performant perl @@ -1401,6 +1407,7 @@ rg rgb rgb32 rgba +rglob rhs ripgrep rmd @@ -1451,6 +1458,7 @@ seekranges sel selene serverless +sesh sessionizer setattr setenv @@ -1501,6 +1509,7 @@ smartindent smarttab snapd softrepeat +soho sonarr source sourceforge @@ -1655,6 +1664,7 @@ tohtml tokyonight toml tonumber +toolchain topbar topdelete topdown @@ -1745,6 +1755,7 @@ uv v0 v2 vala +valheim vbs vbscript vcodec From 41be1f555fb9865d967cad2a4686c4745955348d Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 14 Nov 2024 16:47:12 -0800 Subject: [PATCH 068/153] build(make): use neovim logo colors for banner art Colors more closely resemble the ones used in neovim's logo. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fbd037dc..533f28a7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAKEFLAGS += --no-print-directory -BANNER = \n \e[38;5;21m███\e[38;5;239m╗ \e[38;5;21m██\e[38;5;239m╗\e[38;5;21m███████\e[38;5;239m╗ \e[38;5;21m██████\e[38;5;239m╗ \e[38;5;46m██\e[38;5;239m╗ \e[38;5;46m██\e[38;5;239m╗\e[38;5;46m██\e[38;5;239m╗\e[38;5;46m███\e[38;5;239m╗ \e[38;5;46m███\e[38;5;239m╗\n \e[38;5;20m████\e[38;5;238m╗ \e[38;5;20m██\e[38;5;238m║\e[38;5;20m██\e[38;5;238m╔════╝\e[38;5;20m██\e[38;5;238m╔═══\e[38;5;20m██\e[38;5;238m╗\e[38;5;40m██\e[38;5;238m║ \e[38;5;40m██\e[38;5;238m║\e[38;5;40m██\e[38;5;238m║\e[38;5;40m████\e[38;5;238m╗ \e[38;5;40m████\e[38;5;238m║\n \e[38;5;19m██\e[38;5;237m╔\e[38;5;19m██\e[38;5;237m╗ \e[38;5;19m██\e[38;5;237m║\e[38;5;19m█████\e[38;5;237m╗ \e[38;5;19m██\e[38;5;237m║ \e[38;5;19m██\e[38;5;237m║\e[38;5;34m██\e[38;5;237m║ \e[38;5;34m██\e[38;5;237m║\e[38;5;34m██\e[38;5;237m║\e[38;5;34m██\e[38;5;237m╔\e[38;5;34m████\e[38;5;237m╔\e[38;5;34m██\e[38;5;237m║\n \e[38;5;18m██\e[38;5;236m║╚\e[38;5;18m██\e[38;5;236m╗\e[38;5;18m██\e[38;5;236m║\e[38;5;18m██\e[38;5;236m╔══╝ \e[38;5;18m██\e[38;5;236m║ \e[38;5;18m██\e[38;5;236m║╚\e[38;5;28m██\e[38;5;236m╗ \e[38;5;28m██\e[38;5;236m╔╝\e[38;5;28m██\e[38;5;236m║\e[38;5;28m██\e[38;5;236m║╚\e[38;5;28m██\e[38;5;236m╔╝\e[38;5;28m██\e[38;5;236m║\n \e[38;5;17m██\e[38;5;235m║ ╚\e[38;5;17m████\e[38;5;235m║\e[38;5;17m███████\e[38;5;235m╗╚\e[38;5;17m██████\e[38;5;235m╔╝ ╚\e[38;5;22m████\e[38;5;235m╔╝ \e[38;5;22m██\e[38;5;235m║\e[38;5;22m██\e[38;5;235m║ ╚═╝ \e[38;5;22m██\e[38;5;235m║\n \e[38;5;234m╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝\e[0m +BANNER = \n \e[38;2;4;116;179m███\e[38;5;239m╗ \e[38;2;4;116;179m██\e[38;5;239m╗\e[38;2;4;116;179m███████\e[38;5;239m╗ \e[38;2;4;116;179m██████\e[38;5;239m╗ \e[38;2;104;161;61m██\e[38;5;239m╗ \e[38;2;104;161;61m██\e[38;5;239m╗\e[38;2;104;161;61m██\e[38;5;239m╗\e[38;2;104;161;61m███\e[38;5;239m╗ \e[38;2;104;161;61m███\e[38;5;239m╗\n \e[38;2;4;104;161m████\e[38;5;238m╗ \e[38;2;4;104;161m██\e[38;5;238m║\e[38;2;4;104;161m██\e[38;5;238m╔════╝\e[38;2;4;104;161m██\e[38;5;238m╔═══\e[38;2;4;104;161m██\e[38;5;238m╗\e[38;2;94;145;55m██\e[38;5;238m║ \e[38;2;94;145;55m██\e[38;5;238m║\e[38;2;94;145;55m██\e[38;5;238m║\e[38;2;94;145;55m████\e[38;5;238m╗ \e[38;2;94;145;55m████\e[38;5;238m║\n \e[38;2;3;93;143m██\e[38;5;237m╔\e[38;2;3;93;143m██\e[38;5;237m╗ \e[38;2;3;93;143m██\e[38;5;237m║\e[38;2;3;93;143m█████\e[38;5;237m╗ \e[38;2;3;93;143m██\e[38;5;237m║ \e[38;2;3;93;143m██\e[38;5;237m║\e[38;2;83;129;49m██\e[38;5;237m║ \e[38;2;83;129;49m██\e[38;5;237m║\e[38;2;83;129;49m██\e[38;5;237m║\e[38;2;83;129;49m██\e[38;5;237m╔\e[38;2;83;129;49m████\e[38;5;237m╔\e[38;2;83;129;49m██\e[38;5;237m║\n \e[38;2;3;81;125m██\e[38;5;236m║╚\e[38;2;3;81;125m██\e[38;5;236m╗\e[38;2;3;81;125m██\e[38;5;236m║\e[38;2;3;81;125m██\e[38;5;236m╔══╝ \e[38;2;3;81;125m██\e[38;5;236m║ \e[38;2;3;81;125m██\e[38;5;236m║╚\e[38;2;73;113;43m██\e[38;5;236m╗ \e[38;2;73;113;43m██\e[38;5;236m╔╝\e[38;2;73;113;43m██\e[38;5;236m║\e[38;2;73;113;43m██\e[38;5;236m║╚\e[38;2;73;113;43m██\e[38;5;236m╔╝\e[38;2;73;113;43m██\e[38;5;236m║\n \e[38;2;2;70;107m██\e[38;5;235m║ ╚\e[38;2;2;70;107m████\e[38;5;235m║\e[38;2;2;70;107m███████\e[38;5;235m╗╚\e[38;2;2;70;107m██████\e[38;5;235m╔╝ ╚\e[38;2;62;97;37m████\e[38;5;235m╔╝ \e[38;2;62;97;37m██\e[38;5;235m║\e[38;2;62;97;37m██\e[38;5;235m║ ╚═╝ \e[38;2;62;97;37m██\e[38;5;235m║\n \e[38;5;234m╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝\e[0m VERSION = $(shell nvim --version | head -n 1 | cut -d ' ' -f2) ROOT_DIR := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST}))) From 3f519a15f8034ddbca52c184a18b405e72472786 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 14 Nov 2024 16:48:03 -0800 Subject: [PATCH 069/153] build(make): add verbose flag to stylua format target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 533f28a7..042574eb 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ endif nvim # Launch nvim with patched xdg_dirs format: ## Run formatter: stylua - @stylua after/ lua/ init.lua + @stylua -v after/ lua/ init.lua lint: ## Run linter: selene @selene after/ lua/ init.lua From aac21f3f495bd8b8878fedc1ce0111e95cdd7148 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 6 Dec 2024 01:05:11 -0800 Subject: [PATCH 070/153] fix(gitsigns): replace deprecated function: next_hunk -> nav_hunk --- lua/plugins/gitsigns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index caf6dbcc..7b44bb66 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -50,7 +50,7 @@ return { return "]h" end vim.schedule(function() - gitsigns.next_hunk() + gitsigns.nav_hunk("next") end) return "" end, { expr = true, desc = "Next hunk" }) @@ -60,7 +60,7 @@ return { return "[h" end vim.schedule(function() - gitsigns.prev_hunk() + gitsigns.nav_hunk("prev") end) return "" end, { expr = true, desc = "Previous hunk" }) From 5eea9d5b4befdb85b4c5905be412806179986f49 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 14 Nov 2024 15:54:28 -0800 Subject: [PATCH 071/153] feat(ts): add editorconfig to ensure_installed --- lua/plugins/treesitter.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index f6eb43a4..7f27740e 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -63,6 +63,7 @@ return { "bash", "c", "comment", + "editorconfig", "gitignore", "json", "jsonc", From 3c58674005e4ba7adf60f47847504f665310d222 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 24 Sep 2024 00:01:15 -0700 Subject: [PATCH 072/153] docs(ibl): add type hints for indent_blankline options --- lua/plugins/indent_blankline.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/plugins/indent_blankline.lua b/lua/plugins/indent_blankline.lua index 3d5c6f51..ba2ebbdc 100644 --- a/lua/plugins/indent_blankline.lua +++ b/lua/plugins/indent_blankline.lua @@ -1,11 +1,13 @@ -- indent-blankline.nvim | Indent guides for Neovim -- https://github.com/lukas-reineke/indent-blankline.nvim +---@module "ibl" ---@type LazyPluginSpec return { "lukas-reineke/indent-blankline.nvim", main = "ibl", event = { "BufRead", "BufNewFile" }, + ---@type ibl.config opts = { indent = { char = "│", From 5e5afdc54a194fd91386145f6172df91eb94c5b4 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 24 Sep 2024 04:13:01 -0700 Subject: [PATCH 073/153] fix(ibl): disable indent_blankline in git/neogit filetype buffers --- lua/plugins/indent_blankline.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/plugins/indent_blankline.lua b/lua/plugins/indent_blankline.lua index ba2ebbdc..31cc2804 100644 --- a/lua/plugins/indent_blankline.lua +++ b/lua/plugins/indent_blankline.lua @@ -35,10 +35,12 @@ return { }, exclude = { filetypes = { + "Neogit*", "dashboard", "dbui", "floaterm", "fugitive", + "git", "log", "neogit", "undotree", From 3afc598fce7d63c70e10fe07c489eb6a0a38125f Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 11:32:09 -0800 Subject: [PATCH 074/153] fix(todo): update default highlight handling Replace manual autocmd creation for clearing default `Todo` highlights with the `config.colors.set_hl_autocmd` utility function. This simplifies the code and ensures consistency in highlight handling. --- lua/plugins/todo-comments.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index 973c06b7..0ab056db 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -58,12 +58,10 @@ return { }, }, init = function() - vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, { - desc = "Remove default todo higroup", - group = vim.api.nvim_create_augroup("Todo#RemoveDefaultHigroup", {}), - callback = function() - vim.api.nvim_set_hl(0, "Todo", {}) - end, + -- Set default highlights + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + Todo = {}, }) end, } From 20ae6441daf8cbe184cdb271e31dae0068401b26 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 24 Sep 2024 04:20:36 -0700 Subject: [PATCH 075/153] fix(dap): handle nil type for nvim_set_current_tabpage param Check `current_tab` before passing it to `nvim_set_current_tabpage`. If `current_tab` is `nil`, it is replaced with 0, interpreted as the active tabpage, avoiding the linter warning about invalid types. --- lua/plugins/dap/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/dap/ui.lua b/lua/plugins/dap/ui.lua index c444b258..8b3926d4 100644 --- a/lua/plugins/dap/ui.lua +++ b/lua/plugins/dap/ui.lua @@ -44,7 +44,7 @@ local function close_debugger() local current_win = vim.fn.win_getid() if vim.api.nvim_win_get_tabpage(current_win) == current_tab then - vim.api.nvim_set_current_tabpage(current_tab) + vim.api.nvim_set_current_tabpage(current_tab or 0) end end From a22b15a6a09a8371f90d07fe3a057c45785aae50 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 14 Nov 2024 16:50:37 -0800 Subject: [PATCH 076/153] feat(cmp): set source labels for LSP clients IF the cmp source is `nvim_lsp` replace it will the name of the LSP client. --- lua/plugins/cmp.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 25387885..31bd3748 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -55,6 +55,7 @@ local truncate_abbreviation = function(abbr) return abbr end +-- Styled names for cmp source labels local source_labels = { buffer = "[Buffer]", cmp_tabnine = "[TabNine]", @@ -80,13 +81,14 @@ local source_labels = { ---@param entry table ---@return string local format_source_labels = function(entry) + local default = ("[%s]"):format(entry.source.name) if entry.source.name == "nvim_lsp" then if entry.source.source.client then - local name = entry.source.source.client.name - return ("[%s]"):format(name) + local client = entry.source.source.client.name + return ("[%s]"):format(client) end end - return source_labels[entry.source.name] + return source_labels[entry.source.name] or default end ---@type LazyPluginSpec From e9f1c0b8357cfbed543c90094a9dcce15ebb897f Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 14 Nov 2024 16:48:44 -0800 Subject: [PATCH 077/153] fix(cmp): set cmp window highlights to use Normal over NormalFloat --- lua/plugins/cmp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 31bd3748..c9f5f5fe 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -31,7 +31,7 @@ local window_opts = { max_width = 80, border = vim.g.border, winhighlight = table.concat({ - "NormalFloat:NormalFloat", + "Normal:NormalFloat", "FloatBorder:FloatBorder", "CursorLine:PmenuSel", "Search:None", From 833301b70ef0f932f204ac05796e4bbdf8bcb40c Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 15 Nov 2024 09:25:49 -0800 Subject: [PATCH 078/153] fix(cmp): use config preset for cmp windows Presets apply some default opts while accepting a table of overrides which we define in the window_opts table. --- lua/plugins/cmp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index c9f5f5fe..d3749369 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -213,8 +213,8 @@ return { }, performance = { max_view_entries = 25 }, window = { - completion = window_opts, - documentation = window_opts, + completion = cmp.config.window.bordered(window_opts), + documentation = cmp.config.window.bordered(window_opts), }, view = { entries = { From d0c40945f1d1f77e0ed2b9584fb4b48147f9617a Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 18 Nov 2024 11:34:50 -0800 Subject: [PATCH 079/153] refactor(fugitive)!: remove plugin and use Neogit with new keymap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add alias for `Git` command to simplify usage - Map `gg` to open Neogit’s git status After switching from Fugitive to Neogit, the `Git` command for actions like commit and rebase became a habit. Neogit’s command is less concise, so the alias simplifies usage. While keymaps improve efficiency, I prefer short commands over memorizing many keybindings. --- lazy-lock.json | 1 - lua/plugins/fugitive.lua | 60 ---------------------------------------- lua/plugins/neogit.lua | 15 +++++++++- 3 files changed, 14 insertions(+), 62 deletions(-) delete mode 100644 lua/plugins/fugitive.lua diff --git a/lazy-lock.json b/lazy-lock.json index f9371944..16b5fd2d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -74,7 +74,6 @@ "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vscode.nvim": { "branch": "main", "commit": "18097b7aa47538afa780c821309c8b992972d726" }, "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua deleted file mode 100644 index ff2c82ab..00000000 --- a/lua/plugins/fugitive.lua +++ /dev/null @@ -1,60 +0,0 @@ --- vim-fugitive | A Git wrapper so awesome, it should be illegal --- https://github.com/tpope/vim-fugitive - ----@type LazyPluginSpec -return { - "tpope/vim-fugitive", - event = "VeryLazy", - keys = { - { "gd", "Gdiffsplit", desc = "Diff current buffer" }, - { "gg", "Gtabedit :", desc = "Git Status (Fugitive)" }, - { "gl", "GclogTab", desc = "Git Log" }, - }, - init = function() - vim.api.nvim_create_autocmd({ "FileType" }, { - desc = "", - group = vim.api.nvim_create_augroup("FugitiveOptions", {}), - pattern = { "fugitive" }, - callback = function() - -- Buffer local options - vim.opt_local.number = false - vim.opt_local.relativenumber = false - vim.opt_local.cursorline = true - vim.opt_local.cursorlineopt = "both" - vim.opt_local.colorcolumn = "0" - vim.opt_local.signcolumn = "yes:1" - vim.opt_local.foldmethod = "syntax" - vim.opt_local.bufhidden = "delete" - - -- Buffer local keymaps - local opts = { buffer = true, remap = true, silent = true } - - vim.keymap.set("n", "", "=", opts) - end, - }) - end, - config = function(_, _) - -- Open Gdiffsplit in new tab - vim.api.nvim_create_user_command("GdiffsplitTab", function() - local git_dir = vim.fn.FugitiveGitDir() - if vim.fn.empty(git_dir) == 0 then - vim.cmd(string.format("exe 'tabedit %s'", vim.fn.expand("%"))) - vim.cmd("Gdiffsplit") - --- Keymaps --- - local opts = { buffer = 0, remap = true, silent = true } - vim.keymap.set("n", "q", "tabclose", opts) - end - end, {}) - - -- Open GcLog in new tab - vim.api.nvim_create_user_command("GclogTab", function() - local git_dir = vim.fn.FugitiveGitDir() - if vim.fn.empty(git_dir) == 0 then - vim.cmd("tabnew | GcLog") - --- Keymaps --- - local opts = { buffer = 0, remap = true, silent = true } - vim.keymap.set("n", "q", "tabclose", opts) - end - end, {}) - end, -} diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index bb473003..32a59414 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -12,7 +12,7 @@ return { { "sindrets/diffview.nvim" }, }, keys = { - { "gG", "Neogit", desc = "Git Status (Neogit)" }, + { "gg", "Neogit", desc = "Git Status" }, }, opts = { kind = "tab", @@ -25,6 +25,19 @@ return { commit_popup = { kind = "split_above" }, }, init = function() + -- Alias command `Neogit` to `Git` + vim.api.nvim_create_user_command("Git", function(o) + local neogit = require("neogit") + neogit.open(require("neogit.lib.util").parse_command_args(o.fargs)) + end, { + nargs = "*", + desc = "Open Neogit", + complete = function(arglead) + local neogit = require("neogit") + return neogit.complete(arglead) + end, + }) + -- Set default highlights local colors = require("config.colors") colors.set_hl_autocmd(nil, { From bae5df485ef3d241ee1d058cdea53fac5cc0692e Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 15:11:37 -0800 Subject: [PATCH 080/153] fix(satellite): disable git handler to reduce visual clutter While the git handler is useful, it creates excessive visual clutter when used alongside the gitsigns.nvim plugin. --- lua/plugins/satellite.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/plugins/satellite.lua b/lua/plugins/satellite.lua index 25386967..05a88282 100644 --- a/lua/plugins/satellite.lua +++ b/lua/plugins/satellite.lua @@ -14,8 +14,11 @@ return { }) end, opts = { - -- FIX: Disable winblend to prevent black background + -- HACK: Disable winblend to prevent black background -- https://github.com/neovim/neovim/issues/18576 winblend = 0, + handlers = { + gitsigns = { enable = false }, + }, }, } From c5e26038e0a9574c7b30f49933f4e1261ccd0f6b Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 15:37:10 -0800 Subject: [PATCH 081/153] fix(telescope): update border highlights to use FloatBorder Replace `WinSeparator` with `FloatBorder` for various Telescope border highlights to better align with UI consistency. --- lua/plugins/telescope.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 9c2dd989..1ece5736 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -212,10 +212,10 @@ return { init = function() local colors = require("config.colors") colors.set_hl_autocmd(nil, { - TelescopeBorder = { link = "WinSeparator", default = true }, - TelescopePreviewBorder = { link = "WinSeparator", default = true }, - TelescopePromptBorder = { link = "WinSeparator", default = true }, - TelescopeResultsBorder = { link = "WinSeparator", default = true }, + TelescopeBorder = { link = "FloatBorder", default = true }, + TelescopePreviewBorder = { link = "FloatBorder", default = true }, + TelescopePromptBorder = { link = "FloatBorder", default = true }, + TelescopeResultsBorder = { link = "FloatBorder", default = true }, TelescopeSelection = { link = "CursorLine", default = true }, TelescopeTitle = { link = "Title", default = true }, }) From 4b848f65acc8899e1d646b25320821209b564c79 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 15:39:34 -0800 Subject: [PATCH 082/153] feat(telescope): update keymaps for improved usability - Reference and adapt LazyVim.extras default keymaps for better alignment - Adjust buffer switching, search, and git-related keybindings Newly added keymaps: - `/` for live grep (Root Dir) - `:` for command history - `` for find files (Root Dir) - `f'` for jump to mark - `f:` for command history - `fa` for autocommands - `fB` for grep buffer - `fd` for document diagnostics - `fD` for workspace diagnostics - `fg` for find git files - `fH` for help tags - `fj` for jumplist - `fk` for keymaps - `fl` for location list - `fm` for man pages - `fo` for options - `fq` for quickfix list - `fr` for recent files - `fR` for resume - `fS` for goto symbol (workspace) - `fs` for grep string - `f~` for jump to mark - `gb` for git branches - `gc` for git commits - `gf` for git files - `gs` for git status --- lua/plugins/telescope.lua | 61 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 1ece5736..ed83b59e 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -13,27 +13,48 @@ return { -- Adds file type icons to Vim plugins { "nvim-tree/nvim-web-devicons" }, }, + -- stylua: ignore keys = { - { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, - { "f.", "Telescope dotfiles", desc = "Dotfiles" }, - { "fb", "Telescope buffers", desc = "Buffers" }, - { "fB", "Telescope current_buffer_fuzzy_find", desc = "Grep Buffer" }, - { "fc", "Telescope colorscheme", desc = "Colorschemes" }, - { "fC", "Telescope commands", desc = "Commands" }, - { "fd", "Telescope lsp_document_diagnostics", desc = "LSP Diagnostics" }, - { "fe", "Telescope file_browser", desc = "File Explorer" }, - { "ff", "Telescope find_files", desc = "Current Files" }, - { "fF", "Telescope treesitter", desc = "Treesitter" }, - { "fh", "Telescope highlights", desc = "Highlight Groups" }, - { "fl", "Telescope live_grep", desc = "Live Grep" }, - { "fm", "Telescope marks", desc = "Bookmarks" }, - { "fr", "Telescope oldfiles", desc = "Recent Files" }, - { "fs", "Telescope grep_string", desc = "Grep String" }, - { "fv", "Telescope vimfiles", desc = "Neovim config" }, - { "gb", "Telescope git_branches", desc = "Branches" }, - { "gc", "Telescope git_commits", desc = "commits" }, - { "gf", "Telescope git_files", desc = "Files" }, - { "gs", "Telescope git_status", desc = "status" }, + { ",", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Switch Buffer" }, + { "/", "Telescope live_grep", desc = "Grep (Root Dir)" }, + { ":", "Telescope command_history", desc = "Command History" }, + { "", "Telescope find_files", desc = "Find Files (Root Dir)" }, + -- Find + { "f'", "Telescope marks", desc = "Jump to Mark" }, + { "f.", "Telescope dotfiles", desc = "Dotfiles" }, + { "f:", "Telescope command_history", desc = "Command History" }, + { "f\"", "Telescope registers", desc = "Registers" }, + { "fa", "Telescope autocommands", desc = "Auto Commands" }, + { "fb", "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", desc = "Buffers" }, + { "fB", "Telescope current_buffer_fuzzy_find", desc = "Grep Buffer" }, + { "fc", "Telescope colorscheme", desc = "Colorscheme" }, + { "fC", "Telescope commands", desc = "Commands" }, + { "fd", "Telescope diagnostics bufnr=0", desc = "Document Diagnostics" }, + { "fD", "Telescope diagnostics", desc = "Workspace Diagnostics" }, + { "ff", "Telescope find_files", desc = "Find Files (Root Dir)" }, + { "fF", "Telescope treesitter", desc = "Treesitter" }, + { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, + { "fg", "Telescope live_grep", desc = "Live Grep" }, + { "fH", "Telescope help_tags", desc = "Help Pages" }, + { "fh", "Telescope highlights", desc = "Search Highlight Groups" }, + { "fj", "Telescope jumplist", desc = "Jumplist" }, + { "fk", "Telescope keymaps", desc = "Key Maps" }, + { "fl", "Telescope loclist", desc = "Location List" }, + { "fm", "Telescope man_pages", desc = "Man Pages" }, + { "fo", "Telescope vim_options", desc = "Options" }, + { "fq", "Telescope quickfix", desc = "Quickfix List" }, + { "fr", "Telescope oldfiles", desc = "Recent Files" }, + { "fR", "Telescope resume", desc = "Resume" }, + { "fs", "Telescope grep_string", desc = "Grep String" }, + { "fs", "Telescope lsp_document_symbols", desc = "Goto Symbol" }, + { "fS", "Telescope lsp_dynamic_workspace_symbols", desc = "Goto Symbol (Workspace)" }, + { "fv", "Telescope vimfiles", desc = "Neovim config" }, + { "f~", "Telescope marks", desc = "Jump to Mark" }, + -- Git + { "gb", "Telescope git_branches", desc = "Git Branches" }, + { "gc", "Telescope git_commits", desc = "Git Commits" }, + { "gf", "Telescope git_files", desc = "Git Files" }, + { "gs", "Telescope git_status", desc = "Git Status" }, }, opts = function() local action_set = require("telescope.actions.set") From f35d919a926186bccec47f71df19b0e43c88260d Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 7 Dec 2024 16:00:58 -0800 Subject: [PATCH 083/153] feat(wk): re-enable icons in which-key window --- lua/plugins/which-key.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 131e6a86..94e56dc4 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -16,7 +16,7 @@ return { ---@class wk.Opts opts = { preset = "classic", - icons = { mappings = false }, + icons = { mappings = true }, win = { row = math.huge, border = { "─", "─", "─", " ", "─", "", "", " " }, From 46a03474ca2e53c56f14ff60594a2c12b1f4c8f7 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 8 Dec 2024 13:18:15 -0800 Subject: [PATCH 084/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 16b5fd2d..0bcc3f64 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,12 +2,12 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, - "ayu": { "branch": "master", "commit": "2839c88cd297a069e93df1aab542c087e8f6e8c0" }, + "ayu": { "branch": "master", "commit": "37160699469d695486174fb863aae2f2a4c1f90f" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-cmdline-history": { "branch": "master", "commit": "003573b72d4635ce636234a826fa8c4ba2895ffe" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, @@ -23,9 +23,9 @@ "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, "kanagawa.nvim": { "branch": "master", "commit": "ad3dddecd606746374ba4807324a08331dfca23c" }, - "lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, - "lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" }, + "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, @@ -36,46 +36,46 @@ "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "material.nvim": { "branch": "main", "commit": "31429eef4b7233ebdae3ddb57b7165ee4f1bd653" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "moonfly": { "branch": "master", "commit": "49701afd56b6ad7877dd20a192016f74f518e291" }, - "neogit": { "branch": "master", "commit": "a38945a585794c716b2ff9b25668bb5c089e8cd7" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "f50d4dece9f91813f049f8100d188933f7d654d9" }, + "moonfly": { "branch": "master", "commit": "2e9b34d1b2b3b65a78679b8e7bd856cb769f28a8" }, + "neogit": { "branch": "master", "commit": "f6b96486baad92982c66adbd9bbc42cbfad3741b" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "58866c670d68ef80397c317a3a1ee5f53ca646fd" }, + "none-ls.nvim": { "branch": "main", "commit": "40dc2e983560acaea29d6312b33fafba37b0c272" }, "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, - "nvim-dap": { "branch": "master", "commit": "580d6e526358afd0e4bba053e68fd59cf581a161" }, + "nvim-cmp": { "branch": "main", "commit": "98e8b9d593a5547c126a39212d6f5e954a2d85dd" }, + "nvim-dap": { "branch": "master", "commit": "567da83810dd9da32f9414d941bc6848715fc102" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, "nvim-highlight-colors": { "branch": "main", "commit": "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e" }, "nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" }, - "nvim-lspconfig": { "branch": "master", "commit": "47f236c058f0511702286a21ba53bbf42abbd8a8" }, + "nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "894cb3cebbad0535fb4e319ada5d875dbc48d8b9" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b9e30333ece125297cfc5d652465cbc9a23b4916" }, + "nvim-treesitter": { "branch": "master", "commit": "fa915a30c5cdf1d18129e9ef6ac2ee0fa799904f" }, + "nvim-treesitter-context": { "branch": "master", "commit": "8fd989b6b457a448606b4a2e51f9161700f609a7" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" }, - "oil.nvim": { "branch": "master", "commit": "9a59256c8e88b29d2150e99b5960b2f111e51f75" }, + "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "7f47c3297eeed1364be3c6ad915b1df2beb2b2f4" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "e9dfb4582b9ca0ab7e987c65999f662242bd6f61" }, - "rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "77e5bad54227dcfe3878ffbda88ab1efdaacb475" }, + "rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "satellite.nvim": { "branch": "main", "commit": "bce591cb5e379bd989623993c604c774633e7ed9" }, "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "toggleterm.nvim": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" }, - "tokyonight.nvim": { "branch": "main", "commit": "355e2842291dbf51b2c5878e9e37281bbef09783" }, + "toggleterm.nvim": { "branch": "main", "commit": "87b2d6a3cab8e2bd9a0255427074285f0365398d" }, + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-dirtytalk": { "branch": "master", "commit": "aa57ba902b04341a04ff97214360f56856493583" }, "vscode.nvim": { "branch": "main", "commit": "18097b7aa47538afa780c821309c8b992972d726" }, - "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, - "zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }, + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }, + "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }, "zk-nvim": { "branch": "main", "commit": "42dc341d897ac4da3d4a9c5c506a36153473f021" } } From 2d4c756c655ace07dbc5319518abac73104af829 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 17:28:46 -0800 Subject: [PATCH 085/153] chore(lsp): remove lazydev config for luvit types Remove unnecessary dependency on `luvit-meta` for `LazyDev` plugin. Replace `luvit-meta/library` path with `${3rd}/luv/library` for `vim.uv` type hints. --- lazy-lock.json | 1 - lua/plugins/lsp/init.lua | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 0bcc3f64..a918b7c9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -28,7 +28,6 @@ "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index a519f29b..4eed4290 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -62,14 +62,10 @@ return { "folke/lazydev.nvim", ft = "lua", cmd = "LazyDev", - dependencies = { - -- NOTE: optional `vim.uv` typing - { "Bilal2453/luvit-meta", lazy = true }, - }, opts = { library = { { path = "lazy.nvim" }, - { path = "luvit-meta/library", words = { "vim%.uv" } }, + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, }, }, }, From 2dbfa79e73bae64c0f5cf2e996f0d1a0874ff9ad Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:27:55 -0800 Subject: [PATCH 086/153] chore(wk): annotate module to load types for which-key Add `---@module "which-key"` annotation to ensure Lua language server loads types for the which-key plugin. LazyDev facilitates loading the necessary workspace. --- lua/plugins/which-key.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 94e56dc4..07471504 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -1,5 +1,6 @@ -- Which-key | Configurations for plugin WhichKey.nvim -- https://github.com/folke/which-key.nvim +---@module "which-key" ---@type LazyPluginSpec return { From f625eb243521be3f7dbaa5f35f494b34f10ccfc5 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:32:50 -0800 Subject: [PATCH 087/153] fix(gitsigns): allow attaching to untracked files Set `attach_to_untracked` to `true` to allow Gitsigns to attach to untracked files. Improves functionality when working with new or untracked files. --- lua/plugins/gitsigns.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 7b44bb66..a7f3344e 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -17,6 +17,7 @@ return { dependencies = { "nvim-lua/plenary.nvim" }, opts = { sign_priority = priority(), + attach_to_untracked = true, signs_staged_enable = false, current_line_blame = true, current_line_blame_formatter = " , - ", From c52061965741a05b1e52a1b4062db3d0e7ace57e Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:36:17 -0800 Subject: [PATCH 088/153] fix(gitsigns): restore default sign for untracked files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert `untracked` sign to the plugin's default (`┆`) for better visual distinction between tracked and untracked files. Although the previous sign was consistent with others, it obscured untracked file status. The setting is now explicitly applied. --- lua/plugins/gitsigns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index a7f3344e..e5f2dce3 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -27,7 +27,7 @@ return { delete = { text = "▎" }, topdelete = { text = "▎" }, changedelete = { text = "▎" }, - untracked = { text = "▎" }, + untracked = { text = "┆" }, }, signs_staged = { add = { text = "▎" }, @@ -35,7 +35,7 @@ return { delete = { text = "▎" }, topdelete = { text = "▎" }, changedelete = { text = "▎" }, - untracked = { text = "▎" }, + untracked = { text = "┆" }, }, on_attach = function(bufnr) local gitsigns = require("gitsigns") From b61c789a023562db3c1a37cca5df3d0213845a94 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:36:54 -0800 Subject: [PATCH 089/153] fix(gitsigns): include commit hash in blame formatter Update `current_line_blame_formatter` to include the abbreviated commit hash (``) alongside the author, time, and summary. Provides more detailed context in the blame annotation. --- lua/plugins/gitsigns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index e5f2dce3..d2c81484 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -20,7 +20,7 @@ return { attach_to_untracked = true, signs_staged_enable = false, current_line_blame = true, - current_line_blame_formatter = " , - ", + current_line_blame_formatter = " , - - ", signs = { add = { text = "▎" }, change = { text = "▎" }, From 716fec27e139224157af9a45a618a1abe46dc8fa Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:40:38 -0800 Subject: [PATCH 090/153] fix(lazy): move import definitions to primary parameter Relocate plugin import definitions to the first parameter of `lazy.setup` to align with how the setup function handles options. This resolves type errors with the `dev` table, which behaves differently in a LazyConfig table versus a plugin spec. Ensures correct type inference and eliminates ambiguity. --- lua/config/lazy.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index bc02a0dd..f25d13ff 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -17,10 +17,9 @@ vim.opt.rtp:prepend(lazypath) -- Initialize plugin list require("lazy").setup({ - spec = { - { import = "plugins" }, - { import = "plugins.colors" }, - }, + { import = "plugins" }, + { import = "plugins.colors" }, +}, { change_detection = { notify = false }, defaults = { lazy = true }, install = { colorscheme = { "vscode", "default" } }, From 65e2dd88706e3b762f8ef513ef59887c54c51495 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:42:42 -0800 Subject: [PATCH 091/153] fix(gruvbox): explicitly set `dim_inactive` option Add `dim_inactive = false` to prevent missing-field warnings from `lua_ls`. Ensures all expected fields are explicitly defined in the Gruvbox configuration. --- lua/plugins/colors/gruvbox.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/plugins/colors/gruvbox.lua b/lua/plugins/colors/gruvbox.lua index 776b4ef9..2ac0b750 100644 --- a/lua/plugins/colors/gruvbox.lua +++ b/lua/plugins/colors/gruvbox.lua @@ -28,8 +28,9 @@ return { priority = 1000, ---@type GruvboxConfig opts = { - contrast = "soft", -- can be "hard", "soft" or empty string bold = false, + contrast = "soft", -- can be "hard", "soft" or empty string + dim_inactive = false, inverse = false, -- invert background for search, diffs, statusline and errors transparent_mode = true, italic = { From 0a14a8f30c688d25175db58fd842901c98ecc8b9 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:45:53 -0800 Subject: [PATCH 092/153] fix(mason): use `VeryLazy` event for plugin bootstrap Switch the `event` to `VeryLazy` to ensure Mason loads when neovim starts, allowing automatic installation of tools like `lua_ls` and linters. --- lua/plugins/mason.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 62939acd..20d31cdf 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -6,8 +6,14 @@ return { { "williamboman/mason.nvim", build = ":MasonUpdate", - cmd = { "Mason", "MasonLog", "MasonUninstall", "MasonUninstallAll", "MasonUpdate" }, - event = { "BufReadPre", "BufNewFile" }, + event = { "VeryLazy" }, + cmd = { + "Mason", + "MasonLog", + "MasonUninstall", + "MasonUninstallAll", + "MasonUpdate", + }, keys = { { "pm", "Mason", desc = "Show mason" }, }, From e8e936aa5d2c23170607741f3cf2cf887c3fe658 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:49:07 -0800 Subject: [PATCH 093/153] fix(lsp): add nil check to autocmd for powershell_es semantic tokens Add a nil check for the `client` object in the LspAttach autocmd to prevent errors when the client is not found. This ensures that semantic tokens are correctly disabled when the `powershell_es` language server attaches to a PowerShell script buffer. --- lua/plugins/lsp/servers/powershell_es.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/lsp/servers/powershell_es.lua b/lua/plugins/lsp/servers/powershell_es.lua index c0becac4..047ae73d 100644 --- a/lua/plugins/lsp/servers/powershell_es.lua +++ b/lua/plugins/lsp/servers/powershell_es.lua @@ -6,7 +6,7 @@ vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("LspAttach_PowerShellES", {}), callback = function(ev) local client = vim.lsp.get_client_by_id(ev.data.client_id) - if client.name == "powershell_es" then + if client and client.name == "powershell_es" then client.server_capabilities.semanticTokensProvider = nil end end, From a223a48c11af6f35c6eed1ba11399774298ef609 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:53:09 -0800 Subject: [PATCH 094/153] refactor(comment): improve visual selection preservation after comment Replace Vimscript command string with `vim.cmd.normal("gv")` to reapply the visual selection after commenting a line. This change avoids string evaluation while preserving the functionality of restoring the selection. --- lua/plugins/comment.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 079c2c38..2362e2a1 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -14,7 +14,7 @@ local post_hook = function(ctx) if ctx.cmotion > 1 then -- Reselect visual lines - vim.cmd([[exe "norm! gv"]]) + vim.cmd.normal("gv") end end end From 2f7bda3e74173beb762006f035d056037536dafc Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 21:55:16 -0800 Subject: [PATCH 095/153] refactor(comment): use custom util function for keymap registration Refactor keymap definitions to use the custom `register_keymaps` utility function, simplifying the process and reducing redundancy in the configuration. This preferred API handles keymap definitions in a table, making the setup more maintainable. --- lua/plugins/comment.lua | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 2362e2a1..d4ed2787 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -36,32 +36,33 @@ return { config = function(_, opts) require("Comment").setup(opts) local api = require("Comment.api") - local esc = vim.api.nvim_replace_termcodes("", true, false, true) - local map = vim.keymap.set - map("i", "", api.toggle.linewise.current) - map("n", "", api.toggle.linewise.current) - map("n", "", api.toggle.linewise.current) - map("i", "", api.toggle.linewise.current) - - -- Utilizing Comment.nvim extended keymaps - -- Includes duplicate mappings due to terminal differences - -- + Kitty Terminal | - -- + Windows Terminal | + -- Return callback function for visual mode keymaps + local function locked(cb) + local esc = vim.api.nvim_replace_termcodes("", true, false, true) + return function() + vim.api.nvim_feedkeys(esc, "nx", false) + api.locked(cb)(vim.fn.visualmode()) + end + end - map("x", "", function() - vim.api.nvim_feedkeys(esc, "nx", false) - api.locked("toggle.linewise")(vim.fn.visualmode()) - end, { desc = "Comment toggle linewise (visual)" }) + -- Define extended keymaps + local util = require("config.util") + util.register_keymaps(nil, { + -- Windows Terminal: + { "i", "", api.toggle.linewise.current }, + { "n", "", api.toggle.linewise.current }, + { "x", "", locked("toggle.linewise") }, - map("x", "", function() - vim.api.nvim_feedkeys(esc, "nx", false) - api.locked("toggle.linewise")(vim.fn.visualmode()) - end, { desc = "Comment toggle linewise (visual)" }) + -- Kitty Terminal: + { "i", "", api.toggle.linewise.current }, + { "n", "", api.toggle.linewise.current }, + { "x", "", locked("toggle.linewise") }, - map("x", "", function() - vim.api.nvim_feedkeys(esc, "nx", false) - api.locked("toggle.blockwise")(vim.fn.visualmode()) - end, { desc = "Comment toggle blockwise (visual)" }) + -- Comment block selection + { "i", "", api.toggle.blockwise.current }, + { "n", "", api.toggle.blockwise.current }, + { "x", "", locked("toggle.blockwise") }, + }) end, } From e248d8503b3d7b3d6b06f7be52ef3fa6fdd2e155 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 22:29:12 -0800 Subject: [PATCH 096/153] docs(lualine): add comments to clarify custom component options Added descriptive comments to the custom lualine component definitions. Each table now includes a brief explanation of the type of information it displays in the statusline, improving clarity and organization of the configuration. --- lua/plugins/lualine.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 641b29fd..9203e2f5 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -43,8 +43,11 @@ local function client_format(client_name, spinner, series_messages) end -- Components --- Define custom lualine component options +-- Define custom lualine options for various statusline elements. +-- Each table represents the configuration for a specific type of information +-- displayed in the statusline, organized for clarity and modularity. +-- Displays the current editor mode. local mode = { "mode", fmt = function(str) @@ -52,6 +55,7 @@ local mode = { end, } +-- Shows the current file type. local filetype = { "filetype", icon_only = true, @@ -60,6 +64,7 @@ local filetype = { padding = { left = 1, right = 0 }, } +-- Displays file encoding. local encoding = { "encoding", fmt = function(str) @@ -67,6 +72,7 @@ local encoding = { end, } +-- Indicates the file's line-ending format. local fileformat = { "fileformat", symbols = { @@ -76,6 +82,7 @@ local fileformat = { }, } +-- Shows the current file name. local filename = { "filename", path = 1, @@ -84,11 +91,13 @@ local filename = { component_separator = "", } +-- Displays the current Git branch. local branch = { "branch", icon = "", } +-- Shows Git diff stats. local diff = { "diff", ---Version control diff values @@ -105,6 +114,7 @@ local diff = { end, } +-- Displays LSP or diagnostic counts. local diagnostics = { "diagnostics", sources = { "nvim_diagnostic" }, @@ -118,6 +128,7 @@ local diagnostics = { end)(), } +-- Shows attached LSP client info. local lsp_info = { "lsp_info", icon = { "", align = "right" }, @@ -129,6 +140,7 @@ local lsp_info = { }, } +-- Manages and displays tab info. local tabs = { "tabs", mode = 1, @@ -143,6 +155,7 @@ local tabs = { end, } +-- Manages and displays window info. local windows = { "windows", use_mode_colors = true, From eb66ed422e8e9919e496fc87fa97c4fad8e28009 Mon Sep 17 00:00:00 2001 From: daephx Date: Tue, 10 Dec 2024 22:30:07 -0800 Subject: [PATCH 097/153] chore: update spell dictionary --- spell/en.utf-8.add | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 5e18b23f..9f5d729e 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -59,6 +59,7 @@ HSV IIFE IOError IPython +ImGui ImageMagick IncSearch IndentBlankline @@ -80,6 +81,7 @@ LspReferenceWrite LuaJIT LuaRocks LuaSnip +LÖVE MANPATH MD5 MacOS @@ -197,6 +199,7 @@ api apk appdata appmenu +approach appxmanifest archflags archlinux @@ -336,6 +339,7 @@ chore chown chsh ci +cimgui cindent citra clangd @@ -371,6 +375,8 @@ codelens codelldb codepoints codestyle +collider +colliders colorcolumn colorflag colorizer @@ -403,6 +409,7 @@ consolas const cookiecutter cooklang +cooldowns copen copyindent copypasta @@ -453,6 +460,7 @@ dataframe datamoshes datamoshing dataview +dbg dbui dconf deadzone @@ -584,6 +592,7 @@ ethernet ev eval eventlog +eviline exa exe execute @@ -781,6 +790,7 @@ histsize hitbox hjkl hl +hlgroups hlsearch homebrew homelab @@ -818,6 +828,7 @@ imagemagick imap img imgcat +imgui imgur impl incsearch @@ -898,6 +909,7 @@ keymaps keypress keypressed keypresses +keyreleased keyset kickstart koehler @@ -1009,6 +1021,7 @@ luasnip luaver lunaperche lunaperche/! +luv luvit macchiato macchina @@ -1027,6 +1040,7 @@ markdownlint markdownlintrc matchit matchparen +matplotlib matryoshka maui maxLine @@ -1044,6 +1058,7 @@ mergetool metadata metatable mgcb +microservices microsoft middleware middlewares @@ -1257,6 +1272,7 @@ pixelwise pixiedust pkill plaintext +platformer plex pmenu png @@ -1577,7 +1593,9 @@ submenu submodule submodules subnet +substates subtractive +subtrees sudo sudoedit sudoer @@ -1648,6 +1666,7 @@ timecode timecodes timestamp timestamps +timestep tlaplus tldr tls @@ -1673,6 +1692,7 @@ toplevel topline topsplit toptal +tostring tostring/! touchd toupper From 6e69d519be428c7107a29326e0b791981cd09a10 Mon Sep 17 00:00:00 2001 From: daephx Date: Wed, 11 Dec 2024 00:46:42 -0800 Subject: [PATCH 098/153] refactor(colors): add assertions to color util functions --- lua/config/colors.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index 4ae67865..dd973524 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -47,6 +47,7 @@ end ---@param colors config.HighlightsTbl ---@return config.HighlightsTbl M.extend_hl = function(group, colors) + assert(type(group) == "string", "paramater 'name' must be of type 'string'") local group_colors = M.get_highlight(group) return vim.tbl_extend("force", group_colors, colors) end @@ -55,6 +56,7 @@ end ---@param colors config.Highlights ---@return nil M.set_hl = function(colors) + assert(colors ~= nil, "paramater 'colors' must be of type 'table|function'") local ret = {} if type(colors) == "function" then colors(ret) @@ -93,6 +95,7 @@ end ---@param rtp string Parent directory to search for runtime files. ---@return string? local get_colors_file = function(name, rtp) + assert(type(name) == "string", "paramater 'name' must be of type 'string'") local files = vim.api.nvim_get_runtime_file(rtp .. "/*", true) for _, path in pairs(files) do local match = string.match(path, rtp .. "/(%w+)%.[lua|vim]") From ad34bb280fc86be656853e6384ec12de00010907 Mon Sep 17 00:00:00 2001 From: daephx Date: Wed, 11 Dec 2024 00:47:34 -0800 Subject: [PATCH 099/153] fix(colors): update function name in extend_hl The rename of `set_highlight` to `set_hl` was not applied to `extend_hl`, which could lead to an error if used. --- lua/config/colors.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index dd973524..b146217c 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -48,7 +48,7 @@ end ---@return config.HighlightsTbl M.extend_hl = function(group, colors) assert(type(group) == "string", "paramater 'name' must be of type 'string'") - local group_colors = M.get_highlight(group) + local group_colors = M.get_hl(group) return vim.tbl_extend("force", group_colors, colors) end From 120d56b44a25036a55501e3a9e02b3959c9ec461 Mon Sep 17 00:00:00 2001 From: daephx Date: Wed, 11 Dec 2024 00:51:58 -0800 Subject: [PATCH 100/153] feat(colors): add function to invert foreground/background highlights Introduced `invert_hl` to swap the foreground and background colors of a given highlight group, allowing for more dynamic styling. --- lua/config/colors.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index b146217c..5c09243b 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -52,6 +52,16 @@ M.extend_hl = function(group, colors) return vim.tbl_extend("force", group_colors, colors) end +---Swap the foreground and background definitions for the provided highlight group. +---@param group string Provided highlight group name +---@return table +M.invert_hl = function(group) + assert(type(group) == "string", "paramater 'name' must be of type 'string'") + local colors = M.get_hl(group) + colors["bg"], colors["fg"] = colors["fg"] or "none", colors["bg"] or "none" + return colors +end + ---Wrapper for nvim_set_hl that applies higroups from table/func definitions. ---@param colors config.Highlights ---@return nil From 38d147f34e6be4fd3603beca1262c8eb9b5df71d Mon Sep 17 00:00:00 2001 From: daephx Date: Wed, 11 Dec 2024 01:03:25 -0800 Subject: [PATCH 101/153] refactor(lsp): rename and restructure formatting functions - Renamed the `formatting` module -> `format`. - Renamed `toggle`, `format_document` and `enable_auto_format` methods. - Updated format user_commands to reflect new function names. - Updated lsp on_attach keymaps to reflect new function names. --- lua/plugins/lsp/attach.lua | 4 ++-- .../handlers/{formatting.lua => format.lua} | 24 +++++++------------ lua/plugins/lsp/keymaps.lua | 10 ++++---- 3 files changed, 14 insertions(+), 24 deletions(-) rename lua/plugins/lsp/handlers/{formatting.lua => format.lua} (80%) diff --git a/lua/plugins/lsp/attach.lua b/lua/plugins/lsp/attach.lua index 9d2bb087..9c4d4351 100644 --- a/lua/plugins/lsp/attach.lua +++ b/lua/plugins/lsp/attach.lua @@ -1,5 +1,5 @@ local codelens = require("plugins.lsp.handlers.codelens") -local formatting = require("plugins.lsp.handlers.formatting") +local format = require("plugins.lsp.handlers.format") local highlight = require("plugins.lsp.handlers.highlight") local hover = require("plugins.lsp.handlers.hover") local keymaps = require("plugins.lsp.keymaps") @@ -15,7 +15,7 @@ local on_attach = function(client, bufnr) -- Enable Local handlers codelens.enable_code_lens(client, bufnr) - formatting.enable_auto_formatting(client, bufnr) + format.enable_auto_format(client, bufnr) highlight.enable_document_highlighting(client, bufnr) hover.enable_hover_diagnostics(bufnr) keymaps.initialize_keymaps(client, bufnr) diff --git a/lua/plugins/lsp/handlers/formatting.lua b/lua/plugins/lsp/handlers/format.lua similarity index 80% rename from lua/plugins/lsp/handlers/formatting.lua rename to lua/plugins/lsp/handlers/format.lua index 2fc3d5b0..8c549660 100644 --- a/lua/plugins/lsp/handlers/formatting.lua +++ b/lua/plugins/lsp/handlers/format.lua @@ -8,7 +8,7 @@ local notify = function(msg) end -- Toggle document formatting on save -M.toggle = function() +M.format_toggle = function() if vim.b.autoformat == false then vim.b.autoformat = nil ---@type boolean|nil M.autoformat = true @@ -23,7 +23,7 @@ M.toggle = function() end -- Activate document formatting filter to select a preferred formatter -M.format = function() +M.format_document = function() local bufnr = vim.api.nvim_get_current_buf() ---@type integer if vim.b.autoformat == false then return @@ -45,7 +45,7 @@ end -- Enable document formatting autocmd to trigger on BufWritePre ---@param client table ---@param bufnr integer -M.enable_auto_formatting = function(client, bufnr) +M.enable_auto_format = function(client, bufnr) -- Prevent formatting if client disabled it local disabled = ( client.config @@ -54,24 +54,16 @@ M.enable_auto_formatting = function(client, bufnr) ) -- Apply autocmd if client supports formatting if not disabled or client.supports_method("textDocument/formatting") then + -- Add formatting user commands + vim.api.nvim_create_user_command("Format", M.format_document, {}) + vim.api.nvim_create_user_command("FormatToggle", M.format_toggle, {}) + vim.api.nvim_create_autocmd("BufWritePre", { buffer = bufnr, desc = "Apply Auto-formatting for to document on save", group = vim.api.nvim_create_augroup("LspFormat." .. bufnr, {}), - callback = function() - M.format() - end, + callback = M.format_document, }) - - -- Add formatting user command - vim.api.nvim_create_user_command("Format", function() - M.format() - end, {}) - - -- Add toggle formatting user command - vim.api.nvim_create_user_command("FormatToggle", function() - M.toggle() - end, {}) end end diff --git a/lua/plugins/lsp/keymaps.lua b/lua/plugins/lsp/keymaps.lua index 82f42a3e..accb45e2 100644 --- a/lua/plugins/lsp/keymaps.lua +++ b/lua/plugins/lsp/keymaps.lua @@ -1,9 +1,6 @@ -local M = {} +local format = require("plugins.lsp.handlers.format") --- Invoke document formatting -local format_document = function() - require("plugins.lsp.handlers.formatting").format() -end +local M = {} -- Display buffer workspace folders local list_workspace_folders = function() @@ -33,7 +30,8 @@ M.initialize_keymaps = function(_, bufnr) { "n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" } }, { "n", "gi", vim.lsp.buf.implementation, { desc = "Goto implementation" } }, { "n", "gr", vim.lsp.buf.references, { desc = "Goto references" } }, - { { "n", "v" }, "gf", format_document, { remap = true, desc = "Format document" } }, + + { { "n", "v" }, "gf", format.format_document, { remap = true, desc = "Format document" } }, }) end From 352a8091b4b96f5b149b72aec71cfa950dd4f9a6 Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 14 Dec 2024 23:48:04 -0800 Subject: [PATCH 102/153] refactor(telescope): reorder and update `vimgrep_arguments` - Move `vimgrep_arguments` configuration below `layout_config`. - Add `--color=never` to `vimgrep_arguments` to disable color output. - Reorder flags in `vimgrep_arguments` to standardize their order. --- lua/plugins/telescope.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index ed83b59e..ad312e34 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -73,15 +73,6 @@ return { selection_strategy = "reset", sorting_strategy = "ascending", - vimgrep_arguments = { - "rg", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - -- Default settings for layout themes layout_config = { height = 0.5, @@ -98,6 +89,16 @@ return { }, }, + vimgrep_arguments = { + "rg", + "--color=never", + "--column", + "--line-number", + "--no-heading", + "--smart-case", + "--with-filename", + }, + -- Custom mappings for telescope prompt mappings = { i = { From 66d41509ddfd50ac19e4e1b42ba6cae547772d43 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 00:17:46 -0800 Subject: [PATCH 103/153] fix(ibl): exclude additional plugin filetypes fix(ibl): exclude additional plugin filetypes Preventing indent guides from appearing in these plugin-specific buffers. Updated the `indent_blankline` (ibl) exclusion list to include: - `lazy` - `mason` - `trouble` --- lua/plugins/indent_blankline.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/plugins/indent_blankline.lua b/lua/plugins/indent_blankline.lua index 31cc2804..a6f858ad 100644 --- a/lua/plugins/indent_blankline.lua +++ b/lua/plugins/indent_blankline.lua @@ -41,8 +41,11 @@ return { "floaterm", "fugitive", "git", + "lazy", "log", + "mason", "neogit", + "trouble", "undotree", }, }, From e90c068cfcef75c142e6137afc453f8d9e317d09 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 02:04:20 -0800 Subject: [PATCH 104/153] feat(autocmds): auto-create directories on file save Add an autocmd for `BufWritePre` to prompt the user to create missing directories when saving a file. If the target directory doesn't exist, the user is asked for confirmation before it is created. This ensures smoother workflow when working with nested directories. --- lua/config/autocmds.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index c94d29f5..abbf670c 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -132,3 +132,25 @@ autocmd({ "BufNewFile" }, { vim.cmd(("silent! execute '0r %s/templates/skel/%s'"):format(path, fname)) end, }) + +autocmd({ "BufWritePre" }, { + desc = "Create intermediate directories as needed, when saving a file", + group = augroup("auto_create_dir", { clear = true }), + pattern = "*", + callback = function(ev) + if ev.match:match("^%w%w+://") then + return + end + local path = vim.uv.fs_realpath(ev.match) or ev.match + local dir = vim.fs.dirname(path) + if vim.fn.isdirectory(dir) == 0 then + vim.ui.input({ + prompt = ("Directory doesn't exist: %s\nDo you want to create it? [y/N]: "):format(dir), + }, function(choice) + if choice == "y" then + vim.uv.fs_mkdir(dir, tonumber("0755", 8)) + end + end) + end + end, +}) From 91e0095e473b5af2ee2b8988c88c0dd46f839b72 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:23:03 -0800 Subject: [PATCH 105/153] refactor(lualine): replace config with init for LSP progress setup - Move LSP progress setup from `config` to `init` for better initialization behavior while simplifying setup by removing explicit invocation of `setup(opts)`. - Update autocmd group to "Lualine#LspProgressUpdate" with `clear = true` for improved namespace management. - Add a check to ensure lualine is loaded before triggering the refresh autocmd, optimizing startup performance. --- lua/plugins/lualine.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 9203e2f5..faf72a7c 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -221,13 +221,16 @@ return { event = { "LspAttach" }, dependencies = { "nvim-lualine/lualine.nvim" }, opts = { client_format = client_format }, - config = function(_, opts) - require("lsp-progress").setup(opts) + init = function() vim.api.nvim_create_autocmd("User", { desc = "listen for lsp-progress event and refresh lualine", - group = vim.api.nvim_create_augroup("Lualine_LspProgressUpdate", {}), + group = vim.api.nvim_create_augroup("Lualine#LspProgressUpdate", { clear = true }), pattern = "LspProgressStatusUpdated", - callback = require("lualine").refresh, + callback = function() + if package.loaded["lualine"] then + require("lualine").refresh() + end + end, }) end, }, From 76a827604ba251c0427ccb41d273a511f60012a1 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:28:05 -0800 Subject: [PATCH 106/153] refactor(lualine): improve doc comments and tab formatting - Enhance doc comments for `diff.source` to clarify its role in providing Git diff values from gitsigns. - Update comments and add type annotations for the `tabs.fmt` function to describe parameters and return value. - Rename `ok` to `tabname_ok` in the `tabs.fmt` callback for clarity, explicitly indicating it checks tab name validity. --- lua/plugins/lualine.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index faf72a7c..a6bd08ac 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -100,7 +100,7 @@ local branch = { -- Shows Git diff stats. local diff = { "diff", - ---Version control diff values + ---Provides version control diff values from gitsigns for the statusline. ---@return table|nil source = function() local gitsigns = vim.b["gitsigns_status_dict"] @@ -145,10 +145,13 @@ local tabs = { "tabs", mode = 1, use_mode_colors = true, - -- Display tab label as name if set else use tabnr + ---Format the tabpage to display the tab name if available, otherwise use the tab number. + ---@param _name string: The default name of the tab (unused in this function). + ---@param ctx table: The context table containing tab information. + ---@return string: The formatted tab name or tab number. fmt = function(_name, ctx) - local ok, tabname = pcall(vim.api.nvim_tabpage_get_var, ctx.tabId, "tabname") - if ok and tabname ~= "" then + local tabname_ok, tabname = pcall(vim.api.nvim_tabpage_get_var, ctx.tabId, "tabname") + if tabname_ok and tabname ~= "" then return tabname end return ctx.tabnr From cb61d78b7b6070395dfc869595b940e9199b7438 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:36:58 -0800 Subject: [PATCH 107/153] fix(lualine): adjust filename padding for proper icon alignment Set explicit padding with left as 0 and right as 1 to ensure proper alignment of filetype icons in the statusline. --- lua/plugins/lualine.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index a6bd08ac..5c552940 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -86,9 +86,12 @@ local fileformat = { local filename = { "filename", path = 1, - padding = 0, separator = "", component_separator = "", + padding = { + left = 0, + right = 1, + }, } -- Displays the current Git branch. From eb4486714d0bee146584450bd5f2206d72ddb6aa Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:37:27 -0800 Subject: [PATCH 108/153] feat(lualine): add support for man and mason buffers Enable lualine extensions for man and mason buffer types, allowing better integration with these buffers in the statusline. --- lua/plugins/lualine.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 5c552940..cfab63e4 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -216,6 +216,8 @@ return { "dashboard", "fugitive", "lazy", + "man", + "mason", "quickfix", "terminal", "trouble", From 1934d8145458f0c6edcabfbe652b62cb6e24070c Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:41:50 -0800 Subject: [PATCH 109/153] fix(neogit): disable process_spinner due to flashing cursor Disables the process_spinner to resolve an issue where the cursor jumps between the commit message buffer and the command/echo area. This has been observed in Windows Terminal with WSL, and disabling the spinner is a simple workaround. --- lua/plugins/neogit.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 32a59414..c038c17b 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -17,6 +17,7 @@ return { opts = { kind = "tab", disable_context_highlighting = true, + process_spinner = false, integrations = { diffview = true, telescope = true, From 8cbd2593b39a0ef8f70987bb2ebe597b779c55f5 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 15 Dec 2024 14:50:57 -0800 Subject: [PATCH 110/153] chore(lualine): clean up unused filetype associations Removes unused filetype associations that tell lualine how to display and format buffers/windows for specific filetypes. --- lua/plugins/lualine.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index cfab63e4..1cd83c66 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -166,13 +166,11 @@ local windows = { "windows", use_mode_colors = true, filetype_names = { - NvimTree = "NvimTree", checkhealth = "checkhealth", fugitive = "Fugitive", lazy = "Lazy", mason = "Mason", oil = "Oil", - tsplayground = "TSPlayground", }, } From 0f9c9e7c68df2e4d644c3556d134fd50229b7cd6 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:35:07 -0800 Subject: [PATCH 111/153] fix(lspconfig): replace deprecated path functions - Use `vim.fn.dirname` instead of `lspconfig.path.dirname` --- lua/plugins/dap/adapters/python.lua | 2 +- lua/plugins/lsp/servers/pyright.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/dap/adapters/python.lua b/lua/plugins/dap/adapters/python.lua index a606664a..e40bf6a9 100644 --- a/lua/plugins/dap/adapters/python.lua +++ b/lua/plugins/dap/adapters/python.lua @@ -22,7 +22,7 @@ local get_python_path = function(workspace) for _, pattern in ipairs({ "*", ".*" }) do local match = vim.fn.glob(path.join(workspace or vim.fn.getcwd(), pattern, "pyvenv.cfg")) if match ~= "" then - return path.join(path.dirname(match), "bin", "python") + return path.join(vim.fs.dirname(match), "bin", "python") end end diff --git a/lua/plugins/lsp/servers/pyright.lua b/lua/plugins/lsp/servers/pyright.lua index 5edccea7..834d6525 100644 --- a/lua/plugins/lsp/servers/pyright.lua +++ b/lua/plugins/lsp/servers/pyright.lua @@ -13,7 +13,7 @@ local function get_python_path(workspace) for _, pattern in ipairs({ "*", ".*" }) do local match = vim.fn.glob(path.join(workspace, pattern, "pyvenv.cfg")) if match ~= "" then - return path.join(path.dirname(match), "bin", "python") + return path.join(vim.fs.dirname(match), "bin", "python") end end From 806cff6d230e2400a8992214e134b43a1024ec07 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:35:40 -0800 Subject: [PATCH 112/153] fix(lsp): resolve diagnostic warnings in jdtls configuration - Remove `add_commands` call, jdtls now sets this up automatically. - Update `setup_dap` to include an empty `config_overrides` table, mitigating diagnostic warnings caused by an improperly defined `@type` in the jdtls plugin. --- lua/plugins/lsp/servers/jdtls.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/plugins/lsp/servers/jdtls.lua b/lua/plugins/lsp/servers/jdtls.lua index bce43fe6..8ed2cb17 100644 --- a/lua/plugins/lsp/servers/jdtls.lua +++ b/lua/plugins/lsp/servers/jdtls.lua @@ -48,9 +48,8 @@ local default_attach = require("plugins.lsp.attach") local default_config = require("lspconfig").jdtls.document_config.default_config local function on_attach(client, bufnr) - require("jdtls.setup").add_commands() default_attach(client, bufnr) - jdtls.setup_dap({ hotcodereplace = "auto" }) + jdtls.setup_dap({ hotcodereplace = "auto", config_overrides = {} }) local map = vim.keymap.set map({ "n" }, "", "lua require('jdtls').organize_imports()", { remap = false }) map({ "n", "v" }, "crv", "lua require('jdtls').extract_variable()", { remap = false }) From 4283bce6d45e3bbcb4dc42bb6821f7fed1d7c40b Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:43:31 -0800 Subject: [PATCH 113/153] fix(dap): resolve diagnostic warning in pwa_node adapter - Update `vim.fn.input` call to pass the default value as a string instead of a number, addressing type mismatch diagnostic warnings. --- lua/plugins/dap/adapters/pwa_node.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/dap/adapters/pwa_node.lua b/lua/plugins/dap/adapters/pwa_node.lua index eb70528a..0c1df874 100644 --- a/lua/plugins/dap/adapters/pwa_node.lua +++ b/lua/plugins/dap/adapters/pwa_node.lua @@ -41,7 +41,7 @@ table.insert(config, { cwd = vim.fn.getcwd(), sourceMaps = true, port = function() - return vim.fn.input("Select port: ", 9222) + return vim.fn.input("Select port: ", "9222") end, webRoot = "${workspaceFolder}", }) From eedfd5c5981c1b0dd7e226983cf2595c2abf5730 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:47:04 -0800 Subject: [PATCH 114/153] fix(lsp): update deprecated diagnostic method in bashls config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace `vim.diagnostic.disable` with `vim.diagnostic.enable(false, …)` to address deprecation warning from LuaLS. --- lua/plugins/lsp/servers/bashls.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/lsp/servers/bashls.lua b/lua/plugins/lsp/servers/bashls.lua index 4952db60..892e8115 100644 --- a/lua/plugins/lsp/servers/bashls.lua +++ b/lua/plugins/lsp/servers/bashls.lua @@ -6,7 +6,7 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufRead" }, { group = vim.api.nvim_create_augroup("LspEnvFileDiagnostics", {}), pattern = ".env*", callback = function(ev) - vim.diagnostic.disable(ev.buf) + vim.diagnostic.enable(false, { bufnr = ev.buf }) end, }) From 0da4abca685cf27179cadbf94061b9c1c6daa6e8 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:47:21 -0800 Subject: [PATCH 115/153] feat(lsp): disable profile loading in powershell_es initialization - Add `init_options` with `enableProfileLoading` set to `false` to disable profile loading when initializing the PowerShell Editor Services LSP. --- lua/plugins/lsp/servers/powershell_es.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/plugins/lsp/servers/powershell_es.lua b/lua/plugins/lsp/servers/powershell_es.lua index 047ae73d..67226b11 100644 --- a/lua/plugins/lsp/servers/powershell_es.lua +++ b/lua/plugins/lsp/servers/powershell_es.lua @@ -13,6 +13,9 @@ vim.api.nvim_create_autocmd("LspAttach", { }) return { + init_options = { + enableProfileLoading = false, + }, settings = { powershell = { codeFormatting = { From a4d745bd80f5303a8e3b380f6b288a086da80ee5 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 06:53:23 -0800 Subject: [PATCH 116/153] fix(lsp): resolve deprecation warnings in definition handler - Replace `vim.tbl_islist` with `vim.islist` to address deprecation. - Update document jumping to use `vim.lsp.util.show_document` with `{focus=true}`. - Fix parameter type mismatch by updating encoding argument to `"utf-8"`. --- lua/plugins/lsp/handlers/definition.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/plugins/lsp/handlers/definition.lua b/lua/plugins/lsp/handlers/definition.lua index 01ea0476..8548a2c6 100644 --- a/lua/plugins/lsp/handlers/definition.lua +++ b/lua/plugins/lsp/handlers/definition.lua @@ -14,15 +14,15 @@ function M.goto_definition(split_cmd) vim.cmd(split_cmd) end - if vim.tbl_islist(result) then - util.jump_to_location(result[1], "utf8") + if vim.islist(result) then + util.show_document(result[1], "utf-8", { focus = true }) if #result > 1 then - util.set_qflist(util.locations_to_items(result, "utf8")) + util.set_qflist(util.locations_to_items(result, "utf-8")) vim.cmd("copen") vim.cmd("wincmd p") end else - util.jump_to_location(result, "utf8") + util.show_document(result, "utf-8", { focus = true }) end end end From 97b14fa091eea568315aecf0f69e389854502fc1 Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 07:46:45 -0800 Subject: [PATCH 117/153] refactor(util): add KeymapSpec type annotation for keymap definitions - Define `config.KeymapSpec` to provide a clear structure for keymap specifications. - Update `register_keymaps` to use the `config.KeymapSpec[]` type annotation for improved clarity and type checking. --- lua/config/util.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/config/util.lua b/lua/config/util.lua index 7d72a120..87c3f521 100644 --- a/lua/config/util.lua +++ b/lua/config/util.lua @@ -2,9 +2,15 @@ local M = {} +---@class config.KeymapSpec +---@field [1] string|string[] mode +---@field [2] string lhs +---@field [3] string|function rhs +---@field opts? vim.keymap.set.Opts + ---Wrapper to extend options for various keymap definitions ---@param options table|nil default options for keymaps, assign `nil` to use defaults. ----@param keymaps table list of keymap definitions to be applied +---@param keymaps config.KeymapSpec[] list of keymap definitions to be applied function M.register_keymaps(options, keymaps) for _, map in pairs(keymaps) do local mode, lhs, rhs, opts = unpack(map) From c057d2b973080ec6f986de01be38c4faa0f6c46a Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 08:53:48 -0800 Subject: [PATCH 118/153] revert(gitsigns): set sign priority based on signcolumn width --- lua/plugins/gitsigns.lua | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index d2c81484..1768b452 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,22 +1,12 @@ -- gitsigns.nvim | Git integration for buffers -- https://github.com/lewis6991/gitsigns.nvim ----Sets a high sign priority if the signcolumn width is greater than 2. ----@return number? -local priority = function() - local number = tonumber(vim.o.signcolumn:match("^[^:]+:(%d+)$")) - if number and number >= 2 then - return 1000 - end -end - ---@type LazyPluginSpec return { "lewis6991/gitsigns.nvim", event = { "BufReadPost", "BufNewFile" }, dependencies = { "nvim-lua/plenary.nvim" }, opts = { - sign_priority = priority(), attach_to_untracked = true, signs_staged_enable = false, current_line_blame = true, From da7064efb642bf053e3a58eb45e4885b2d199e2e Mon Sep 17 00:00:00 2001 From: daephx Date: Thu, 19 Dec 2024 09:24:01 -0800 Subject: [PATCH 119/153] refactor(git)!: switch gitsigns diffthis keymaps to diffview - Replace gitsigns' `diffthis` keymaps with diffview due to an issue where gitsigns adds extraneous newlines when saving the diff buffer. - Diffview configuration still requires fine-tuning, but this change provides basic functionality. --- lua/plugins/diffview.lua | 5 ++++- lua/plugins/gitsigns.lua | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index a8ad3035..1d7ccc2d 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -4,6 +4,9 @@ ---@type LazyPluginSpec return { "sindrets/diffview.nvim", - cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, + cmd = { "DiffviewOpen" }, + keys = { + { "gd", "DiffviewOpen", desc = "DiffView" }, + }, config = true, } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 1768b452..268bcf1d 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -67,10 +67,10 @@ return { gitsigns.blame_line({ full = true }) end, { desc = "Blame line" }) map("n", "gtb", gitsigns.toggle_current_line_blame, { desc = "Toggle blame line" }) - map("n", "gd", gitsigns.diffthis, { desc = "Diff buffer" }) - map("n", "gD", function() - gitsigns.diffthis("~") - end, { desc = "Diffthis ~" }) + -- map("n", "gd", gitsigns.diffthis, { desc = "Diff buffer" }) + -- map("n", "gD", function() + -- gitsigns.diffthis("~") + -- end, { desc = "Diffthis ~" }) map("n", "gtd", gitsigns.toggle_deleted, { desc = "Toggle deleted" }) -- Text object From 84766b00999a4f9be02bf3c709256ccb2e0f00cd Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 04:20:00 -0800 Subject: [PATCH 120/153] feat(diffview): enhance configuration and usability - Set default highlights for improved colorscheme compatibility. - Add support for disabling diagnostics in merge tool buffers. - Configure file panel to use a list view instead of tree view. - Introduce floating window support for file panels. - Override `select_entry` action to close file panel post-selection. - Auto-close diffview tabs during Vim exit to avoid session saving. - Add custom keymaps: - Close diffview tabs with `gq`. - Close file panel with `q`. - Toggle file panel using `e`. - Map `` and `` to select file panel entries. --- lua/plugins/diffview.lua | 85 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index 1d7ccc2d..773214de 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -1,5 +1,21 @@ -- Diffview.nvim | tabpage interface for easily cycling through diffs -- https://github.com/sindrets/diffview.nvim +---@module "diffview" + +-- Generate a configuration table for a floating window +---@return vim.api.keyset.win_config +local win_config = function() + local width = math.floor(vim.o.columns * 0.6) + local height = math.floor(vim.o.lines * 0.4) + return { + type = "float", + relative = "editor", + width = width, + height = height, + col = math.floor((vim.o.columns - width) / 2), + row = math.floor((vim.o.lines - height) / 2), + } +end ---@type LazyPluginSpec return { @@ -8,5 +24,72 @@ return { keys = { { "gd", "DiffviewOpen", desc = "DiffView" }, }, - config = true, + opts = function() + local actions = require("diffview.actions") + local select_entry = function() + actions.select_entry() + actions.close() + end + return { + file_panel = { + listing_style = "list", + win_config = win_config(), + }, + view = { + merge_tool = { + disable_diagnostics = true, + }, + }, + keymaps = { + view = { + { "n", "gq", actions.close, { desc = "Close Diffview" } }, + { "n", "e", actions.toggle_files, { desc = "Diffview file panel" } }, + }, + file_panel = { + { "n", "", select_entry, { desc = "Select entry" } }, + { "n", "", select_entry, { desc = "Select entry" } }, + { "n", "q", actions.close, { desc = "Close file panel" } }, + { "n", "e", actions.toggle_files, { desc = "Diffview file panel" } }, + }, + file_history_panel = { + { "n", "gq", actions.close, { desc = "Close Diffview" } }, + { "n", "e", actions.toggle_files, { desc = "Diffview file panel" } }, + }, + }, + hooks = { + view_opened = function() + -- Close file panel when initially opening diffview tab + actions.toggle_files() + end, + }, + } + end, + init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + DiffviewStatusModified = { link = "Changed" }, + }) + vim.api.nvim_create_autocmd("WinLeave", { + desc = "Close the Diffview file panel when switching focus back to the diff buffer", + group = vim.api.nvim_create_augroup("Diffview#AutoCloseFilesPanel", { clear = true }), + pattern = "diffview:///panels/*/DiffviewFilePanel", + callback = function(ev) + local winids = vim.fn.win_findbuf(ev.buf) + local filetype = vim.api.nvim_get_option_value("filetype", { buf = ev.buf }) + if #winids > 0 and filetype == "DiffviewFiles" then + vim.api.nvim_win_close(winids[1], false) + end + end, + }) + vim.api.nvim_create_autocmd("VimLeavePre", { + desc = "Close all Diffview tabs when exiting Vim to avoid saving them in sessions", + group = vim.api.nvim_create_augroup("Diffview#AutoClose", { clear = true }), + once = true, + callback = function() + for _, view in ipairs(require("diffview.lib").views) do + view:close() + end + end, + }) + end, } From 311aaabd98b14e4ec232da3a07943419db2c87b2 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 07:04:34 -0800 Subject: [PATCH 121/153] feat(npairs): add custom rules for angle brackets, pipes, and quote - Added angle bracket pair rules for "cs" and "rust" filetypes. - Added pipe pair rules for "go" and "rust" filetypes. - Disabled single quote pairs for lisp-related filetypes ("scheme", "lisp", "clojure"). - Modified single quote pair behavior to prevent pairing after square brackets. --- lua/plugins/autopairs.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua index 8999d9b5..ecb61193 100644 --- a/lua/plugins/autopairs.lua +++ b/lua/plugins/autopairs.lua @@ -47,6 +47,7 @@ return { --- Rules --- local Rule = require("nvim-autopairs.rule") + local conds = require("nvim-autopairs.conds") -- Javascript arrow function npairs.add_rule(Rule("%(.*%)%s*%=>$", " {}", { @@ -55,5 +56,15 @@ return { "typescript", "typescriptreact", }):use_regex(true):set_end_pair_length(1)) + + -- Add angle bracket pairs to filetypes + npairs.add_rule(Rule("<", ">", { "cs", "rust" }):with_move(conds.after_regex("<"))) + + -- Add pipe pairs to filetypes + npairs.add_rule(Rule("|", "|", { "go", "rust" }):with_move(conds.after_regex("|"))) + + -- Disable single quote pairs in lisp filetypes + npairs.get_rules("'")[1].not_filetypes = { "scheme", "lisp", "clojure" } + npairs.get_rules("'")[1]:with_pair(conds.not_after_text("[")) end, } From d22792806a1f9d59ab135ea1a0e2f08f79938e34 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 07:23:06 -0800 Subject: [PATCH 122/153] chore(lsp): remove symbols handler, functionality handled by barbecue plugin The symbols handler was redundant as its functionality has been managed by the barbecue plugin, which relies on nvim-navic. This patch removes the unnecessary handler. --- lua/plugins/lsp/attach.lua | 2 -- lua/plugins/lsp/handlers/symbols.lua | 15 --------------- 2 files changed, 17 deletions(-) delete mode 100644 lua/plugins/lsp/handlers/symbols.lua diff --git a/lua/plugins/lsp/attach.lua b/lua/plugins/lsp/attach.lua index 9c4d4351..d9e8ca16 100644 --- a/lua/plugins/lsp/attach.lua +++ b/lua/plugins/lsp/attach.lua @@ -3,7 +3,6 @@ local format = require("plugins.lsp.handlers.format") local highlight = require("plugins.lsp.handlers.highlight") local hover = require("plugins.lsp.handlers.hover") local keymaps = require("plugins.lsp.keymaps") -local symbols = require("plugins.lsp.handlers.symbols") -- Use an on_attach function to set LSP related actions for -- when the language server attaches to the current buffer @@ -19,7 +18,6 @@ local on_attach = function(client, bufnr) highlight.enable_document_highlighting(client, bufnr) hover.enable_hover_diagnostics(bufnr) keymaps.initialize_keymaps(client, bufnr) - symbols.enable_document_symbols(client, bufnr) end return on_attach diff --git a/lua/plugins/lsp/handlers/symbols.lua b/lua/plugins/lsp/handlers/symbols.lua deleted file mode 100644 index c242c5a0..00000000 --- a/lua/plugins/lsp/handlers/symbols.lua +++ /dev/null @@ -1,15 +0,0 @@ -local M = {} - --- Enable document symbol provider ----@param client table ----@param bufnr integer -M.enable_document_symbols = function(client, bufnr) - local navic_ok, navic = pcall(require, "nvim-navic") - if navic_ok then - if client.server_capabilities.documentSymbolProvider then - navic.attach(client, bufnr) - end - end -end - -return M From b7e709020c4bab817f81608c4be92e51bff48092 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 07:43:27 -0800 Subject: [PATCH 123/153] refactor(lsp): add type hints for on_attach client parameters The primary focus of the change was to add proper type definitions for the client parameter, with no functional behavior changes. However, type warnings prompted the replacement of references to client.config with client.server_capabilities in the handlers/formatting module to check for formatting support, ensuring correct autocmd and user command setup. --- lua/lualine/components/lsp_info.lua | 2 +- lua/plugins/lsp/attach.lua | 2 +- lua/plugins/lsp/handlers/codelens.lua | 2 +- lua/plugins/lsp/handlers/format.lua | 15 ++++++--------- lua/plugins/lsp/handlers/highlight.lua | 2 +- lua/plugins/lsp/keymaps.lua | 1 + 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lua/lualine/components/lsp_info.lua b/lua/lualine/components/lsp_info.lua index 9a12541b..c6abf829 100644 --- a/lua/lualine/components/lsp_info.lua +++ b/lua/lualine/components/lsp_info.lua @@ -51,7 +51,7 @@ local function null_sources(exclude) end ---Helper for get_client_names to evaluate the client names from options table ----@param client table +---@param client vim.lsp.Client ---@return string local function eval_client_name(client, names) local client_name = client.name diff --git a/lua/plugins/lsp/attach.lua b/lua/plugins/lsp/attach.lua index d9e8ca16..71589403 100644 --- a/lua/plugins/lsp/attach.lua +++ b/lua/plugins/lsp/attach.lua @@ -6,7 +6,7 @@ local keymaps = require("plugins.lsp.keymaps") -- Use an on_attach function to set LSP related actions for -- when the language server attaches to the current buffer ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer local on_attach = function(client, bufnr) -- Enable completion triggered by diff --git a/lua/plugins/lsp/handlers/codelens.lua b/lua/plugins/lsp/handlers/codelens.lua index 932932fb..f22a1db0 100644 --- a/lua/plugins/lsp/handlers/codelens.lua +++ b/lua/plugins/lsp/handlers/codelens.lua @@ -1,7 +1,7 @@ local M = {} ---Register autocmd for LSP codelens ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer M.enable_code_lens = function(client, bufnr) local group = vim.api.nvim_create_augroup("LspCodeLens", {}) diff --git a/lua/plugins/lsp/handlers/format.lua b/lua/plugins/lsp/handlers/format.lua index 8c549660..1bb43182 100644 --- a/lua/plugins/lsp/handlers/format.lua +++ b/lua/plugins/lsp/handlers/format.lua @@ -43,21 +43,18 @@ M.format_document = function() end -- Enable document formatting autocmd to trigger on BufWritePre ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer M.enable_auto_format = function(client, bufnr) - -- Prevent formatting if client disabled it - local disabled = ( - client.config - and client.config.capabilities - and client.config.capabilities.documentFormattingProvider == false - ) - -- Apply autocmd if client supports formatting - if not disabled or client.supports_method("textDocument/formatting") then + if + client.server_capabilities.documentFormattingProvider + or client.supports_method("textDocument/formatting") + then -- Add formatting user commands vim.api.nvim_create_user_command("Format", M.format_document, {}) vim.api.nvim_create_user_command("FormatToggle", M.format_toggle, {}) + -- Add autocmd to handle format on save vim.api.nvim_create_autocmd("BufWritePre", { buffer = bufnr, desc = "Apply Auto-formatting for to document on save", diff --git a/lua/plugins/lsp/handlers/highlight.lua b/lua/plugins/lsp/handlers/highlight.lua index 97b0873e..cc13faa2 100644 --- a/lua/plugins/lsp/handlers/highlight.lua +++ b/lua/plugins/lsp/handlers/highlight.lua @@ -4,7 +4,7 @@ local augroup = vim.api.nvim_create_augroup("LspDocumentHighlight", { clear = tr -- Set autocmd for the current buffer to enable and clear document highlight. -- Only sets if the active client supported the textDocument/documentHighlight method. ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer M.enable_document_highlighting = function(client, bufnr) if client.supports_method("textDocument/documentHighlight") then diff --git a/lua/plugins/lsp/keymaps.lua b/lua/plugins/lsp/keymaps.lua index accb45e2..5187125f 100644 --- a/lua/plugins/lsp/keymaps.lua +++ b/lua/plugins/lsp/keymaps.lua @@ -8,6 +8,7 @@ local list_workspace_folders = function() end -- Initialize and attach Language Server keymaps to the active buffer +---@param _ vim.lsp.Client ---@param bufnr integer M.initialize_keymaps = function(_, bufnr) local util = require("config.util") From cca96e6b72e50b70c0fdcf0cf0329c6e78c4c7a0 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 07:53:01 -0800 Subject: [PATCH 124/153] chore(lsp): remove unnecessary explicit type hints in format handler Removed redundant type annotations for variables in the lsp/handlers/format module that were previously required due to uncertain type return values. No functional changes. --- lua/plugins/lsp/handlers/format.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/plugins/lsp/handlers/format.lua b/lua/plugins/lsp/handlers/format.lua index 1bb43182..48581bb5 100644 --- a/lua/plugins/lsp/handlers/format.lua +++ b/lua/plugins/lsp/handlers/format.lua @@ -10,7 +10,7 @@ end -- Toggle document formatting on save M.format_toggle = function() if vim.b.autoformat == false then - vim.b.autoformat = nil ---@type boolean|nil + vim.b.autoformat = nil M.autoformat = true else M.autoformat = not M.autoformat @@ -24,11 +24,11 @@ end -- Activate document formatting filter to select a preferred formatter M.format_document = function() - local bufnr = vim.api.nvim_get_current_buf() ---@type integer + local bufnr = vim.api.nvim_get_current_buf() if vim.b.autoformat == false then return end - local ft = vim.bo[bufnr].filetype ---@type string + local ft = vim.bo[bufnr].filetype local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0 vim.lsp.buf.format({ From 9bb9720de82e49ea7c3143d2e625607544d6c88a Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 07:57:16 -0800 Subject: [PATCH 125/153] feat(gitsigns): add prefix symbol to current_line_blame_formatter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a square bullet (■) at the start of the blame formatter to visually distinguish the blame information in the virtual text. --- lua/plugins/gitsigns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 268bcf1d..a6444219 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -10,7 +10,7 @@ return { attach_to_untracked = true, signs_staged_enable = false, current_line_blame = true, - current_line_blame_formatter = " , - - ", + current_line_blame_formatter = "■ , - : ", signs = { add = { text = "▎" }, change = { text = "▎" }, From b974e25219bef7dc00279b8913e45eb3abc7ac01 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 08:03:58 -0800 Subject: [PATCH 126/153] feat(lsp): rework and reorganize keymaps, add compatibility for 0.11+ Reworked LSP keymaps with updated bindings and reorganization for clarity. Some keymaps were modified or removed, while new ones were added. Added compatibility handling for Neovim 0.11+ to prevent errors when switching between stable (0.10.2) and nightly (0.11) versions. This will be removed once stable packages are updated. --- lua/plugins/lsp/keymaps.lua | 49 +++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/lua/plugins/lsp/keymaps.lua b/lua/plugins/lsp/keymaps.lua index 5187125f..d6f06dc9 100644 --- a/lua/plugins/lsp/keymaps.lua +++ b/lua/plugins/lsp/keymaps.lua @@ -2,38 +2,51 @@ local format = require("plugins.lsp.handlers.format") local M = {} --- Display buffer workspace folders -local list_workspace_folders = function() - vim.print(vim.lsp.buf.list_workspace_folders()) -end - -- Initialize and attach Language Server keymaps to the active buffer ---@param _ vim.lsp.Client ---@param bufnr integer M.initialize_keymaps = function(_, bufnr) local util = require("config.util") local opts = { buffer = bufnr, remap = false, silent = true } + + -- stylua: ignore util.register_keymaps(opts, { + { "n", "cl", "LspInfo", desc = "Open LspInfo" }, + -- See `:help vim.lsp.*` for documentation on any of the below functions - { "n", "", vim.lsp.buf.signature_help, { desc = "Signature Help" } }, - { "n", "D", vim.lsp.buf.type_definition, { desc = "Show type definitions" } }, - { "n", "de", vim.diagnostic.open_float, { desc = "Open diagnostic float" } }, - { "n", "dq", vim.diagnostic.setloclist, { desc = "Diagnostic loclist" } }, - { "n", "rn", vim.lsp.buf.rename, { desc = "Rename reference" } }, - { "n", "wa", vim.lsp.buf.add_workspace_folder, { desc = "Add workspace folder" } }, - { "n", "wl", list_workspace_folders, { desc = "Show workspace folders" } }, - { "n", "wr", vim.lsp.buf.remove_workspace_folder, { desc = "Remove workspace folder" } }, - { "n", "K", vim.lsp.buf.hover, { desc = "Show hover diagnostic" } }, - { "n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" } }, - { "n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" } }, { "n", "gD", vim.lsp.buf.declaration, { desc = "Goto declaration" } }, - { "n", "ga", vim.lsp.buf.code_action, { desc = "Code actions" } }, { "n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" } }, { "n", "gi", vim.lsp.buf.implementation, { desc = "Goto implementation" } }, { "n", "gr", vim.lsp.buf.references, { desc = "Goto references" } }, + { "n", "gy", vim.lsp.buf.type_definition, { desc = "Show type definitions" } }, - { { "n", "v" }, "gf", format.format_document, { remap = true, desc = "Format document" } }, + { "i", "", vim.lsp.buf.signature_help, { desc = "Signature Help" } }, + { "n", "K", vim.lsp.buf.hover, { desc = "Show hover diagnostic" } }, + { "n", "gK", vim.lsp.buf.signature_help, { desc = "Signature Help" } }, + + { "n", "cC", vim.lsp.codelens.refresh, { desc = "Refresh & Display Codelens" } }, + { "n", "cr", vim.lsp.buf.rename, { desc = "Rename" } }, + + { { "n", "v" }, "cF", format.format_toggle, { remap = true, desc = "Toggle format" } }, + { { "n", "v" }, "ca", vim.lsp.buf.code_action, { desc = "Code Action" } }, + { { "n", "v" }, "cc", vim.lsp.codelens.run, { desc = "Run Codelens" } }, + { { "n", "v" }, "cf", format.format_document, { remap = true, desc = "Format document" } }, }) + + -- TODO: Compatibility for Neovim 0.11+; remove when stable packages are updated. + if vim.fn.has("nvim-0.11") == 1 then + -- stylua: ignore + util.register_keymaps(opts, { + { "n", "[d", function() vim.diagnostic.jump({ count = -1, float = true }) end, { desc = "Previous diagnostic" } }, + { "n", "]d", function() vim.diagnostic.jump({ count = 1, float = true }) end, { desc = "Next diagnostic" } }, + + ---@diagnostic disable-next-line: redundant-parameter + { "n", "", function() vim.lsp.buf.signature_help({ border = vim.g.border }) end, { desc = "Signature Help" } }, + + ---@diagnostic disable-next-line: redundant-parameter + { "n", "K", function() vim.lsp.buf.hover({ border = vim.g.border }) end, { desc = "Show hover diagnostic" } }, + }) + end end return M From a305459e990a68bc3a2ad3b952fc93995ed6cba0 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 20 Dec 2024 08:12:57 -0800 Subject: [PATCH 127/153] fix(cmp): lower priority of cmdline sources to reduce noise Reordered cmdline sources to prioritize path and `nvim_lua` suggestions over cmdline results. This change reduces the noise in the completion list, ensuring more relevant suggestions appear first. --- lua/plugins/cmp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index d3749369..8a596eba 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -229,10 +229,10 @@ return { cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = "cmdline" }, { name = "nvim_lua" }, - }, { { name = "path", option = { trailing_slash = true } }, + }, { + { name = "cmdline" }, }, { { name = "cmdline_history" }, }), From acec3b5912165136c0a594bfd22a9c90df47c60f Mon Sep 17 00:00:00 2001 From: daephx Date: Sat, 21 Dec 2024 00:46:04 -0800 Subject: [PATCH 128/153] fix(colors): update ayu highlight overrides for merge behavior Adapt local highlight overrides in ayu to reflect the recent upstream change where `overrides` now merge with default definitions instead of clearing them. Explicitly set `none` for specific groups attributes to ensure transparency is applied. --- lua/plugins/colors/ayu.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/plugins/colors/ayu.lua b/lua/plugins/colors/ayu.lua index 896e5420..ef544c7e 100644 --- a/lua/plugins/colors/ayu.lua +++ b/lua/plugins/colors/ayu.lua @@ -14,10 +14,10 @@ return { local overrides = { -- General Comment = { fg = c.comment }, - CursorLineNr = { fg = c.accent }, - Error = { fg = c.error }, + CursorLineNr = { fg = c.accent, bg = "none", bold = true }, + Error = { fg = c.error, bg = "none" }, FloatBorder = { fg = "#394050" }, - FoldColumn = { fg = c.fg_idle }, + FoldColumn = { fg = c.fg_idle, bg = "none" }, Folded = { fg = c.fg_idle, bg = "#2a2a2a" }, IncSearch = { fg = c.bg, bg = c.special }, LineNr = { fg = c.fg_idle }, @@ -25,13 +25,15 @@ return { NonText = { fg = c.guide_active }, Normal = { bg = "none" }, NormalFloat = { link = "Normal" }, - PmenuSel = { bg = c.selection_inactive }, + PmenuSel = { fg = "none", bg = c.selection_inactive, reverse = false }, SignColumn = { bg = "none" }, + StatusLine = { bg = "none" }, Underlined = { fg = c.accent, underline = true }, + VertSplit = { link = "WinSeparator" }, Visual = { bg = c.selection_bg }, WinBar = { link = "Normal" }, WinBarNC = { link = "Normal" }, - WinSeparator = { fg = c.guide_normal }, + WinSeparator = { fg = c.guide_normal, bg = "none" }, -- Diff DiffDelete = { fg = c.vcs_removed, bg = "#321619" }, From 0f00036a79e14bd4df31bceb9983a11bd5f5e863 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 22 Dec 2024 05:38:01 -0800 Subject: [PATCH 129/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index a918b7c9..e25a7526 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -13,7 +13,7 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flatten.nvim": { "branch": "main", "commit": "e420e531d2ab24aebcf7b3c9fca28e6c5c34964d" }, + "flatten.nvim": { "branch": "main", "commit": "ab2e1085c731dd296a56e9670218083726337df6" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, @@ -22,42 +22,42 @@ "hex.nvim": { "branch": "master", "commit": "fcff75fcf43b5a6c5b471eed65b3a06c412d6020" }, "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, - "kanagawa.nvim": { "branch": "master", "commit": "ad3dddecd606746374ba4807324a08331dfca23c" }, + "kanagawa.nvim": { "branch": "master", "commit": "2d54b56242a6f03c74864d118d61afa1acb5918e" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "material.nvim": { "branch": "main", "commit": "31429eef4b7233ebdae3ddb57b7165ee4f1bd653" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "moonfly": { "branch": "master", "commit": "2e9b34d1b2b3b65a78679b8e7bd856cb769f28a8" }, - "neogit": { "branch": "master", "commit": "f6b96486baad92982c66adbd9bbc42cbfad3741b" }, + "moonfly": { "branch": "master", "commit": "b5d91ed970c037e849c60a05f800c7e1cd9b2952" }, + "neogit": { "branch": "master", "commit": "9ea60f79e370d8f4847efc145e53afe4b0613fc1" }, "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "40dc2e983560acaea29d6312b33fafba37b0c272" }, + "none-ls.nvim": { "branch": "main", "commit": "6f5473ae9e7feb0b40ca95b8ed92e85b42a3c71b" }, "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-cmp": { "branch": "main", "commit": "98e8b9d593a5547c126a39212d6f5e954a2d85dd" }, - "nvim-dap": { "branch": "master", "commit": "567da83810dd9da32f9414d941bc6848715fc102" }, + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, + "nvim-dap": { "branch": "master", "commit": "665d3569a86395fe0dab85efbdb26d7d2ee57e49" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, - "nvim-highlight-colors": { "branch": "main", "commit": "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, + "nvim-highlight-colors": { "branch": "main", "commit": "68a4df620cf58e2c7336e53738e8cf3a522ad694" }, "nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" }, - "nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" }, + "nvim-lspconfig": { "branch": "master", "commit": "ff2b85abaa810f6611233dbe6d31c07510ebf43d" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "fa915a30c5cdf1d18129e9ef6ac2ee0fa799904f" }, - "nvim-treesitter-context": { "branch": "master", "commit": "8fd989b6b457a448606b4a2e51f9161700f609a7" }, + "nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, - "oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "7f47c3297eeed1364be3c6ad915b1df2beb2b2f4" }, + "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, + "oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "5d2edc8937978585881d97a8fec4c2903fa4d72c" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, @@ -76,5 +76,5 @@ "vscode.nvim": { "branch": "main", "commit": "18097b7aa47538afa780c821309c8b992972d726" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }, "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }, - "zk-nvim": { "branch": "main", "commit": "42dc341d897ac4da3d4a9c5c506a36153473f021" } + "zk-nvim": { "branch": "main", "commit": "6beea6fafe2c781cb10e80878e68d5e32937692a" } } From 95b4f8c8d0d895b1f1fcf0bbf488ec51dc2ba4b1 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 05:55:18 -0800 Subject: [PATCH 130/153] feat(colors): continue refinement of builtin colorscheme definitions This change is part of an ongoing effort to iteratively improve highlight definitions for builtin colorschemes using `after/colors` configuration utilities. It refines key highlight groups to enhance visual consistency and compatibility. Themes updated: - blue - darkblue - default - desert - retrobox - slate - sorbet - torte - wildcharm - zaibatsu These updates improve readability, better differentiate UI components, and ensure a consistent appearance across terminal and GUI environments. --- after/colors/blue.lua | 53 ++++++++++++++++++------ after/colors/darkblue.lua | 32 +++++++++++---- after/colors/default.lua | 9 +++-- after/colors/desert.lua | 82 +++++++++++++++++++++++++++++++------- after/colors/retrobox.lua | 24 ++++++++--- after/colors/slate.lua | 42 ++++++++++++------- after/colors/sorbet.lua | 57 ++++++++++++++++---------- after/colors/torte.lua | 31 +++++++------- after/colors/wildcharm.lua | 17 +++++++- after/colors/zaibatsu.lua | 38 +++++++++++++----- 10 files changed, 277 insertions(+), 108 deletions(-) diff --git a/after/colors/blue.lua b/after/colors/blue.lua index d3a93ba9..013b1758 100644 --- a/after/colors/blue.lua +++ b/after/colors/blue.lua @@ -2,29 +2,58 @@ ---@type config.Highlights return { - CurSearch = { link = "IncSearch" }, CursorLine = { ctermbg = 25, bg = "#003562" }, + CursorLineFold = { link = "FoldColumn" }, CursorLineNr = { ctermfg = 87, fg = "#5fffff", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, EndOfBuffer = { ctermfg = 220, fg = "#ffd700" }, - Error = { ctermfg = 209, fg = "#ff7f50" }, - ErrorMsg = { link = "Error" }, FloatBorder = { link = "WinSeparator" }, - Folded = { bg = "Grey12" }, - IncSearch = { ctermfg = 40, bg = "Green" }, - LineNr = { fg = "Grey37" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + LineNr = { ctermfg = 59, fg = "Grey37" }, MatchParen = { bg = "Grey37" }, MsgSeparator = { link = "WinSeparator" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, PmenuSel = { ctermbg = 231, bg = "Turquoise4" }, - Statement = { fg = "Violet" }, + Statement = { ctermfg = 177, fg = "Violet" }, VertSplit = { link = "WinSeparator" }, - Visual = { ctermfg = 231, ctermbg = 30, bg = "Turquoise4" }, + Visual = { ctermfg = 231, ctermbg = 30, fg = "none", bg = "Turquoise4" }, + WinSeparator = { ctermfg = 30, fg = "#008787" }, + + -- Search + CurSearch = { link = "IncSearch" }, + + -- Diagnostics + DiagnosticError = { link = "Error" }, + DiagnosticWarn = { link = "WarningMsg" }, + Error = { ctermfg = 196, fg = "#bb4c4c" }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, + WarningMsg = { ctermfg = 209, fg = "#ff7f50" }, + + -- Git + Added = { ctermfg = 40, fg = "Green3" }, + Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Removed = { ctermfg = 196, fg = "Red" }, -- Diff - DiffAdd = { ctermfg = 231, ctermbg = 65, bg = "#293a29", fg = "none" }, - DiffChange = { ctermfg = 231, ctermbg = 67, bg = "#354b62", fg = "none" }, - DiffDelete = { ctermfg = 231, ctermbg = 133, bg = "#623562", fg = "#af5faf" }, - DiffText = { ctermfg = 16, ctermbg = 251, bg = "#415b7b", fg = "none" }, + DiffAdd = { ctermbg = 4, ctermfg = 40, fg = "none", bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, fg = "none", bg = "#002a4c" }, + DiffDelete = { ctermbg = 131, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, + DiffText = { ctermfg = 16, ctermbg = 23, fg = "none", bg = "#005498" }, + + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, + + -- Neogit + NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, + NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, + NeogitDiffDelete = { ctermbg = 234, ctermfg = 131, fg = "#bb4c4c", bg = "#301414" }, } diff --git a/after/colors/darkblue.lua b/after/colors/darkblue.lua index a9b705c0..b3e79a91 100644 --- a/after/colors/darkblue.lua +++ b/after/colors/darkblue.lua @@ -7,24 +7,33 @@ return { CursorLineFold = { ctermbg = "none", bg = "none" }, CursorLineNr = { ctermfg = 3, fg = "Yellow" }, CursorLineSign = { ctermbg = "none", bg = "none" }, - Error = { ctermfg = 217, fg = "#ffa0a0" }, - ErrorMsg = { link = "Error" }, Folded = { ctermbg = 234, bg = "Grey11" }, IncSearch = { ctermfg = 40, bg = "Green" }, LineNr = { ctermfg = 239, fg = "Grey30" }, MatchParen = { ctermbg = 241, bg = "Grey39" }, MsgSeparator = { link = "WinSeparator" }, + NonText = { ctermfg = 27, fg = "DodgerBlue3" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, Pmenu = { ctermbg = 105, bg = "#00004d" }, PmenuSel = { ctermbg = 59, bg = "Grey32" }, Statement = { ctermfg = 177, fg = "Violet" }, - StatusLine = { ctermfg = 239, ctermbg = 18, fg = "Grey30", bg = "#000040" }, - StatusLineNC = { ctermbg = 18, ctermfg = 239, fg = "Grey30", bg = "#000080" }, + StatusLine = { ctermfg = 233, ctermbg = 18, fg = "Grey30", bg = "#000040" }, + StatusLineNC = { ctermbg = 18, ctermfg = 239, fg = "Grey30", bg = "DarkBlue" }, VertSplit = { link = "WinSeparator" }, Visual = { ctermbg = 105, bg = "#000080" }, WinSeparator = { ctermfg = 239, fg = "Grey30" }, + -- Diagnostics + DiagnosticError = { link = "Error" }, + DiagnosticInfo = { ctermfg = 75, fg = "SteelBlue2" }, + DiagnosticOk = { ctermfg = 40, fg = "Green3" }, + DiagnosticWarn = { link = "WarningMsg" }, + Error = { ctermfg = 196, fg = "#bb4c4c" }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, + WarningMsg = { ctermfg = 209, fg = "#ff7f50" }, + -- Git Added = { ctermfg = 40, fg = "Green3" }, Changed = { ctermfg = 75, fg = "SteelBlue2" }, @@ -33,12 +42,21 @@ return { -- Diff DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, - DiffDelete = { ctermbg = 12, ctermfg = 196, fg = "#bb4c4c" }, + DiffDelete = { ctermbg = 131, ctermfg = 196, fg = "#bb4c4c" }, DiffText = { ctermbg = 23, bg = "#005498" }, + -- Rainbow Delimiter + RainbowDelimiterBlue = { ctermfg = 5, fg = "Blue", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 6, fg = "Cyan", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 2, fg = "Green", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 214, fg = "Orange", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 218, fg = "Pink", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 1, fg = "Red", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 5, fg = "Magenta", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 3, fg = "Yellow", nocombine = true }, + -- Neogit NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, - NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, - NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, + NeogitDiffDelete = { ctermbg = 234, ctermfg = 131, fg = "#bb4c4c", bg = "#301414" }, } diff --git a/after/colors/default.lua b/after/colors/default.lua index 1d5e6653..192168cd 100644 --- a/after/colors/default.lua +++ b/after/colors/default.lua @@ -11,15 +11,16 @@ local colors = { Folded = { ctermbg = 234, bg = "NvimDarkGrey2" }, MsgSeparator = { link = "WinSeparator" }, Normal = { ctermfg = 253, fg = "NvimLightGrey2" }, - PmenuSel = { ctermbg = 254, ctermfg = 16, bg = "NvimLightGrey2", fg = "Black" }, + PmenuSel = { ctermbg = 254, ctermfg = 16, bg = "Grey15", fg = "none" }, Statement = { ctermfg = 177, fg = "Violet" }, StatusLine = { ctermbg = "none", bg = "none" }, Title = { link = "Special" }, Type = { ctermfg = 153, fg = "NvimLightBlue" }, - WinSeparator = { ctermfg = 237, fg = "NvimDarkGrey4" }, + VertSplit = { link = "WinSeparator" }, WinBar = { link = "Normal" }, WinBarNC = { link = "Normal" }, - VertSplit = { link = "WinSeparator" }, + WinSeparator = { ctermfg = 237, fg = "NvimDarkGrey4" }, + QuickfixLine = { link = "PmenuSel" }, -- Git Added = { ctermfg = 157, fg = "NvimLightGreen", bold = true }, @@ -37,7 +38,7 @@ local colors = { ["@lsp.mod.global.lua"] = { ctermfg = 217, fg = "NvimLightRed" }, -- Treesitter - ["@string.special.url.comment"] = { ctermfg = 153, fg = "NvimLightBlue", underline = true }, + ["@string.special.url"] = { ctermfg = 153, fg = "NvimLightBlue", underline = true }, ["@variable"] = { link = "Identifier" }, -- Rainbow Delimiters diff --git a/after/colors/desert.lua b/after/colors/desert.lua index 5ddd79bf..56861239 100644 --- a/after/colors/desert.lua +++ b/after/colors/desert.lua @@ -1,27 +1,79 @@ -- Define colors for builtin colorscheme: desert +local terminal = { + "#000000", + "#cd5c5c", + "#9acd32", + "#bdb76b", + "#75a0ff", + "#ecee00", + "#cd853f", + "#b5b199", + "#565050", + "#ff0000", + "#89fb98", + "#f0e68c", + "#6dceeb", + "#ffde9b", + "#ffa0a0", + "#dbd6b9", +} + +for i = 0, 15 do + vim.g["terminal_color_" .. i] = terminal[i + 1] +end + ---@type config.Highlights return { + ColorColumn = { bg = "#3c1a1a" }, + Comment = { ctermfg = 81, fg = "#6dceeb", italic = true }, + CursorLine = { ctermbg = 237, bg = "#302e28" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, FloatBorder = { link = "WinSeparator" }, - NonText = { fg = "Gray15" }, - SignColumn = { bg = "none" }, - Special = { ctermfg = 147, fg = "LightSteelBlue2" }, + FoldColumn = { link = "LineNr" }, + LineNr = { ctermfg = 239, fg = "#535046" }, + MatchParen = { ctermfg = 16, ctermbg = 236, fg = "none", bg = "#6c673c" }, + NonText = { ctermfg = 66, ctermbg = "none", fg = "#5099b0", bg = "none" }, + Normal = { ctermfg = 187, ctermbg = "none", bg = "none", fg = "LightYellow3" }, + Pmenu = { link = "Normal" }, + SignColumn = { ctermbg = "none", bg = "none" }, + SpecialKey = { link = "Special" }, StatusLine = { ctermfg = 238, fg = "Grey27" }, - StatusLineNC = { ctermfg = 242, ctermbg = 144, fg = "Gray42", bg = "#555238" }, + StatusLineNC = { ctermfg = 242, ctermbg = 144, fg = "Grey42", bg = "#3c3927" }, VertSplit = { link = "WinSeparator" }, - Visual = { ctermbg = 237, bg = "#48442a" }, - WinSeparator = { ctermfg = 144, fg = "#c2bfa5" }, + Visual = { ctermfg = 16, ctermbg = 58, fg = "none", bg = "#5f5f00" }, + WinSeparator = { ctermfg = 144, fg = "#757363" }, + + -- Diagnostics + DiagnosticError = { link = "Error" }, + Error = { ctermfg = 167, fg = "#cd5c5c" }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, + + -- Git + Added = { ctermfg = 113, fg = "#81a635" }, + Changed = { ctermfg = 111, fg = "#cd853f" }, + Removed = { ctermfg = 167, fg = "#cd5c5c" }, -- Diff - Added = { ctermfg = 115, fg = "DarkSeaGreen3" }, - Changed = { ctermfg = 231, fg = "LightSteelBlue3" }, - Removed = { ctermfg = 211, fg = "PaleVioletRed1" }, + DiffAdd = { fg = "none", bg = "#343f20" }, + DiffChange = { fg = "none", bg = "#4d3117" }, + DiffDelete = { fg = "#cd5c5c", bg = "#4d2222" }, + DiffText = { fg = "none", bg = "#734922" }, - DiffAdd = { bg = "#303222" }, - DiffChange = { bg = "#2e3644" }, - DiffDelete = { fg = "PaleVioletRed1" }, - DiffText = { bg = "#5e5838" }, + -- Neogit + NeogitDiffAdd = { fg = "#81a635", bg = "#343f20" }, + NeogitDiffChange = { fg = "#cd853f", bg = "#4d3117" }, + NeogitDiffDelete = { fg = "#cd5c5c", bg = "#4d2222" }, - -- Telescope - TelescopeTitle = { link = "Title" }, + -- Rainbow delimiters + RainbowDelimiterBlue = { ctermfg = 111, fg = "#75a0ff" }, + RainbowDelimiterCyan = { ctermfg = 81, fg = "#6dceeb" }, + RainbowDelimiterGreen = { ctermfg = 113, fg = "#9acd32" }, + RainbowDelimiterOrange = { ctermfg = 173, fg = "#cd853f" }, + RainbowDelimiterPink = { ctermfg = 217, fg = "#ffa0a0" }, + RainbowDelimiterRed = { ctermfg = 167, fg = "#cd5c5c" }, + RainbowDelimiterViolet = { ctermfg = 105, fg = "#7e74ff" }, + RainbowDelimiterYellow = { ctermfg = 226, fg = "#eeee00" }, } diff --git a/after/colors/retrobox.lua b/after/colors/retrobox.lua index 7fe53e00..07c968c4 100644 --- a/after/colors/retrobox.lua +++ b/after/colors/retrobox.lua @@ -3,11 +3,13 @@ ---@type config.Highlights local colors = { ColorColumn = { ctermbg = 233, bg = "Grey7" }, + CursorLineFold = { link = "FoldColumn" }, CursorLineNr = { ctermfg = 215, fg = "#fabd2f", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, - Error = { ctermfg = 203, ctermbg = 234, fg = "#fb4934", bg = "#1c1c1c", bold = true }, + Error = { ctermfg = 203, fg = "#fb4934", bold = true }, ErrorMsg = { link = "Error" }, FloatBorder = { link = "WinSeparator" }, + FoldColumn = { ctermbg = "none", bg = "none" }, Folded = { ctermbg = 234, bg = "Grey12" }, IncSearch = { ctermbg = 208, ctermfg = 234, bg = "#fe8019", fg = "Grey11" }, MsgSeparator = { link = "WinSeparator" }, @@ -16,8 +18,8 @@ local colors = { Operator = { ctermfg = 208, fg = "#fe8019" }, SignColumn = { ctermbg = "none", bg = "none" }, StatusLine = { ctermfg = 246, fg = "#a89984" }, - WinSeparator = { ctermfg = 238, fg = "Grey32" }, Visual = { ctermbg = 238, bg = "#47403a" }, + WinSeparator = { ctermfg = 238, fg = "Grey32" }, -- Git Added = { ctermfg = 142, fg = "#b8bb26" }, @@ -25,10 +27,10 @@ local colors = { Changed = { ctermfg = 208, fg = "#fe8019" }, -- Diff - DiffAdd = { ctermfg = 142, ctermbg = 235, bg = "#2c2c07" }, - DiffChange = { ctermfg = 208, ctermbg = 235, bg = "#2a3531" }, - DiffDelete = { ctermfg = 203, ctermbg = 235, bg = "#47140e", fg = "#ae3224" }, - DiffText = { ctermfg = 208, ctermbg = 235, bg = "#3a4844" }, + DiffAdd = { ctermfg = 142, ctermbg = 235, fg = "none", bg = "#3e400b" }, + DiffChange = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#643209" }, + DiffDelete = { ctermfg = 203, ctermbg = 235, fg = "#fb4934", bg = "#47140e" }, + DiffText = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#8c4309" }, -- Rainbow Delimiter RainbowDelimiterBlue = { ctermfg = 108, fg = "#83a598", nocombine = true }, @@ -42,8 +44,18 @@ local colors = { -- Don't modify Normal if background is set to light mode. if vim.o.background == "light" then + colors.ColorColumn = nil + colors.FoldColumn = nil + colors.Folded = nil colors.Normal = nil colors.StatusLine = nil + colors.Visual = nil + + -- Diff + colors.DiffAdd = { ctermfg = 142, ctermbg = 235, fg = "none", bg = "#ebeda1" } + colors.DiffChange = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#f5c39b" } + colors.DiffDelete = { ctermfg = 160, ctermbg = 235, fg = "#cb1904", bg = "#febab3" } + colors.DiffText = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#f5ac72" } end return colors diff --git a/after/colors/slate.lua b/after/colors/slate.lua index 30482e1f..23745d10 100644 --- a/after/colors/slate.lua +++ b/after/colors/slate.lua @@ -2,33 +2,45 @@ ---@type config.Highlights return { - CursorLine = { bg = "Gray15" }, - CursorLineNr = { fg = "#d7d787" }, + ColorColumn = { ctermbg = 234, bg = "#232315" }, + CursorLine = { ctermbg = 235, bg = "Grey15" }, + CursorLineNr = { ctermfg = 186, fg = "#d7d787" }, CursorLineSign = { ctermbg = "none", bg = "none" }, FloatBorder = { link = "WinSeparator" }, - Folded = { bg = "Gray12" }, - NonText = { fg = "Gray25" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + NonText = { ctermfg = 238, fg = "Grey27" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, Pmenu = { ctermbg = "none", bg = "none" }, + PmenuThumb = { ctermbg = 186, bg = "#d7d787" }, SignColumn = { ctermbg = "none", bg = "none" }, - Statement = { fg = "Violet" }, - StatusLineNC = { bg = "Gray15" }, + Statement = { ctermfg = 177, fg = "Violet" }, + StatusLineNC = { ctermbg = 235, bg = "Grey15" }, Structure = { ctermfg = 64, fg = "#5f8700" }, - WinSeparator = { fg = "Gray32" }, - Visual = { ctermfg = 186, ctermbg = 64, fg = "#d7d787", bg = "#5f8700" }, VertSplit = { link = "WinSeparator" }, + Visual = { ctermfg = 186, ctermbg = 64, fg = "#d7d787", bg = "#5f8700" }, + WinSeparator = { ctermfg = 186, fg = "#d7d787" }, + + -- Search + CurSearch = { link = "IncSearch" }, + IncSearch = { ctermfg = 16, ctermbg = 46, fg = "Black", bg = "#5f8700" }, + Search = { ctermfg = 16, ctermbg = 173, fg = "Black", bg = "#d7875f" }, -- Git - Added = { ctermfg = 40, fg = "Green3" }, - Changed = { ctermfg = 75, fg = "SteelBlue2" }, - Removed = { ctermfg = 196, fg = "Red" }, + Added = { ctermfg = 40, fg = "#6fa000" }, + Changed = { ctermfg = 75, fg = "#5980cc" }, + Removed = { ctermfg = 196, fg = "#b448ac" }, -- Diff - DiffAdd = { ctermfg = 231, ctermbg = 65, fg = "#ffffff", bg = "#5f875f" }, - DiffChange = { ctermfg = 231, ctermbg = 67, fg = "#ffffff", bg = "#5f87af" }, - DiffDelete = { ctermfg = 231, ctermbg = 133, fg = "#ffffff", bg = "#af5faf" }, - DiffText = { ctermfg = 16, ctermbg = 251, fg = "Black", bg = "#c6c6c6" }, + DiffAdd = { ctermfg = 231, ctermbg = 65, fg = "none", bg = "#1f381f" }, + DiffChange = { ctermfg = 231, ctermbg = 67, fg = "none", bg = "#243443" }, + DiffDelete = { ctermfg = 231, ctermbg = 133, fg = "#9c3f95", bg = "#3c203c" }, + DiffText = { ctermfg = 16, ctermbg = 251, fg = "none", bg = "#525252" }, + + -- Neogit + NeogitDiffAdd = { ctermfg = 231, ctermbg = 65, fg = "#5f8700", bg = "#1f381f" }, + NeogitDiffChange = { ctermfg = 231, ctermbg = 67, fg = "#5f87d7", bg = "#243443" }, + NeogitDiffDelete = { ctermfg = 231, ctermbg = 133, fg = "#9c3f95", bg = "#3c203c" }, -- Rainbow Delimiter RainbowDelimiterBlue = { ctermfg = 68, fg = "#5f87d7", nocombine = true }, diff --git a/after/colors/sorbet.lua b/after/colors/sorbet.lua index 00878b94..1eb5d579 100644 --- a/after/colors/sorbet.lua +++ b/after/colors/sorbet.lua @@ -3,25 +3,36 @@ ---@type config.Highlights return { CursorLine = { ctermbg = 237, bg = "#2f3347" }, - CursorLineNr = { fg = "#d7af5f", bold = true }, - Error = { ctermfg = 203, fg = "#ff5f5f", bold = true }, - ErrorMsg = { link = "Error" }, + CursorLineNr = { ctermfg = 179, fg = "#d7af5f", bold = true }, FloatBorder = { link = "WinSeparator" }, - NonText = { ctermfg = 60, fg = "#575c84" }, + MsgSeparator = { link = "WinSeparator" }, + NonText = { ctermfg = 60, fg = "#7076aa" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, Pmenu = { ctermbg = 236, bg = "#2e2e30" }, PmenuSel = { ctermfg = 15, ctermbg = 60, fg = "White", bg = "MediumPurple4" }, + SpellCap = { link = "SpellBad" }, Statement = { ctermfg = 177, fg = "Violet" }, StatusLine = { ctermbg = "none", ctermfg = 8, fg = "Grey" }, - StatusLineNC = { ctermfg = 60, ctermbg = 16, fg = "MediumPurple4", bg = "Grey0", reverse = false }, - Underlined = { ctermfg = 73, fg = "#5fafaf", underline = true }, + StatusLineNC = { ctermfg = 60, ctermbg = 16, fg = "MediumPurple4", bg = "Grey0" }, + Title = { ctermfg = 73, fg = "#5fafaf" }, + Underlined = { ctermfg = 73, fg = "CadetBlue", underline = true }, + VertSplit = { link = "WinSeparator" }, Visual = { ctermbg = 94, bg = "#523c18" }, + WinSeparator = { ctermfg = 60, fg = "#5f5f87" }, + + -- Diagnostics + DiagnosticError = { ctermfg = 203, fg = "#d75f5f" }, + DiagnosticWarn = { ctermfg = 214, fg = "#d7af5f" }, + Error = { ctermfg = 203, fg = "#d75f5f", bold = true }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, + WarningMsg = { ctermfg = 214, fg = "#d7af5f" }, -- Search CurSearch = { link = "IncSearch" }, - IncSearch = { ctermfg = 214, ctermbg = 16, fg = "#ffaf00", bg = "#000000" }, - Search = { ctermfg = 39, ctermbg = 16, fg = "#00afff", bg = "#000000" }, + IncSearch = { ctermbg = 214, ctermfg = 16, bg = "#d7af5f", fg = "Black" }, + Search = { ctermbg = 39, ctermfg = 16, bg = "#5fafaf", fg = "Black" }, -- Git Added = { ctermfg = 113, fg = "#87d75f" }, @@ -29,24 +40,28 @@ return { Removed = { ctermfg = 167, fg = "#d75f5f" }, -- Diff - DiffAdd = { ctermbg = 35, bg = "#004e2a" }, - DiffChange = { ctermbg = 111, bg = "#202a3e" }, - DiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#d75f5f" }, - DiffText = { ctermbg = 213, bg = "#3a4772" }, + DiffAdd = { ctermfg = 16, ctermbg = 35, fg = "none", bg = "#253a1a" }, + DiffChange = { ctermfg = 16, ctermbg = 111, fg = "none", bg = "#202a3e" }, + DiffDelete = { ctermfg = 167, ctermbg = 52, fg = "#d75f5f", bg = "#301414" }, + DiffText = { ctermfg = 16, ctermbg = 213, fg = "none", bg = "#3a4772" }, -- Neogit - NeogitDiffAdd = { ctermbg = 236, ctermfg = 113, bg = "#004e2a", fg = "#87d75f" }, + NeogitDiffAdd = { ctermbg = 236, ctermfg = 113, bg = "#253a1a", fg = "#87d75f" }, NeogitDiffChange = { ctermbg = 236, ctermfg = 110, bg = "#202a3e", fg = "#87afd7" }, NeogitDiffDelete = { ctermbg = 52, ctermfg = 167, bg = "#301414", fg = "#d75f5f" }, NeogitDiffText = { ctermbg = 213, bg = "#3a4772" }, + NeogitHunkHeader = { ctermbg = 60, bg = "#533f7d" }, + NeogitCommitViewHeader = { ctermbg = 60, bg = "#533f7d" }, + NeogitActiveItem = { link = "Visual" }, + NeogitDiffContextHighlight = { fg = "Red" }, -- Rainbow Delimiters - RainbowDelimiterBlue = { fg = "#87afd7", nocombine = true }, - RainbowDelimiterCyan = { fg = "#5fafaf", nocombine = true }, - RainbowDelimiterGreen = { fg = "#87d75f", nocombine = true }, - RainbowDelimiterOrange = { fg = "#cc9b6e", nocombine = true }, - RainbowDelimiterPink = { fg = "#c46cc4", nocombine = true }, - RainbowDelimiterRed = { fg = "#d75f5f", nocombine = true }, - RainbowDelimiterViolet = { fg = "#af87d7", nocombine = true }, - RainbowDelimiterYellow = { fg = "#d7af5f", nocombine = true }, + RainbowDelimiterBlue = { ctermfg = 110, fg = "#87afd7", nocombine = true }, + RainbowDelimiterCyan = { ctermfg = 73, fg = "#5fafaf", nocombine = true }, + RainbowDelimiterGreen = { ctermfg = 113, fg = "#87d75f", nocombine = true }, + RainbowDelimiterOrange = { ctermfg = 179, fg = "#cc9b6e", nocombine = true }, + RainbowDelimiterPink = { ctermfg = 170, fg = "#c46cc4", nocombine = true }, + RainbowDelimiterRed = { ctermfg = 167, fg = "#d75f5f", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 140, fg = "#af87d7", nocombine = true }, + RainbowDelimiterYellow = { ctermfg = 179, fg = "#d7af5f", nocombine = true }, } diff --git a/after/colors/torte.lua b/after/colors/torte.lua index 8a870fd5..7de8b63f 100644 --- a/after/colors/torte.lua +++ b/after/colors/torte.lua @@ -2,41 +2,42 @@ ---@type config.Highlights return { - CursorLine = { bg = "Grey15" }, + CursorLine = { ctermbg = 235, bg = "Grey15" }, CursorLineFold = { ctermbg = "none", bg = "none" }, - CursorLineNr = { fg = "Yellow" }, + CursorLineNr = { ctermfg = 3, fg = "Yellow" }, CursorLineSign = { ctermbg = "none", bg = "none" }, FloatBorder = { link = "VertSplit" }, Folded = { ctermbg = 234, bg = "Grey11" }, - NonText = { fg = "Grey25" }, - Normal = { bg = "none" }, + NonText = { ctermfg = 239, fg = "Grey30" }, + Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, Pmenu = { ctermbg = "none", bg = "none" }, PmenuSel = { ctermfg = 16, ctermbg = 226, fg = "Black", bg = "Yellow1" }, StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey15", fg = "White" }, TablineFill = { ctermbg = "none", bg = "none" }, - WinSeparator = { ctermfg = 239, fg = "Grey30" }, + VertSplit = { link = "WinSeparator" }, Visual = { ctermbg = 238, bg = "Grey27" }, + WinSeparator = { ctermfg = 239, fg = "Grey30" }, -- Search CurSearch = { link = "IncSearch" }, - IncSearch = { ctermfg = 40, bg = "Green" }, + IncSearch = { ctermfg = 16, ctermbg = 40, fg = "Black", bg = "Green" }, Search = { ctermbg = 3, ctermfg = 16, bg = "Yellow", fg = "Black" }, -- Git Added = { ctermfg = 40, fg = "Green3" }, - Changed = { ctermfg = 75, fg = "SteelBlue2" }, + Changed = { ctermfg = 75, fg = "Blue" }, Removed = { ctermfg = 196, fg = "Red" }, -- Diff - DiffAdd = { ctermbg = 232, ctermfg = 40, bg = "#0a300a" }, - DiffChange = { ctermbg = 232, ctermfg = 75, bg = "#002a4c" }, - DiffDelete = { ctermbg = 232, ctermfg = 196, fg = "Red" }, - DiffText = { ctermbg = 238, bg = "Grey27" }, + DiffAdd = { ctermfg = 40, ctermbg = 232, fg = "none", bg = "#0a300a" }, + DiffChange = { ctermfg = 75, ctermbg = 232, fg = "none", bg = "#002a4c" }, + DiffDelete = { ctermfg = 196, ctermbg = 232, fg = "#bb4c4c", bg = "#301414" }, + DiffText = { ctermfg = "none", ctermbg = 238, fg = "none", bg = "Grey27" }, -- Neogit - NeogitDiffAdd = { ctermbg = 236, ctermfg = 40, bg = "#0a300a", fg = "Green3" }, - NeogitDiffChange = { ctermbg = 236, ctermfg = 75, bg = "#002a4c" }, - NeogitDiffDelete = { ctermbg = 52, ctermfg = 196, fg = "#bb4c4c", bg = "#301414" }, - NeogitDiffText = { ctermbg = 238, bg = "Grey27" }, + NeogitDiffAdd = { ctermfg = 40, ctermbg = 232, fg = "Green3", bg = "#0a300a" }, + NeogitDiffChange = { ctermfg = 75, ctermbg = 232, fg = "none", bg = "#002a4c" }, + NeogitDiffDelete = { ctermfg = 196, ctermbg = 232, fg = "#bb4c4c", bg = "#301414" }, + NeogitDiffText = { ctermfg = "none", ctermbg = 238, fg = "none", bg = "Grey27" }, } diff --git a/after/colors/wildcharm.lua b/after/colors/wildcharm.lua index 33156c71..cc5d7e7b 100644 --- a/after/colors/wildcharm.lua +++ b/after/colors/wildcharm.lua @@ -3,8 +3,6 @@ ---@type config.Highlights local colors = { CursorLineNr = { ctermfg = 213, fg = "Orchid1", bold = true }, - Error = { ctermfg = 161, fg = "#d7005f" }, - ErrorMsg = { link = "Error" }, MsgSeparator = { link = "WinSeparator" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, @@ -16,6 +14,14 @@ local colors = { Visual = { ctermbg = 25, ctermfg = 16, bg = "#144454" }, WinSeparator = { ctermfg = 240, fg = "#585858" }, + -- Diagnostics + DiagnosticError = { link = "Error" }, + DiagnosticInfo = { ctermfg = 32, fg = "#00afff" }, + DiagnosticOk = { ctermfg = 35, fg = "#00d75f" }, + Error = { ctermfg = 161, fg = "#d7005f" }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, + -- Git Added = { ctermfg = 35, fg = "#00d75f" }, Changed = { ctermfg = 32, fg = "#00afff" }, @@ -41,6 +47,13 @@ local colors = { -- Force transparent background in dark mode. if vim.o.background == "light" then colors.Normal = nil + colors.Visual = { ctermbg = 25, ctermfg = 16, bg = "#abdbeb" } + colors.WinSeparator = { ctermfg = 240, fg = "#a7a7a7" } + + colors.DiffAdd = { ctermfg = "none", ctermbg = 65, fg = "none", bg = "#d1eddf" } + colors.DiffChange = { ctermfg = "none", ctermbg = 59, fg = "none", bg = "#c1dbe1" } + colors.DiffDelete = { ctermfg = 217, ctermbg = 234, fg = "#ff5f87", bg = "#edced5" } + colors.DiffText = { ctermfg = "none", ctermbg = 66, fg = "none", bg = "#adcece" } end return colors diff --git a/after/colors/zaibatsu.lua b/after/colors/zaibatsu.lua index 644c9d69..32032950 100644 --- a/after/colors/zaibatsu.lua +++ b/after/colors/zaibatsu.lua @@ -2,26 +2,37 @@ ---@type config.Highlights return { + CursorLineFold = { link = "FoldColumn" }, CursorLineNr = { ctermfg = 227, fg = "#ffff5f", bold = true }, CursorLineSign = { ctermbg = "none", bg = "none" }, EndOfBuffer = { ctermfg = 147, fg = "#afafff" }, - Error = { ctermbg = 160, ctermfg = 9, bg = "#d70000", fg = "#ff5faf" }, FloatBorder = { link = "WinSeparator" }, Folded = { ctermbg = 235, bg = "#261e34" }, LineNr = { ctermfg = 240, fg = "#4d4d70" }, MatchParen = { ctermbg = 236, bg = "#4d4d70" }, MsgSeparator = { link = "WinSeparator" }, - NonText = { ctermfg = 103, fg = "#878092" }, + NonText = { ctermfg = 103, fg = "#6e5795" }, Normal = { ctermbg = "none", bg = "none" }, NormalFloat = { link = "Normal" }, Pmenu = { ctermbg = 60, bg = "#52416f" }, PmenuSel = { ctermbg = 237, bg = "#362b49" }, StatusLine = { ctermfg = 16, fg = "White" }, StatusLineNC = { ctermbg = 16, ctermfg = 243, bg = "Grey15", fg = "White" }, + TabLine = { link = "StatusLine" }, + TabLineFill = { link = "StatusLine" }, Title = { link = "Special" }, - WinSeparator = { ctermfg = 53, fg = "#362b49" }, - Visual = { ctermbg = 24, bg = "#283851" }, + Underlined = { ctermfg = 118, fg = "#87ff00", underline = true }, VertSplit = { link = "WinSeparator" }, + Visual = { ctermbg = 24, bg = "#3a5277" }, + WinSeparator = { ctermfg = 53, fg = "#362b49" }, + + -- Diagnostics + DiagnosticInfo = { ctermfg = 39, fg = "#00afff" }, + DiagnosticOk = { ctermfg = 118, fg = "#87ff00" }, + DiagnosticWarn = { ctermfg = 214, fg = "#ffaf00" }, + Error = { ctermfg = 205, fg = "#ff5faf" }, + ErrorMsg = { link = "Error" }, + NvimInternalError = { link = "Error" }, -- Search CurSearch = { link = "IncSearch" }, @@ -29,15 +40,15 @@ return { Search = { ctermbg = 123, ctermfg = 16, bg = "#87ffff", fg = "Black" }, -- Git - Added = { ctermfg = 10, fg = "#00d700" }, - Removed = { ctermfg = 9, fg = "#ff5faf" }, + Added = { ctermfg = 118, fg = "#87ff00" }, + Removed = { ctermfg = 205, fg = "#ff5faf" }, Changed = { ctermfg = 14, fg = "#8787ff" }, -- Diff - DiffAdd = { ctermfg = 118, ctermbg = 237, fg = "#87ff00", bg = "#362b49" }, - DiffChange = { ctermfg = 147, ctermbg = 237, fg = "#8787ff", bg = "#362b49" }, - DiffDelete = { ctermfg = 205, ctermbg = 237, fg = "#ff5faf" }, - DiffText = { ctermfg = 189, ctermbg = 237, fg = "#d7d5db", bg = "#362b49" }, + DiffAdd = { ctermfg = 118, ctermbg = 237, fg = "none", bg = "#1a3100" }, + DiffChange = { ctermfg = 147, ctermbg = 237, fg = "none", bg = "#2a2a50" }, + DiffDelete = { ctermfg = 205, ctermbg = 237, fg = "#ff5faf", bg = "#652545" }, + DiffText = { ctermfg = 189, ctermbg = 237, fg = "none", bg = "#3e3e76" }, -- Dap DapStoppedLine = { bg = "#514f27" }, @@ -49,6 +60,11 @@ return { RainbowDelimiterOrange = { ctermfg = 214, fg = "#ffaf00", nocombine = true }, RainbowDelimiterPink = { ctermfg = 219, fg = "#ffafff", nocombine = true }, RainbowDelimiterRed = { ctermfg = 205, fg = "#ff5faf", nocombine = true }, - RainbowDelimiterViolet = { ctermfg = 14, fg = "#8787ff", nocombine = true }, + RainbowDelimiterViolet = { ctermfg = 105, fg = "#8787ff", nocombine = true }, RainbowDelimiterYellow = { ctermfg = 227, fg = "#ffff5f", nocombine = true }, + + -- Neogit + NeogitDiffAdd = { ctermfg = 118, ctermbg = 237, fg = "#87ff00", bg = "#1a3100" }, + NeogitDiffChange = { ctermfg = 147, ctermbg = 237, fg = "#8787ff", bg = "#2a2a50" }, + NeogitDiffDelete = { ctermfg = 205, ctermbg = 237, fg = "#ff5faf", bg = "#652545" }, } From 81ee3932e9bd59d03861d6c19ee2c1ee38aa76ce Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:03:54 -0800 Subject: [PATCH 131/153] feat(colors): refine ayu overrides for improved light mode support Reworked highlight overrides for the ayu colorscheme to better support its light mode variant. Focused on using palette variables to avoid hardcoded values and added conditional light mode-specific adjustments to prevent clashes caused by dark mode-centric definitions. Key updates include: - Adjusted `Folded`, `LineNr`, and `DiffDelete` for better readability. - Improved adaptability with palette-driven overrides. - Enhanced consistency across light and dark variants. This ensures balanced visuals for both modes while respecting ayu's design. --- lua/plugins/colors/ayu.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/plugins/colors/ayu.lua b/lua/plugins/colors/ayu.lua index ef544c7e..be5829a9 100644 --- a/lua/plugins/colors/ayu.lua +++ b/lua/plugins/colors/ayu.lua @@ -16,16 +16,16 @@ return { Comment = { fg = c.comment }, CursorLineNr = { fg = c.accent, bg = "none", bold = true }, Error = { fg = c.error, bg = "none" }, - FloatBorder = { fg = "#394050" }, + FloatBorder = { fg = c.guide_inactive }, FoldColumn = { fg = c.fg_idle, bg = "none" }, - Folded = { fg = c.fg_idle, bg = "#2a2a2a" }, + Folded = { fg = "none", bg = c.guide_normal }, IncSearch = { fg = c.bg, bg = c.special }, - LineNr = { fg = c.fg_idle }, + LineNr = { fg = c.gutter_normal }, MsgSeparator = { link = "WinSeparator" }, NonText = { fg = c.guide_active }, Normal = { bg = "none" }, NormalFloat = { link = "Normal" }, - PmenuSel = { fg = "none", bg = c.selection_inactive, reverse = false }, + PmenuSel = { fg = "none", bg = c.selection_bg, reverse = false }, SignColumn = { bg = "none" }, StatusLine = { bg = "none" }, Underlined = { fg = c.accent, underline = true }, @@ -36,7 +36,7 @@ return { WinSeparator = { fg = c.guide_normal, bg = "none" }, -- Diff - DiffDelete = { fg = c.vcs_removed, bg = "#321619" }, + DiffDelete = { fg = c.vcs_removed, bg = c.vcs_removed_bg }, -- LSP ["@lsp.mod.global.lua"] = { fg = c.markup }, @@ -49,12 +49,17 @@ return { RainbowDelimiterRed = { fg = c.vcs_removed }, RainbowDelimiterViolet = { fg = c.lsp_parameter }, RainbowDelimiterYellow = { fg = c.special }, + + -- DAP + DapStoppedLine = { bg = c.vcs_added_bg }, + + -- Telescope + TelescopePromptBorder = { link = "FloatBorder" }, + TelescopeSelection = { link = "PmenuSel" }, } -- Conditionally override colors for `h background if vim.o.background == "light" then - overrides.DiffDelete = { fg = c.vcs_removed, bg = "#ebecec" } - overrides.Folded = { fg = c.fg_idle, bg = "#c2c2c2" } overrides.Normal = nil else vim.g.terminal_color_8 = "#394050" From fe7fb6c02e07cbc05cc333ef9a9566aa68fb25ef Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:23:16 -0800 Subject: [PATCH 132/153] feat(colors): refine material theme highlight overrides Reworked highlight definitions for the material colorscheme to improve visual consistency. Key updates include: - Linked `FoldColumn` to `NonText` and updated `Folded` background. - Refined `Search` and `IncSearch` colors for better visibility. - Adjusted `WinBar`, `StatusLine`, and `VertSplit` to have no background. - Corrected Treesitter overrides, including `@string.special.url`. - Removed theme plugin for `nvim-tree`. These changes enhance theme clarity and consistency. --- lua/plugins/colors/material.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/plugins/colors/material.lua b/lua/plugins/colors/material.lua index 88d23500..37113ef2 100644 --- a/lua/plugins/colors/material.lua +++ b/lua/plugins/colors/material.lua @@ -30,7 +30,6 @@ return { "neogit", "nvim-cmp", "nvim-navic", - "nvim-tree", "nvim-web-devicons", "telescope", "trouble", @@ -41,7 +40,18 @@ return { -- Overwrite highlights with your own custom_highlights = { CursorLine = { bg = "Grey15" }, + FoldColumn = { link = "NonText" }, + Folded = { bg = "#311d00" }, MsgSeparator = { link = "WinSeparator" }, + StatusLine = { bg = "none" }, + VertSplit = { link = "WinSeparator" }, + WinBar = { bg = "none" }, + WinBarNC = { bg = "none" }, + + -- Search + CurSearch = { link = "IncSearch" }, + IncSearch = { fg = "black", bg = "#ffcb6b", bold = true }, + Search = { fg = "black", bg = "#6bc3ff" }, -- Diff DiffAdd = { bg = "#2c351e" }, @@ -58,7 +68,7 @@ return { -- Treesitter TSField = { link = "TSVariable" }, ["@property"] = { link = "Identifier" }, - ["@string.special.url.comment"] = { fg = c.editor.link, underline = true }, + ["@string.special.url"] = { fg = c.editor.link, underline = true }, -- WhichKey WhichKeyFloat = { link = "StatusLineNC" }, From c6baa80cbf84ee0dbbe59e29caadc4b385488853 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:39:07 -0800 Subject: [PATCH 133/153] feat(colors): refine rose-pine theme highlight overrides Updated highlight definitions for the rose-pine colorscheme, including: - Set `StatusLine`, `WinBar`, and `WinBarNC` backgrounds to `none`. - Reworked `Diff` highlights for better color clarity. - Added custom Git colors for `Added`, `Changed`, and `Removed`. - Refined Neogit highlights, including `NeogitActiveItem` and `NeogitGraphAuthor`. - Removed Rainbow Delimiters and replaced with specific Neogit diffs. - Improved LSP and DAP support with specific highlight updates. These changes improve visual clarity and consistency across the theme. --- lua/plugins/colors/rose-pine.lua | 45 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/lua/plugins/colors/rose-pine.lua b/lua/plugins/colors/rose-pine.lua index 31c54c44..ad7a5339 100644 --- a/lua/plugins/colors/rose-pine.lua +++ b/lua/plugins/colors/rose-pine.lua @@ -59,31 +59,38 @@ return { LineNr = { fg = "highlight_med" }, MatchParen = { bg = "subtle" }, Pmenu = { bg = "surface" }, + StatusLine = { bg = "none" }, Underlined = { fg = "iris", underline = true }, - WinBar = { bg = "none" }, - WinBarNC = { bg = "none" }, + VertSplit = { link = "WinSeparator" }, + WinBar = { bg = "none", inherit = false }, + WinBarNC = { bg = "none", inherit = false }, -- Diff - DiffAdd = { bg = "#2a383a", inherit = false }, - DiffChange = { bg = "#4a3824", inherit = false }, - DiffDelete = { bg = "#381a22", fg = "love", inherit = false }, - DiffText = { bg = "#2e395c", inherit = false }, + DiffAdd = { fg = "none", bg = "#2a383a", inherit = false }, + DiffChange = { fg = "none", bg = "#4a3824", inherit = false }, + DiffDelete = { fg = "love", bg = "#421e28", inherit = false }, + DiffText = { fg = "none", bg = "#2e395c", inherit = false }, + + -- Git + Added = { fg = "foam", bg = "none" }, + Changed = { fg = "gold", bg = "none" }, + Removed = { fg = "love", bg = "none" }, -- Neogit - NeogitDiffAdd = { link = "DiffAdd" }, - NeogitDiffChange = { link = "DiffChange" }, - NeogitDiffDelete = { link = "DiffDelete" }, - NeogitDiffText = { link = "DiffText" }, + NeogitActiveItem = { fg = "gold", bg = "highlight_med" }, + NeogitDiffAdditions = { link = "Added", inherit = false }, + NeogitGraphAuthor = { fg = "leaf" }, + + NeogitDiffAdd = { fg = "foam", bg = "#2a383a", inherit = false }, + NeogitDiffChange = { fg = "gold", bg = "#4a3824", inherit = false }, + NeogitDiffDelete = { fg = "love", bg = "#421e28", inherit = false }, + NeogitDiffText = { fg = "none", bg = "#2e395c", inherit = false }, + + -- LSP + ["@string.special.url"] = { fg = "link", underline = true }, - -- Rainbow Delimiters - RainbowDelimiterBlue = { fg = "foam", nocombine = true }, - RainbowDelimiterCyan = { fg = "foam", nocombine = true }, - RainbowDelimiterGreen = { fg = "iris", nocombine = true }, - RainbowDelimiterOrange = { fg = "gold", nocombine = true }, - RainbowDelimiterPink = { fg = "rose", nocombine = true }, - RainbowDelimiterRed = { fg = "rose", nocombine = true }, - RainbowDelimiterViolet = { fg = "iris", nocombine = true }, - RainbowDelimiterYellow = { fg = "gold", nocombine = true }, + -- DAP + DapStoppedLine = { bg = "#5c482c" }, }, }, } From 713c8ffb8cc4997d0e1f8a8e156de35d7f144797 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:40:33 -0800 Subject: [PATCH 134/153] feat(colors): refine vscode theme highlight definitions - Updated Telescope Selection to use `vscSelection` default highlight. - Enhanced `NeogitCommitViewHeader` with `vscContext` background and bold. - Adjusted `HopUnmatched` to use `vscContext` for improved visibility. These changes improve consistency and clarity in the vscode theme. --- lua/plugins/colors/vscode.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/plugins/colors/vscode.lua b/lua/plugins/colors/vscode.lua index 5f5b00c3..12d53762 100644 --- a/lua/plugins/colors/vscode.lua +++ b/lua/plugins/colors/vscode.lua @@ -98,11 +98,12 @@ return { -- Telescope TelescopePromptPrefix = { fg = c.vscBlue }, - TelescopeSelectionCaret = { bg = c.vscUiBlue, fg = c.vscYellow }, + TelescopeSelection = { bg = c.vscSelection }, + TelescopeSelectionCaret = { bg = c.vscSelection, fg = c.vscYellow }, -- Neogit NeogitBranch = { fg = c.vscYellow }, - NeogitCommitViewHeader = { fg = c.vscBlue }, + NeogitCommitViewHeader = { fg = c.vscBlue, bg = c.vscContext, bold = true }, NeogitDiffAdditions = { fg = c.vscGitAdded }, NeogitObjectId = { fg = c.vscBlueGreen }, NeogitStash = { fg = c.vscViolet }, @@ -113,7 +114,7 @@ return { HopNextKey1 = { fg = c.vscBlue, bold = true }, HopNextKey2 = { fg = c.vscBlueGreen, bold = true }, HopPreview = { link = "IncSearch" }, - HopUnmatched = { fg = c.vscGray }, + HopUnmatched = { fg = c.vscContext }, }, } end, From 30584093ee97033120da352263e1571f4ef6f13e Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:51:23 -0800 Subject: [PATCH 135/153] feat(colors): refine gruvbox theme highlights and background handling - Adjusted `MsgSeparator`, `VertSplit`, and `SignColumn` for clarity. - Linked git highlights (`Added`, `Changed`, `Removed`) to relevant colors. - Improved contrast for diff highlights (`DiffAdd`, `DiffChange`). - `TelescopeSelection` now links to `CursorLine`. Support for `background = light` is functional but limited due to override configuration issues. A future update will address git and diff color contrast. --- lua/plugins/colors/gruvbox.lua | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/lua/plugins/colors/gruvbox.lua b/lua/plugins/colors/gruvbox.lua index 2ac0b750..cfe20ffe 100644 --- a/lua/plugins/colors/gruvbox.lua +++ b/lua/plugins/colors/gruvbox.lua @@ -42,17 +42,21 @@ return { }, palette_overrides = {}, overrides = { - CursorLine = { bg = "#262322" }, CursorLineNr = { bg = "none" }, ErrorMsg = { link = "Error" }, FloatBorder = { link = "GruvboxGray" }, - MsgSeparator = { link = "VertSplit" }, + MsgSeparator = { link = "WinSeparator" }, NormalFloat = { link = "Normal" }, - StatusLine = { bg = "#282828" }, - Visual = { bg = "#47403a" }, + SignColumn = { link = "Normal" }, + VertSplit = { link = "WinSeparator" }, WinBar = { bg = "none" }, WinBarNC = { bg = "none" }, + -- Git + Added = { link = "GruvboxGreen" }, + Changed = { link = "GruvboxBlue" }, + Removed = { link = "GruvboxRed" }, + -- Diff DiffAdd = { ctermfg = 142, ctermbg = 235, fg = "none", bg = "#2c2c07" }, DiffChange = { ctermfg = 208, ctermbg = 235, fg = "none", bg = "#2a3531" }, @@ -73,7 +77,7 @@ return { TelescopePreviewBorder = { link = "FloatBorder" }, TelescopePromptBorder = { link = "FloatBorder" }, TelescopeResultsBorder = { link = "FloatBorder" }, - TelescopeSelection = { bg = "#3c3836", fg = "#fe8019" }, + TelescopeSelection = { link = "CursorLine" }, -- Dap DapUINormal = { link = "Normal" }, @@ -81,7 +85,21 @@ return { }, }, init = function() - require("config.colors").set_hl_autocmd("gruvbox", function(_hl) + vim.api.nvim_create_autocmd({ "ColorSchemePre" }, { + desc = "Enable `transparent_mode` only when background is set to `dark`", + group = vim.api.nvim_create_augroup("Gruvbox#FixBackground", {}), + pattern = "gruvbox", + callback = function() + local is_dark = vim.o.background == "dark" and true or false + local gruvbox = package.loaded["gruvbox"] + if gruvbox ~= nil then + gruvbox.setup({ transparent_mode = is_dark }) + end + end, + }) + + local colors = require("config.colors") + colors.set_hl_autocmd("gruvbox", function() if vim.o.background == "dark" then -- Apply terminal color overrides for i, color in ipairs(terminal) do From bc11d89d304bcb79320c98cb3a68c8f25adc71c6 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 06:54:14 -0800 Subject: [PATCH 136/153] fix(zk): change lazy loading to run on command instead of event - Updated `zk-nvim` plugin to load on command execution (`cmd`) rather than on the `VeryLazy` event. - This ensures `zk` is only loaded when the user explicitly invokes any of the assigned commands, improving startup performance. --- lua/plugins/markdown.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index eb4b76d7..be7f6a70 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -25,7 +25,21 @@ return { { -- Neovim extension for zk "zk-org/zk-nvim", main = "zk", - event = "VeryLazy", + cmd = { + "ZkBacklinks", + "ZkBuffers", + "ZkCd", + "ZkIndex", + "ZkInsertLink", + "ZkInsertLinkAtSelection", + "ZkLinks", + "ZkMatch", + "ZkNew", + "ZkNewFromContentSelection", + "ZkNewFromTitleSelection", + "ZkNotes", + "ZkTags", + }, keys = { { "zb", "ZkBacklinks", desc = "Show backlinks" }, { "zf", "ZkNotes", desc = "Show notes" }, From c7382caf4e88c8a446887a31d4cb95fe1345024e Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 07:05:14 -0800 Subject: [PATCH 137/153] refactor(toggleterm): remove non-standard options from plugin options - Added documentation comments for better clarity and type definitions. - Renamed `applications` to `executables`, for list of binary cmds. - Removed non-standard plugin options to avoid healthcheck warnings. - Removed custom terminal layout configurations in favor of built-in floating or tab terminals. --- lua/plugins/toggleterm.lua | 84 ++++++++------------------------------ 1 file changed, 18 insertions(+), 66 deletions(-) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 702fa77a..748d59fd 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -2,6 +2,7 @@ -- https://github.com/akinsho/toggleterm.nvim ---@module "toggleterm" +---List of custom terminal configurations. ---@type Terminal[] local terminals = {} @@ -32,15 +33,10 @@ local function on_close() end ---Generate custom terminals from user opts. ----@param opts table -local initialize_terminals = function(opts) +---@param executables string[] +local initialize_terminals = function(executables) local Terminal = require("toggleterm.terminal").Terminal - -- Process manually defined terminals - for name, term in pairs(opts.terminals) do - terminals[name] = Terminal:new(term) - end - -- Process basic application terminals - for _, app in pairs(opts.applications) do + for _, app in pairs(executables) do if vim.fn.executable(app) == 1 then local command = app:gsub("^%l", string.upper) terminals[app] = Terminal:new({ cmd = app, direction = "float" }) @@ -51,11 +47,21 @@ local initialize_terminals = function(opts) end end +---Commands will be generate to open apps as floating terminals. +local executables = { + "btop", + "htop", + "ipython", + "lazydocker", + "lazygit", + "node", + "python", +} + ---@type LazyPluginSpec return { "akinsho/toggleterm.nvim", - version = "*", - event = "VeryLazy", + event = { "VeryLazy" }, keys = { { "" }, { "tf", "ToggleTerm direction=float", desc = "Terminal (float)" }, @@ -65,10 +71,11 @@ return { }, config = function(_, opts) require("toggleterm").setup(opts) - initialize_terminals(opts) + initialize_terminals(executables) end, opts = { open_mapping = "", + close_on_exit = true, direction = "float", shade_terminals = false, size = size, @@ -79,60 +86,5 @@ return { NormalFloat = { link = "NormalFloat" }, FloatBorder = { link = "FloatBorder" }, }, - -- Commands will be generate to open apps as floating terminals - applications = { - "btop", - "htop", - "lazydocker", - "lazygit", - }, - -- Manually define terminals for more fine tuning - terminals = { - fullscreen_float = { - direction = "float", - float_opts = { - border = false, - width = vim.o.columns, - height = vim.o.lines, - }, - }, - tab_float = { - direction = "float", - float_opts = { - border = false, - width = vim.o.columns, - height = function(term) - local cmdheight = vim.o.cmdheight - local tabline = vim.o.showtabline ~= 0 and 1 or 0 - if vim.o.showtabline == 1 and vim.fn.tabpagenr("$") < 1 then - tabline = 0 - end - local statusline = vim.o.laststatus ~= 0 and 1 or 0 - local height = vim.o.lines - cmdheight - tabline - statusline - term.float_opts.row = 1 + tabline - 2 - return height - end, - }, - }, - bottom_float = { - direction = "float", - float_opts = { - border = { "", "_", "", "", "", "", "", "" }, - anchor = "SW", - width = vim.o.columns, - height = function(term) - local _, zenmode = pcall(function() - return require("zen-mode.view").is_open() - end) - local height = 20 - local cmdheight = vim.o.cmdheight ~= 0 and vim.o.cmdheight or 0 - local statusheight = vim.o.laststatus ~= 0 and 1 or 0 - local botheight = zenmode == true and 0 or cmdheight + statusheight - term.float_opts.row = vim.o.lines - 1 - height - botheight - return height - end, - }, - }, - }, }, } From bc8e9ed1aaa729c37e24938710cdd4359d43767f Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 07:11:13 -0800 Subject: [PATCH 138/153] fix(neogit): disable default rebase mappings - Disabled default key mappings in the rebase buffer to allow normal Vim editing operations for rebase commands, similar to Fugitive. --- lua/plugins/neogit.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index c038c17b..4dcef62a 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -24,6 +24,19 @@ return { }, popup = { kind = "split" }, commit_popup = { kind = "split_above" }, + mappings = { + rebase_editor = { + ["d"] = false, + ["e"] = false, + ["f"] = false, + ["p"] = false, + ["r"] = false, + ["s"] = false, + ["x"] = false, + -- [""] = "MoveDown", + -- [""] = "MoveUp", + }, + }, }, init = function() -- Alias command `Neogit` to `Git` From d6ca6d3df7c985fefd7e2dd97ea4a172248f6b58 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 07:14:24 -0800 Subject: [PATCH 139/153] fix(neogit): refine highlights for diff and log view - Link NeogitCommitViewDescription to Normal to remove background. - Align NeogitDiffAdditions and NeogitDiffDeletions with Added/Removed. - Apply DiffviewFilePanelInsertions and DiffviewFilePanelDeletions to match Added/Removed for Diffview integration. --- lua/plugins/neogit.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 4dcef62a..2401be09 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -55,8 +55,12 @@ return { -- Set default highlights local colors = require("config.colors") colors.set_hl_autocmd(nil, { - NeogitCommitViewDescription = { link = "Normal" }, - NeogitWinSeparator = { link = "WinSeparator" }, + DiffviewFilePanelDeletions = { link = "Removed", default = true }, + DiffviewFilePanelInsertions = { link = "Added", default = true }, + NeogitCommitViewDescription = { link = "Normal", default = true }, + NeogitDiffAdditions = { link = "Added", default = true }, + NeogitDiffDeletions = { link = "Removed", default = true }, + NeogitObjectId = { link = "Structure", default = true }, }) vim.api.nvim_create_autocmd("FileType", { From 8901df1ab72f361a63965a9f859bd004b55bfab2 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 19:39:39 -0800 Subject: [PATCH 140/153] fix(gitsigns): ensure sign priority respects signcolumn width Restore the sign priority helper function to address issues caused by differences between Neovim stable (0.10.3) and nightly (0.11). These inconsistencies result in gitsigns, todos, and diagnostic signs not appearing in the expected order. This fix ensures gitsigns always occupy the leftmost position in the sign column when the column width is >= 2, preserving visual consistency and expected behavior. --- lua/plugins/gitsigns.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index a6444219..c6d678d9 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,12 +1,23 @@ -- gitsigns.nvim | Git integration for buffers -- https://github.com/lewis6991/gitsigns.nvim +---Sets a high sign priority if the signcolumn width is greater than 2. +---@return number? +local priority = function() + local number = tonumber(vim.o.signcolumn:match("^[^:]+:(%d+)$")) + local is_nvim_11 = vim.fn.has("nvim-0.11") == 1 + if is_nvim_11 and number and number >= 2 then + return 1000 + end +end + ---@type LazyPluginSpec return { "lewis6991/gitsigns.nvim", event = { "BufReadPost", "BufNewFile" }, dependencies = { "nvim-lua/plenary.nvim" }, opts = { + sign_priority = priority(), attach_to_untracked = true, signs_staged_enable = false, current_line_blame = true, From de459057714bf1bd0b9c59303d36fa792ba3ab91 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 19:47:06 -0800 Subject: [PATCH 141/153] refactor(oil): adjust buffer and window options - Sort `buf_options` and `win_options` tables alphabetically - Disable `signcolumn` and `statuscolumn` in oil windows - Increase `max_width` for oil float windows - Add `min_width` for oil preview windows --- lua/plugins/oil.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 41b40dcf..414f842f 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -22,32 +22,37 @@ return { default_file_exporer = true, -- Buffer-local options to use for oil buffers buf_options = { - buflisted = false, bufhidden = "hide", + buflisted = false, }, -- Window-local options to use for oil buffers win_options = { - number = false, - relativenumber = false, - concealcursor = "nvic", colorcolumn = "0", + concealcursor = "nvic", conceallevel = 3, cursorcolumn = false, foldcolumn = "0", + number = false, + relativenumber = false, + signcolumn = "no", + statuscolumn = "", }, view_options = { show_hidden = true, }, -- Configuration for the floating window in oil.open_float float = { - max_width = 114, - max_height = 32, border = vim.g.border, + max_height = 32, + max_width = 155, + win_options = { + winblend = 0, + }, }, -- Configuration for the actions floating preview window preview = { border = vim.g.border, - width = 0.5, + min_width = { 50, 0.5 }, }, -- Configuration for the floating progress window progress = { From c7ec3d28d0c25cc6e4dc9060ed1badd1bd99f92a Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 20:00:52 -0800 Subject: [PATCH 142/153] feat(oil): add toggle for file details and highlights - Add ability to toggle file details like permissions, size, and modification time in the oil buffer using the `gd` keymap. - Apply custom highlights to file permissions for improved clarity. --- lua/plugins/oil.lua | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 414f842f..659005ee 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -2,6 +2,48 @@ -- https://github.com/stevearc/oil.nvim ---@module "oil" +-- Mapping of file permission characters to their respective highlight groups. +-- Used to apply syntax highlighting to each character in a permission string. +local permission_hlgroups = { + ["-"] = "NonText", + ["r"] = "DiagnosticSignWarn", + ["w"] = "DiagnosticSignError", + ["x"] = "DiagnosticSignOk", +} + +---Generate highlight groups for file permissions. +---Maps each character in the permission string to a highlight group +---based on the `permission_hlgroups` table. +---@param perm string Permission string (e.g., "rwxr-xr-x") +---@return table +local permission_highlights = function(perm) + local hls = {} + for i = 1, #perm do + local char = perm:sub(i, i) + table.insert(hls, { permission_hlgroups[char], i - 1, i }) + end + return hls +end + +-- Tracks whether the details view is currently enabled +local details_enabled = false + +-- Toggle file permission details in the Oil plugin. +-- Adds or removes columns like permissions, size, and mtime. +local enable_details = function() + details_enabled = not details_enabled + if not details_enabled then + require("oil").set_columns({ "icon", add_padding = false }) + else + require("oil").set_columns({ + { "permissions", highlight = permission_highlights }, + { "size", highlight = "Special" }, + { "mtime", highlight = "Number" }, + { "icon", add_padding = false }, + }) + end +end + ---@type LazyPluginSpec return { "stevearc/oil.nvim", @@ -20,6 +62,13 @@ return { end, opts = { default_file_exporer = true, + -- Keymaps in oil buffer. + keymaps = { + ["gd"] = { + desc = "Toggle file detail view", + callback = enable_details, + }, + }, -- Buffer-local options to use for oil buffers buf_options = { bufhidden = "hide", From 3de630164ea5ce3275596643c6f0716c379016d0 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 20:03:05 -0800 Subject: [PATCH 143/153] fix(oil): change keymap to open relative to active buffer - Update keymap description for `e`. - Remove `.` from the `Oil` command to open relative to the active buffer instead of the working directory. --- lua/plugins/oil.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 659005ee..e3c4816c 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -50,7 +50,7 @@ return { dependencies = { "nvim-tree/nvim-web-devicons" }, cmd = { "Oil" }, keys = { - { "e", "Oil --float .", desc = "Open file explorer" }, + { "e", "Oil --float", desc = "File explorer" }, }, init = function() -- Set custom vim style explorer commands From 88ad89aab295aaa549bf7221a93a4ddc60074a54 Mon Sep 17 00:00:00 2001 From: daephx Date: Fri, 27 Dec 2024 20:04:45 -0800 Subject: [PATCH 144/153] feat(oil): enable opening as file explorer on startup - Allow `Oil` to open automatically when Neovim is launched with a directory argument (e.g., `nvim .`). - Use an `UIEnter` autocmd to handle lazy-loaded initialization. --- lua/plugins/oil.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index e3c4816c..a6c1b62a 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -59,6 +59,18 @@ return { create_command("Sexplore", "belowright split | Oil ", { nargs = "?", complete = "dir" }) create_command("Vexplore", "rightbelow vsplit | Oil ", { nargs = "?", complete = "dir" }) create_command("Texplore", "tabedit % | Oil ", { nargs = "?", complete = "dir" }) + + -- HACK: Due to lazy-loading, the plugin is not available during the `VimEnter` event + -- which breaks the ability to launch directories via `nvim $PWD` + vim.api.nvim_create_autocmd({ "UIEnter" }, { + desc = "Open file explorer when launching neovim with a directory path", + group = vim.api.nvim_create_augroup("Oil#OpenDirectory", { clear = true }), + callback = function(ev) + if vim.fn.isdirectory(ev.file) == 1 then + require("oil").open(ev.file) + end + end, + }) end, opts = { default_file_exporer = true, From 70ade50679d193e3a51ea57dec2a29cc7345b25d Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 29 Dec 2024 23:42:57 -0800 Subject: [PATCH 145/153] feat(oil): add Fexplore command and improve lazy-loading - Add `Fexplore` for floating window file explorer. - Update `cmd` table to enable lazy-loading via Lazy.nvim. - Refactor custom command definitions using `cmd_opts`. --- lua/plugins/oil.lua | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index a6c1b62a..ce976f87 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -48,18 +48,17 @@ end return { "stevearc/oil.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, - cmd = { "Oil" }, + cmd = { + "Oil", + "Explore", + "Fexplore", + "Sexplore", + "Vexplore", + }, keys = { { "e", "Oil --float", desc = "File explorer" }, }, init = function() - -- Set custom vim style explorer commands - local create_command = vim.api.nvim_create_user_command - create_command("Explore", "Oil ", { nargs = "?", complete = "dir" }) - create_command("Sexplore", "belowright split | Oil ", { nargs = "?", complete = "dir" }) - create_command("Vexplore", "rightbelow vsplit | Oil ", { nargs = "?", complete = "dir" }) - create_command("Texplore", "tabedit % | Oil ", { nargs = "?", complete = "dir" }) - -- HACK: Due to lazy-loading, the plugin is not available during the `VimEnter` event -- which breaks the ability to launch directories via `nvim $PWD` vim.api.nvim_create_autocmd({ "UIEnter" }, { @@ -72,6 +71,18 @@ return { end, }) end, + config = function(_, opts) + require("oil").setup(opts) + + -- Set custom vim style explorer commands + local cmd_opts = { nargs = "?", complete = "dir" } + local create_command = vim.api.nvim_create_user_command + create_command("Explore", "Oil ", cmd_opts) + create_command("Fexplore", "Oil --float ", cmd_opts) + create_command("Sexplore", "belowright split | Oil ", cmd_opts) + create_command("Texplore", "tabedit % | Oil ", cmd_opts) + create_command("Vexplore", "rightbelow vsplit | Oil ", cmd_opts) + end, opts = { default_file_exporer = true, -- Keymaps in oil buffer. From 4a749d0e12985482f51d1c1cde581e6247adda82 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 29 Dec 2024 23:44:05 -0800 Subject: [PATCH 146/153] feat(oil): add custom keymaps for preview window actions - Map `` and `` to scroll the preview up and down. - Map `` to toggle the preview window. --- lua/plugins/oil.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index ce976f87..280281d6 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -87,6 +87,9 @@ return { default_file_exporer = true, -- Keymaps in oil buffer. keymaps = { + [""] = "actions.preview_scroll_up", + [""] = "actions.preview_scroll_down", + [""] = "actions.preview", ["gd"] = { desc = "Toggle file detail view", callback = enable_details, From 0cbb78fa38d303fc795711194895d5390e66dfc5 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 29 Dec 2024 23:46:01 -0800 Subject: [PATCH 147/153] fix(oil): enable `watch_for_changes` to auto-refresh on external edits --- lua/plugins/oil.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 280281d6..0c06d83d 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -85,6 +85,7 @@ return { end, opts = { default_file_exporer = true, + watch_for_changes = true, -- Keymaps in oil buffer. keymaps = { [""] = "actions.preview_scroll_up", From 319168c8d478c534d6b5f49c769f05e509b886e0 Mon Sep 17 00:00:00 2001 From: daephx Date: Sun, 29 Dec 2024 23:47:11 -0800 Subject: [PATCH 148/153] docs(oil): improve comments and add type annotations for opts - Enhance descriptions for `nvim-web-devicons` and setup options. - Add type annotation for the `opts` table. - Refine module header and plugin dependency comments. --- lua/plugins/oil.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 0c06d83d..62a05f5c 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,4 +1,4 @@ --- oil.nvim | Edit your filesystem like a buffer +-- oil.nvim | Neovim file explorer: edit your filesystem like a buffer -- https://github.com/stevearc/oil.nvim ---@module "oil" @@ -47,7 +47,10 @@ end ---@type LazyPluginSpec return { "stevearc/oil.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, + dependencies = { + -- Adds file type icons to Vim plugins + { "nvim-tree/nvim-web-devicons" }, + }, cmd = { "Oil", "Explore", @@ -83,8 +86,11 @@ return { create_command("Texplore", "tabedit % | Oil ", cmd_opts) create_command("Vexplore", "rightbelow vsplit | Oil ", cmd_opts) end, + ---@type oil.setupOpts opts = { + -- Oil will take over directory buffers default_file_exporer = true, + -- Set to true to watch the filesystem for changes and reload oil watch_for_changes = true, -- Keymaps in oil buffer. keymaps = { From ee7e2ecfe5b00498f8e03efa569fe06221c9547e Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 30 Dec 2024 05:31:45 -0800 Subject: [PATCH 149/153] refactor(zen-mode): add type annotations and improve readability - Annotate `on_open` function with parameter type. - Clarify excluded `filetypes` and `buftypes` with comments. --- lua/plugins/zen-mode.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/plugins/zen-mode.lua b/lua/plugins/zen-mode.lua index 5b91df76..d7f38133 100644 --- a/lua/plugins/zen-mode.lua +++ b/lua/plugins/zen-mode.lua @@ -1,16 +1,21 @@ -- ZenMode | Distraction-free coding for Neovim -- https://github.com/folke/zen-mode.nvim +-- Filetypes to exclude from custom on_open rules local filetypes = { "fugitive", "log", } + +-- Buftypes to exclude from custom on_open rules local buftypes = { "nofile", "prompt", "terminal", } +---Define function to apply custom sizing rules when opening ZenMode. +---@param win integer local on_open = function(win) -- Make certain buffers use all available columns local bufnr = vim.api.nvim_win_get_buf(win) From ff521c8e94fa4e0596d262587449a4f6d39edd43 Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 30 Dec 2024 07:16:49 -0800 Subject: [PATCH 150/153] fix(lsp): disable custom handlers for Neovim 0.11+ - Skip custom LSP handlers in Neovim 0.11 and newer. - Retain support for Neovim 0.10 with custom hover and signature help handlers. - Comment out and remove broken "goto definition" handler for split window. - This feature doesn't function as expected and may be revisited later. --- lua/plugins/lsp/handlers/init.lua | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lua/plugins/lsp/handlers/init.lua b/lua/plugins/lsp/handlers/init.lua index 51dde625..c1da840c 100644 --- a/lua/plugins/lsp/handlers/init.lua +++ b/lua/plugins/lsp/handlers/init.lua @@ -1,15 +1,25 @@ --- Define LSP handlers to be exported globally +-- Define custom LSP handlers with global export +-- TODO: handlers are deprecated and should be removed in Neovim 0.13. +-- Skip loading in newer versions of Neovim (0.11+). +if vim.fn.has("nvim-0.11") == 1 then + return +end + +-- FIXME: Custom "goto definition" handler for split window not working. +-- local definition = require("plugins.lsp.handlers.definition") +-- vim.lsp.handlers["textDocument/definition"] = definition.goto_definition + +-- Hover handler with custom border style +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = vim.g.border, +}) + +-- NOTE: Doesn't seem to work with signatureHelp plugin +-- Signature help handler with custom border and close events vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = vim.g.border, close_events = { "BufHidden", "CursorMoved", "CursorMovedI", "InsertCharPre" }, focusable = false, silent = true, }) - -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = vim.g.border, -}) - -local definition = require("plugins.lsp.handlers.definition") -vim.lsp.handlers["textDocument/definition"] = definition.goto_definition From 4375eac1335f169f7605582b2fd2e5a557f9f30a Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 30 Dec 2024 05:34:13 -0800 Subject: [PATCH 151/153] chore: update spell dictionary --- spell/en.utf-8.add | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 9f5d729e..b5e5a94f 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -746,6 +746,7 @@ gradlew grafana graphql gravatar +graymap gruvbox gsettings gsub @@ -901,6 +902,8 @@ keep keepLine keybind keybinds +keycode +keycodes keyframe keyframes keygen @@ -1207,6 +1210,7 @@ onemore ontop openid openjdk +opensource openssh openssl opensuse @@ -1563,6 +1567,7 @@ startswith startuptime startx statusbar +statuscolumn statusline statuslinenc stderr @@ -1675,6 +1680,7 @@ tmux tnoremap toc todo +todos todotxt toggleable toggler @@ -1866,6 +1872,7 @@ winbar winblend wincmd windo +windowizer wine64 winevent winfixheight From 29ade88a800965aed85aa7f4de659b34f2e1379d Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 30 Dec 2024 07:12:45 -0800 Subject: [PATCH 152/153] chore(lazy): update lazy-lock.json --- lazy-lock.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index e25a7526..66624832 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,7 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, - "ayu": { "branch": "master", "commit": "37160699469d695486174fb863aae2f2a4c1f90f" }, + "ayu": { "branch": "master", "commit": "283badaa983234c90e857c12c1f1c18e1544360a" }, "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -13,7 +13,7 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flatten.nvim": { "branch": "main", "commit": "ab2e1085c731dd296a56e9670218083726337df6" }, + "flatten.nvim": { "branch": "main", "commit": "b17a3e65c2e4e2ecd1345a2d08435e80f982c4a6" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, @@ -22,7 +22,7 @@ "hex.nvim": { "branch": "master", "commit": "fcff75fcf43b5a6c5b471eed65b3a06c412d6020" }, "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, - "kanagawa.nvim": { "branch": "master", "commit": "2d54b56242a6f03c74864d118d61afa1acb5918e" }, + "kanagawa.nvim": { "branch": "master", "commit": "18ae5771b22d8f913ef541c827a8180b4cb12c8a" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, @@ -33,29 +33,29 @@ "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "material.nvim": { "branch": "main", "commit": "31429eef4b7233ebdae3ddb57b7165ee4f1bd653" }, + "material.nvim": { "branch": "main", "commit": "c8ff153d2c2b22f8b2c9bcce0d741ab55c00cfed" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, "moonfly": { "branch": "master", "commit": "b5d91ed970c037e849c60a05f800c7e1cd9b2952" }, "neogit": { "branch": "master", "commit": "9ea60f79e370d8f4847efc145e53afe4b0613fc1" }, "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, - "none-ls.nvim": { "branch": "main", "commit": "6f5473ae9e7feb0b40ca95b8ed92e85b42a3c71b" }, + "none-ls.nvim": { "branch": "main", "commit": "02144ef2b86a816b5dec69783e311bb6feff7d82" }, "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, - "nvim-dap": { "branch": "master", "commit": "665d3569a86395fe0dab85efbdb26d7d2ee57e49" }, - "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-dap": { "branch": "master", "commit": "ffb077e65259f13be096ea6d603e3575a76b214a" }, + "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, "nvim-highlight-colors": { "branch": "main", "commit": "68a4df620cf58e2c7336e53738e8cf3a522ad694" }, "nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" }, - "nvim-lspconfig": { "branch": "master", "commit": "ff2b85abaa810f6611233dbe6d31c07510ebf43d" }, + "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" }, + "nvim-treesitter": { "branch": "master", "commit": "a295ba13d27684e8904e8e51876b84ee85135cf1" }, "nvim-treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, "oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "5d2edc8937978585881d97a8fec4c2903fa4d72c" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, @@ -68,7 +68,7 @@ "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "toggleterm.nvim": { "branch": "main", "commit": "87b2d6a3cab8e2bd9a0255427074285f0365398d" }, + "toggleterm.nvim": { "branch": "main", "commit": "344fc1810292785b3d962ddac2de57669e1a7ff9" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, From c2821a4d8e442563204b8eb6408e8d4baeb3728e Mon Sep 17 00:00:00 2001 From: daephx Date: Mon, 30 Dec 2024 07:22:10 -0800 Subject: [PATCH 153/153] ci: update GitHub Actions dependencies - Upgrade `actions/checkout` to v4 in both `stylua` and `selene` jobs. - Update `JohnnyMorganz/stylua-action` to v4. - Bump Stylua version to v2.0.2. - Update `NTBBloodbath/selene-action` to v1.0.0. - Bump Selene version to v0.27.1. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0944544..bb9d0f68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,19 +9,19 @@ jobs: stylua: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: JohnnyMorganz/stylua-action@v3 + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - version: v0.17.1 + version: v2.0.2 args: --check . selene: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: NTBBloodbath/selene-action@v1.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} - version: 0.25.0 + version: 0.27.1 args: --display-style=quiet .