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 . diff --git a/Makefile b/Makefile index 4d1a9e9c..042574eb 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}))) @@ -38,12 +38,13 @@ 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 - @stylua after/ lua/ init.lua + @stylua -v after/ lua/ init.lua lint: ## Run linter: selene @selene after/ lua/ init.lua diff --git a/after/colors/blue.lua b/after/colors/blue.lua index 7f37528f..013b1758 100644 --- a/after/colors/blue.lua +++ b/after/colors/blue.lua @@ -1,15 +1,59 @@ -local M = {} +-- Define colors for builtin colorscheme: blue -M.colors = { +---@type config.Highlights +return { + 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" }, + FloatBorder = { link = "WinSeparator" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + LineNr = { ctermfg = 59, 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 = { ctermfg = 177, fg = "Violet" }, + VertSplit = { link = "WinSeparator" }, + 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" }, -return M + -- Diff + 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 new file mode 100644 index 00000000..b3e79a91 --- /dev/null +++ b/after/colors/darkblue.lua @@ -0,0 +1,62 @@ +-- Define colors for builtin colorscheme: darkblue + +---@type config.Highlights +return { + CurSearch = { link = "IncSearch" }, + CursorLine = { ctermbg = 236, bg = "Grey19" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineNr = { ctermfg = 3, fg = "Yellow" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + 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 = 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" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + DiffAdd = { ctermbg = 4, ctermfg = 40, bg = "#0a300a" }, + DiffChange = { ctermbg = 5, ctermfg = 75, bg = "#002a4c" }, + 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 = 234, ctermfg = 131, fg = "#bb4c4c", bg = "#301414" }, +} diff --git a/after/colors/default.lua b/after/colors/default.lua index 1313c2ca..192168cd 100644 --- a/after/colors/default.lua +++ b/after/colors/default.lua @@ -1,34 +1,69 @@ -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" }, +-- Define colors for builtin colorscheme: default + +---@type config.Highlights +local colors = { + 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" }, + Folded = { ctermbg = 234, bg = "NvimDarkGrey2" }, + MsgSeparator = { link = "WinSeparator" }, + Normal = { ctermfg = 253, fg = "NvimLightGrey2" }, + 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" }, + VertSplit = { link = "WinSeparator" }, + WinBar = { link = "Normal" }, + WinBarNC = { link = "Normal" }, + WinSeparator = { ctermfg = 237, fg = "NvimDarkGrey4" }, + QuickfixLine = { link = "PmenuSel" }, + + -- Git + 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"] = { ctermfg = 153, fg = "NvimLightBlue", underline = true }, + ["@variable"] = { link = "Identifier" }, + + -- Rainbow Delimiters + 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 }, } -return M +-- 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 + colors = require("after.colors.vim") +end + +-- Don't modify Normal if background is set to light mode. +if vim.o.background == "light" then + colors.Constant = { fg = "NvimDarkRed" } + colors.Normal = nil + colors.Statement = { fg = "DarkViolet", bold = true } +end + +return colors diff --git a/after/colors/delek.lua b/after/colors/delek.lua index 34f47ce1..20dff7ba 100644 --- a/after/colors/delek.lua +++ b/after/colors/delek.lua @@ -1,11 +1,14 @@ -local M = {} +-- Define colors for builtin colorscheme: delek -M.colors = { - FloatBorder = { link = "VertSplit" }, +---@type config.Highlights +return { + 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" }, @@ -13,5 +16,3 @@ M.colors = { -- Telescope TelescopeNormal = { bg = "none" }, } - -return M diff --git a/after/colors/desert.lua b/after/colors/desert.lua index 34f47ce1..56861239 100644 --- a/after/colors/desert.lua +++ b/after/colors/desert.lua @@ -1,17 +1,79 @@ -local M = {} +-- Define colors for builtin colorscheme: desert -M.colors = { - FloatBorder = { link = "VertSplit" }, - NonText = { fg = "Gray15" }, - SignColumn = { bg = "none" }, - VertSplit = { fg = "Gray" }, +local terminal = { + "#000000", + "#cd5c5c", + "#9acd32", + "#bdb76b", + "#75a0ff", + "#ecee00", + "#cd853f", + "#b5b199", + "#565050", + "#ff0000", + "#89fb98", + "#f0e68c", + "#6dceeb", + "#ffde9b", + "#ffa0a0", + "#dbd6b9", +} - DiffAdd = { fg = "Green", bg = "none" }, - DiffChange = { fg = "Yellow", bg = "none" }, - DiffDelete = { fg = "Red", bg = "none" }, +for i = 0, 15 do + vim.g["terminal_color_" .. i] = terminal[i + 1] +end - -- Telescope - TelescopeNormal = { bg = "none" }, -} +---@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" }, + 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 = "Grey42", bg = "#3c3927" }, + VertSplit = { link = "WinSeparator" }, + 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" }, -return M + -- Diff + DiffAdd = { fg = "none", bg = "#343f20" }, + DiffChange = { fg = "none", bg = "#4d3117" }, + DiffDelete = { fg = "#cd5c5c", bg = "#4d2222" }, + DiffText = { fg = "none", bg = "#734922" }, + + -- Neogit + NeogitDiffAdd = { fg = "#81a635", bg = "#343f20" }, + NeogitDiffChange = { fg = "#cd853f", bg = "#4d3117" }, + NeogitDiffDelete = { fg = "#cd5c5c", bg = "#4d2222" }, + + -- 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/elflord.lua b/after/colors/elflord.lua index 545a2e2e..3fca3901 100644 --- a/after/colors/elflord.lua +++ b/after/colors/elflord.lua @@ -1,27 +1,48 @@ -local M = {} +-- Define colors for builtin colorscheme: elflord -M.colors = { - Normal = { bg = "none" }, +---@type config.Highlights +return { + 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" }, - DiffAdd = { bg = "none", fg = "#5f875f" }, - DiffChange = { bg = "none", fg = "#5f87af" }, - DiffDelete = { bg = "none", fg = "#af5faf" }, + -- Git + Added = { ctermfg = 46, fg = "#00ff00" }, + Changed = { ctermfg = 63, fg = "#3a66ff" }, + Removed = { ctermfg = 201, fg = "#f564f5" }, - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, + -- 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" }, - -- Whichkey - WhichKey = { link = "Define" }, -} + -- 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 + -- 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" }, +} diff --git a/after/colors/evening.lua b/after/colors/evening.lua new file mode 100644 index 00000000..786f3851 --- /dev/null +++ b/after/colors/evening.lua @@ -0,0 +1,29 @@ +-- Define colors for builtin colorscheme: evening + +---@type config.Highlights +return { + 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" }, +} diff --git a/after/colors/habamax.lua b/after/colors/habamax.lua index 94eff523..d52c3165 100644 --- a/after/colors/habamax.lua +++ b/after/colors/habamax.lua @@ -1,21 +1,52 @@ -local M = {} +-- Define colors for builtin colorscheme: habamax -M.colors = { - Normal = { bg = "none" }, +---@type config.Highlights +return { + 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" }, + 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" }, - DiffAdd = { bg = "none" }, - DiffChange = { bg = "none" }, - DiffDelete = { bg = "none" }, + -- LSP + DiagnosticWarn = { link = "WarningMsg" }, + DiagnosticError = { link = "Error" }, - -- Telescope - TelescopeNormal = { link = "Normal" }, - TelescopePreviewBorder = { fg = "Gray" }, - TelescopePromptBorder = { fg = "Gray" }, - TelescopeResultsBorder = { fg = "Gray" }, - TelescopeSelection = { bg = "Gray23" }, -} + -- 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" }, -return M + -- 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" }, +} diff --git a/after/colors/industry.lua b/after/colors/industry.lua index 59471ed1..85e8608c 100644 --- a/after/colors/industry.lua +++ b/after/colors/industry.lua @@ -1,15 +1,41 @@ -local M = {} +-- Define colors for builtin colorscheme: industry -M.colors = { +---@type config.Highlights +return { + 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" }, -return M + 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" }, +} diff --git a/after/colors/koehler.lua b/after/colors/koehler.lua new file mode 100644 index 00000000..7d956a7a --- /dev/null +++ b/after/colors/koehler.lua @@ -0,0 +1,17 @@ +-- Define colors for builtin colorscheme: koehler + +---@type config.Highlights +return { + 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" }, +} diff --git a/after/colors/lunaperche.lua b/after/colors/lunaperche.lua new file mode 100644 index 00000000..7dfd9be4 --- /dev/null +++ b/after/colors/lunaperche.lua @@ -0,0 +1,51 @@ +-- Define colors for builtin colorscheme: lunaperche + +---@type config.Highlights +return { + 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 }, +} diff --git a/after/colors/morning.lua b/after/colors/morning.lua index 897c3db6..4614f69e 100644 --- a/after/colors/morning.lua +++ b/after/colors/morning.lua @@ -1,30 +1,14 @@ -local M = {} +-- Define colors for builtin colorscheme: morning -M.colors = { - -- Normal = { bg = "none" }, - NormalFloat = { link = "Normal" }, - NormalBorder = { link = "VertSplit" }, +---@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 }, 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..b245194a --- /dev/null +++ b/after/colors/murphy.lua @@ -0,0 +1,50 @@ +-- Define colors for builtin colorscheme: murphy + +---@type config.Highlights +return { + 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 }, +} diff --git a/after/colors/pablo.lua b/after/colors/pablo.lua new file mode 100644 index 00000000..ff8fa4a1 --- /dev/null +++ b/after/colors/pablo.lua @@ -0,0 +1,19 @@ +-- Define colors for builtin colorscheme: pablo + +---@type config.Highlights +return { + 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" }, +} diff --git a/after/colors/peachpuff.lua b/after/colors/peachpuff.lua new file mode 100644 index 00000000..37a37ae2 --- /dev/null +++ b/after/colors/peachpuff.lua @@ -0,0 +1,23 @@ +-- Define colors for builtin colorscheme: peachpuff + +---@type config.Highlights +return { + 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" }, +} diff --git a/after/colors/quiet.lua b/after/colors/quiet.lua new file mode 100644 index 00000000..e836f512 --- /dev/null +++ b/after/colors/quiet.lua @@ -0,0 +1,118 @@ +-- Define colors for builtin colorscheme: quiet + +---@type config.HighlightsTbl +local 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 = 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 diff --git a/after/colors/retrobox.lua b/after/colors/retrobox.lua new file mode 100644 index 00000000..07c968c4 --- /dev/null +++ b/after/colors/retrobox.lua @@ -0,0 +1,61 @@ +-- Define colors for builtin colorscheme: retrobox + +---@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, 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" }, + Normal = { ctermbg = "none", bg = "none" }, + NormalFloat = { link = "Normal" }, + Operator = { ctermfg = 208, fg = "#fe8019" }, + SignColumn = { ctermbg = "none", bg = "none" }, + StatusLine = { ctermfg = 246, fg = "#a89984" }, + Visual = { ctermbg = 238, bg = "#47403a" }, + WinSeparator = { ctermfg = 238, fg = "Grey32" }, + + -- Git + Added = { ctermfg = 142, fg = "#b8bb26" }, + Removed = { ctermfg = 203, fg = "#fb4934" }, + Changed = { ctermfg = 208, fg = "#fe8019" }, + + -- Diff + 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 }, + 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 + 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/ron.lua b/after/colors/ron.lua index 8874ac80..bc9dea44 100644 --- a/after/colors/ron.lua +++ b/after/colors/ron.lua @@ -1,37 +1,28 @@ -local M = {} +-- Define colors for builtin colorscheme: ron -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" }, +---@type config.Highlights +return { + 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" }, - 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" }, - - -- 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..d527dda9 --- /dev/null +++ b/after/colors/shine.lua @@ -0,0 +1,11 @@ +-- Define colors for builtin colorscheme: shine + +---@type config.Highlights +return { + 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" }, +} diff --git a/after/colors/slate.lua b/after/colors/slate.lua new file mode 100644 index 00000000..23745d10 --- /dev/null +++ b/after/colors/slate.lua @@ -0,0 +1,54 @@ +-- Define colors for builtin colorscheme: slate + +---@type config.Highlights +return { + ColorColumn = { ctermbg = 234, bg = "#232315" }, + CursorLine = { ctermbg = 235, bg = "Grey15" }, + CursorLineNr = { ctermfg = 186, fg = "#d7d787" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + FloatBorder = { link = "WinSeparator" }, + 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 = { ctermfg = 177, fg = "Violet" }, + StatusLineNC = { ctermbg = 235, bg = "Grey15" }, + Structure = { ctermfg = 64, fg = "#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 = "#6fa000" }, + Changed = { ctermfg = 75, fg = "#5980cc" }, + Removed = { ctermfg = 196, fg = "#b448ac" }, + + -- Diff + 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 }, + 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 }, +} diff --git a/after/colors/sorbet.lua b/after/colors/sorbet.lua new file mode 100644 index 00000000..1eb5d579 --- /dev/null +++ b/after/colors/sorbet.lua @@ -0,0 +1,67 @@ +-- Define colors for builtin colorscheme: sorbet + +---@type config.Highlights +return { + CursorLine = { ctermbg = 237, bg = "#2f3347" }, + CursorLineNr = { ctermfg = 179, fg = "#d7af5f", bold = true }, + FloatBorder = { link = "WinSeparator" }, + 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" }, + 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 = { ctermbg = 214, ctermfg = 16, bg = "#d7af5f", fg = "Black" }, + Search = { ctermbg = 39, ctermfg = 16, bg = "#5fafaf", fg = "Black" }, + + -- Git + Added = { ctermfg = 113, fg = "#87d75f" }, + Changed = { ctermfg = 110, fg = "#87afd7" }, + Removed = { ctermfg = 167, fg = "#d75f5f" }, + + -- Diff + 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 = "#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 = { 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 new file mode 100644 index 00000000..7de8b63f --- /dev/null +++ b/after/colors/torte.lua @@ -0,0 +1,43 @@ +-- Define colors for builtin colorscheme: torte + +---@type config.Highlights +return { + CursorLine = { ctermbg = 235, bg = "Grey15" }, + CursorLineFold = { ctermbg = "none", bg = "none" }, + CursorLineNr = { ctermfg = 3, fg = "Yellow" }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + FloatBorder = { link = "VertSplit" }, + Folded = { ctermbg = 234, bg = "Grey11" }, + 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" }, + VertSplit = { link = "WinSeparator" }, + Visual = { ctermbg = 238, bg = "Grey27" }, + WinSeparator = { ctermfg = 239, fg = "Grey30" }, + + -- Search + CurSearch = { link = "IncSearch" }, + 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 = "Blue" }, + Removed = { ctermfg = 196, fg = "Red" }, + + -- Diff + 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 = { 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/vim.lua b/after/colors/vim.lua new file mode 100644 index 00000000..2e17d81b --- /dev/null +++ b/after/colors/vim.lua @@ -0,0 +1,73 @@ +-- Define colors for builtin colorscheme: vim + +---@type config.Highlights +return { + 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 = { link = "FloatBorder" }, + TelescopePromptBorder = { link = "FloatBorder" }, + TelescopeResultsBorder = { link = "FloatBorder" }, + TelescopeSelection = { ctermbg = 236, bg = "Grey23" }, + TelescopeSelectionCaret = { ctermfg = 214, fg = "Orange" }, + + -- Whichkey + WhichKey = { link = "Define" }, +} diff --git a/after/colors/wildcharm.lua b/after/colors/wildcharm.lua new file mode 100644 index 00000000..cc5d7e7b --- /dev/null +++ b/after/colors/wildcharm.lua @@ -0,0 +1,59 @@ +-- Define colors for builtin colorscheme: wildcharm + +---@type config.Highlights +local colors = { + CursorLineNr = { ctermfg = 213, fg = "Orchid1", bold = true }, + 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" }, + + -- 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" }, + 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 + 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 new file mode 100644 index 00000000..32032950 --- /dev/null +++ b/after/colors/zaibatsu.lua @@ -0,0 +1,70 @@ +-- Define colors for builtin colorscheme: zaibatsu + +---@type config.Highlights +return { + CursorLineFold = { link = "FoldColumn" }, + CursorLineNr = { ctermfg = 227, fg = "#ffff5f", bold = true }, + CursorLineSign = { ctermbg = "none", bg = "none" }, + EndOfBuffer = { ctermfg = 147, fg = "#afafff" }, + 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 = "#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" }, + 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" }, + IncSearch = { ctermbg = 214, ctermfg = 16, bg = "#ffaf00", fg = "Black" }, + Search = { ctermbg = 123, ctermfg = 16, bg = "#87ffff", fg = "Black" }, + + -- Git + Added = { ctermfg = 118, fg = "#87ff00" }, + Removed = { ctermfg = 205, fg = "#ff5faf" }, + Changed = { ctermfg = 14, fg = "#8787ff" }, + + -- Diff + 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" }, + + -- 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 = 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" }, +} diff --git a/after/colors/zellner.lua b/after/colors/zellner.lua new file mode 100644 index 00000000..e34fdc76 --- /dev/null +++ b/after/colors/zellner.lua @@ -0,0 +1,22 @@ +-- Define colors for builtin colorscheme: zellner + +---@type config.Highlights +return { + 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 }, +} diff --git a/lazy-lock.json b/lazy-lock.json index c6df73e9..66624832 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,77 +1,80 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "auto-session": { "branch": "main", "commit": "08c279882d4117a3e6ade1a014f7cf4af7c34fec" }, + "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, + "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, + "ayu": { "branch": "master", "commit": "283badaa983234c90e857c12c1f1c18e1544360a" }, "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": "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": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "git-conflict.nvim": { "branch": "main", "commit": "bfd9fe6fba9a161fc199771d85996236a0d0faad" }, - "gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" }, - "gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" }, + "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" }, + "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" }, - "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": "a38da0a61c172bb59e34befc12efe48359884793" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, - "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "hex.nvim": { "branch": "master", "commit": "fcff75fcf43b5a6c5b471eed65b3a06c412d6020" }, + "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, + "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, + "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" }, + "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": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "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" }, + "material.nvim": { "branch": "main", "commit": "c8ff153d2c2b22f8b2c9bcce0d741ab55c00cfed" }, "mkdx": { "branch": "master", "commit": "ee667cad506954b706c3fa972fbaaad46b1bf028" }, - "neogit": { "branch": "master", "commit": "af1d8d88f426a4da63c913f3b81a37350dbe8d02" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "059bb6561b8f5ff99a7acc9262b557ebbe5c34ec" }, + "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": "2cde745aadc2c36f6860a77a556494870675771a" }, - "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" }, - "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" }, + "none-ls.nvim": { "branch": "main", "commit": "02144ef2b86a816b5dec69783e311bb6feff7d82" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, + "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": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "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-context": { "branch": "master", "commit": "2aba92ceb1479485953007f4d5adf34d0b66917e" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1624866a1379fc1861797f0ed05899a9c1d2ff61" }, - "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-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": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, + "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": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "b29da4a6061a88270e875b38367d82c04c856128" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "77e5bad54227dcfe3878ffbda88ab1efdaacb475" }, + "rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" }, "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" }, - "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight.nvim": { "branch": "main", "commit": "1471dab694ad88351185758bb4275624d8b798ec" }, - "trouble.nvim": { "branch": "main", "commit": "bf99ea71a39e322336b7f8be965f86dbf5c65540" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "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": "344fc1810292785b3d962ddac2de57669e1a7ff9" }, + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "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" } + "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": "6beea6fafe2c781cb10e80878e68d5e32937692a" } } diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index d2f66084..abbf670c 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -19,14 +19,20 @@ 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" }, { - 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, }) @@ -126,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, +}) diff --git a/lua/config/colors.lua b/lua/config/colors.lua index ec32cffc..5c09243b 100644 --- a/lua/config/colors.lua +++ b/lua/config/colors.lua @@ -1,23 +1,33 @@ --- Load colorscheme from lua module +-- 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 = {} ---Check if colorscheme filename is available in the runtimepath ----@param colors_name string +---@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 return false end ----Get color table from highlight group ----@param name string higroup name ----@return table +---Get color table from highlight group. +---@param name string higroup name. +---@return config.HighlightsTbl M.get_hl = function(name) local labels = { "bg", "fg", "sp" } local colors = vim.api.nvim_get_hl(0, { name = name }) @@ -32,46 +42,70 @@ 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 +---@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_hl(group) + 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.extend_hl = function(group, tbl) - local colors = M.get_highlights(group) - return vim.tbl_extend("force", colors, tbl) +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 definitions ----@param colors table|function +---Wrapper for nvim_set_hl that applies higroups from table/func definitions. +---@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 = colors() ---@type table + colors(ret) + elseif type(colors) == "table" then + ret = colors end - for group, hl in pairs(colors) do - vim.api.nvim_set_hl(0, group, hl) + for group, hl in pairs(ret) do + 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 ----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 +---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 config.Highlights Table of highlight definitions. 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 ----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) + 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]") @@ -81,48 +115,127 @@ 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 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["colors"] 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 + -- Apply global highlights variable for all colorschemes. if vim.g.colors then M.set_hl(vim.g.colors or {}) end end ---- Autocmds --- +---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 -local group = vim.api.nvim_create_augroup("ColorSchemeFix", {}) +---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({ "ColorScheme", "VimEnter" }, { - desc = "Automatically load/reload colorscheme changes", - group = group, - callback = function(ev) - M.load(vim.g.colors_name and ev.match or "default") - 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 -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, -}) +-- Initialize autocmds +M.hook_colorscheme_change() +M.persist_colorscheme() +M.refresh_lsp_highlights() +M.reset_terminal_colors() return M diff --git a/lua/config/commands.lua b/lua/config/commands.lua index 442bf9d2..9756e179 100644 --- a/lua/config/commands.lua +++ b/lua/config/commands.lua @@ -33,27 +33,61 @@ 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 +---@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 = "+", }) 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#" }, diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index a42b40d8..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" } }, @@ -34,7 +33,7 @@ require("lazy").setup({ paths = { vim.fn.stdpath("data") .. "/site" }, disabled_plugins = { "gzip", - -- "matchit", + "matchit", -- "matchparen", "netrwPlugin", "rplugin", diff --git a/lua/config/options.lua b/lua/config/options.lua index 0cc90dc5..29ca5545 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -132,7 +132,22 @@ 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 = { + -- "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 @@ -185,10 +200,15 @@ 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 }, } -- Netrw specific options diff --git a/lua/config/util.lua b/lua/config/util.lua index 5e40dd3c..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) @@ -13,21 +19,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 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/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 }, } 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, } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 25387885..8a596eba 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", @@ -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 @@ -211,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 = { @@ -227,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" }, }), diff --git a/lua/plugins/colors/ayu.lua b/lua/plugins/colors/ayu.lua new file mode 100644 index 00000000..be5829a9 --- /dev/null +++ b/lua/plugins/colors/ayu.lua @@ -0,0 +1,72 @@ +-- 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, bg = "none", bold = true }, + Error = { fg = c.error, bg = "none" }, + FloatBorder = { fg = c.guide_inactive }, + FoldColumn = { fg = c.fg_idle, bg = "none" }, + Folded = { fg = "none", bg = c.guide_normal }, + IncSearch = { fg = c.bg, bg = c.special }, + 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_bg, 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, bg = "none" }, + + -- Diff + DiffDelete = { fg = c.vcs_removed, bg = c.vcs_removed_bg }, + + -- 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 }, + + -- 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.Normal = nil + else + vim.g.terminal_color_8 = "#394050" + vim.g.terminal_color_15 = "#fffcf2" + end + + return overrides + end, + }, +} diff --git a/lua/plugins/colors/gruvbox.lua b/lua/plugins/colors/gruvbox.lua index b583f863..cfe20ffe 100644 --- a/lua/plugins/colors/gruvbox.lua +++ b/lua/plugins/colors/gruvbox.lua @@ -1,34 +1,111 @@ -- 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 + 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, - bold = false, italic = { comments = false, + emphasis = false, folds = false, operators = false, strings = false, }, palette_overrides = {}, overrides = { - -- General CursorLineNr = { bg = "none" }, ErrorMsg = { link = "Error" }, - FloatBorder = { bg = "none", fg = "#756a60" }, - MsgSeparator = { link = "VertSplit" }, + FloatBorder = { link = "GruvboxGray" }, + MsgSeparator = { link = "WinSeparator" }, + NormalFloat = { link = "Normal" }, + 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" }, + 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 = { link = "CursorLine" }, + + -- Dap + DapUINormal = { link = "Normal" }, + DapUINormalNC = { link = "Normal" }, }, }, + init = function() + 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 + vim.g["terminal_color_" .. i - 1] = color + end + end + end) + end, } 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, + }, +} diff --git a/lua/plugins/colors/material.lua b/lua/plugins/colors/material.lua new file mode 100644 index 00000000..37113ef2 --- /dev/null +++ b/lua/plugins/colors/material.lua @@ -0,0 +1,79 @@ +-- 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-web-devicons", + "telescope", + "trouble", + "which-key", + }, + -- Overwrite default colors with your own + custom_colors = {}, + -- 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" }, + 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"] = { fg = c.editor.link, underline = true }, + + -- WhichKey + WhichKeyFloat = { link = "StatusLineNC" }, + WhichKeySeparator = { link = "WinSeparator" }, + }, + } + end, +} 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, +} diff --git a/lua/plugins/colors/rose-pine.lua b/lua/plugins/colors/rose-pine.lua new file mode 100644 index 00000000..ad7a5339 --- /dev/null +++ b/lua/plugins/colors/rose-pine.lua @@ -0,0 +1,96 @@ +-- 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" }, + StatusLine = { bg = "none" }, + Underlined = { fg = "iris", underline = true }, + VertSplit = { link = "WinSeparator" }, + WinBar = { bg = "none", inherit = false }, + WinBarNC = { bg = "none", inherit = false }, + + -- Diff + 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 + 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 }, + + -- DAP + DapStoppedLine = { bg = "#5c482c" }, + }, + }, +} 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, -} 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" } diff --git a/lua/plugins/colors/vscode.lua b/lua/plugins/colors/vscode.lua index f6133dd0..12d53762 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 { @@ -13,27 +33,35 @@ return { transparent = true, italic_comments = false, disable_nvimtree_bg = true, - color_overrides = { - vscFoldBackground = "#242424", - }, + 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 + Added = { fg = c.vscGitAdded }, + Changed = { fg = c.vscDiffRedDark }, + Removed = { fg = c.vscRed }, - -- Git status - DiffAdd = { bg = "#212D19", fg = "none" }, - DiffChange = { bg = "#3B3814", fg = "none" }, - DiffDelete = { bg = "none", fg = "indianred" }, + -- Diff + DiffAdd = { bg = "#242b16" }, + DiffChange = { bg = "#181818" }, + DiffDelete = { bg = c.vscDiffRedDark, fg = c.vscGitDeleted }, + DiffText = { bg = "#42401f" }, - -- Diagnostic + -- Diagnostics DiagnosticVirtualTextError = { bg = c.vscBack, fg = c.vscRed }, DiagnosticVirtualTextWarn = { bg = c.vscBack, fg = c.vscYellow }, DiagnosticVirtualTextInfo = { bg = c.vscBack, fg = c.vscBlue }, @@ -44,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 }, @@ -54,9 +93,41 @@ 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 }, + TelescopeSelection = { bg = c.vscSelection }, + TelescopeSelectionCaret = { bg = c.vscSelection, fg = c.vscYellow }, + + -- Neogit + NeogitBranch = { fg = c.vscYellow }, + NeogitCommitViewHeader = { fg = c.vscBlue, bg = c.vscContext, bold = true }, + 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.vscContext }, }, } 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, } diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 079c2c38..d4ed2787 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 @@ -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, } 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 97% rename from lua/plugins/dap/adapters/node.lua rename to lua/plugins/dap/adapters/pwa_node.lua index eb70528a..0c1df874 100644 --- a/lua/plugins/dap/adapters/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}", }) 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/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", +}) 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/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 diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index f1c367b6..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", {}), @@ -101,7 +111,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, diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index a8ad3035..773214de 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -1,9 +1,95 @@ -- 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 { "sindrets/diffview.nvim", - cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, - config = true, + cmd = { "DiffviewOpen" }, + keys = { + { "gd", "DiffviewOpen", desc = "DiffView" }, + }, + 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, } 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" }, }, 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/gitsigns.lua b/lua/plugins/gitsigns.lua index 8a8d5e0e..c6d678d9 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,19 +1,34 @@ -- 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, + current_line_blame_formatter = "■ , - : ", signs = { add = { text = "▎" }, change = { text = "▎" }, delete = { text = "▎" }, topdelete = { text = "▎" }, changedelete = { text = "▎" }, - untracked = { text = "▎" }, + untracked = { text = "┆" }, }, signs_staged = { add = { text = "▎" }, @@ -21,11 +36,8 @@ return { delete = { text = "▎" }, topdelete = { text = "▎" }, changedelete = { text = "▎" }, - untracked = { 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) @@ -40,7 +52,7 @@ return { return "]h" end vim.schedule(function() - gitsigns.next_hunk() + gitsigns.nav_hunk("next") end) return "" end, { expr = true, desc = "Next hunk" }) @@ -50,7 +62,7 @@ return { return "[h" end vim.schedule(function() - gitsigns.prev_hunk() + gitsigns.nav_hunk("prev") end) return "" end, { expr = true, desc = "Previous hunk" }) @@ -66,10 +78,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 diff --git a/lua/plugins/indent_blankline.lua b/lua/plugins/indent_blankline.lua index 3d5c6f51..a6f858ad 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 = "│", @@ -33,12 +35,17 @@ return { }, exclude = { filetypes = { + "Neogit*", "dashboard", "dbui", "floaterm", "fugitive", + "git", + "lazy", "log", + "mason", "neogit", + "trouble", "undotree", }, }, diff --git a/lua/plugins/lsp/attach.lua b/lua/plugins/lsp/attach.lua index 9d2bb087..71589403 100644 --- a/lua/plugins/lsp/attach.lua +++ b/lua/plugins/lsp/attach.lua @@ -1,13 +1,12 @@ 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") -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 ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer local on_attach = function(client, bufnr) -- Enable completion triggered by @@ -15,11 +14,10 @@ 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) - symbols.enable_document_symbols(client, bufnr) end return on_attach 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/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 diff --git a/lua/plugins/lsp/handlers/formatting.lua b/lua/plugins/lsp/handlers/format.lua similarity index 56% rename from lua/plugins/lsp/handlers/formatting.lua rename to lua/plugins/lsp/handlers/format.lua index 2fc3d5b0..48581bb5 100644 --- a/lua/plugins/lsp/handlers/formatting.lua +++ b/lua/plugins/lsp/handlers/format.lua @@ -8,9 +8,9 @@ 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 + vim.b.autoformat = nil M.autoformat = true else M.autoformat = not M.autoformat @@ -23,12 +23,12 @@ M.toggle = function() end -- Activate document formatting filter to select a preferred formatter -M.format = function() - local bufnr = vim.api.nvim_get_current_buf() ---@type integer +M.format_document = function() + 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({ @@ -43,35 +43,24 @@ M.format = function() end -- Enable document formatting autocmd to trigger on BufWritePre ----@param client table +---@param client vim.lsp.Client ---@param bufnr integer -M.enable_auto_formatting = 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 +M.enable_auto_format = function(client, bufnr) + 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", 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/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/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 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 diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index e5e37285..4eed4290 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -16,68 +16,27 @@ 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 - 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() - -- 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.diagnostics") 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, - - ["zk"] = function() - require("plugins/lsp/settings/zk") - end, - }) + -- 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 @@ -103,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" } }, }, }, }, diff --git a/lua/plugins/lsp/keymaps.lua b/lua/plugins/lsp/keymaps.lua index 82f42a3e..d6f06dc9 100644 --- a/lua/plugins/lsp/keymaps.lua +++ b/lua/plugins/lsp/keymaps.lua @@ -1,40 +1,52 @@ -local M = {} - --- Invoke document formatting -local format_document = function() - require("plugins.lsp.handlers.formatting").format() -end +local format = require("plugins.lsp.handlers.format") --- Display buffer workspace folders -local list_workspace_folders = function() - vim.print(vim.lsp.buf.list_workspace_folders()) -end +local M = {} -- 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", "v" }, "gf", format_document, { remap = true, desc = "Format document" } }, + { "n", "gy", vim.lsp.buf.type_definition, { desc = "Show type definitions" } }, + + { "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 diff --git a/lua/plugins/lsp/settings/bashls.lua b/lua/plugins/lsp/servers/bashls.lua similarity index 86% rename from lua/plugins/lsp/settings/bashls.lua rename to lua/plugins/lsp/servers/bashls.lua index 4952db60..892e8115 100644 --- a/lua/plugins/lsp/settings/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, }) 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 98% rename from lua/plugins/lsp/settings/jdtls.lua rename to lua/plugins/lsp/servers/jdtls.lua index bce43fe6..8ed2cb17 100644 --- a/lua/plugins/lsp/settings/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 }) 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 91% rename from lua/plugins/lsp/settings/powershell_es.lua rename to lua/plugins/lsp/servers/powershell_es.lua index c0becac4..67226b11 100644 --- a/lua/plugins/lsp/settings/powershell_es.lua +++ b/lua/plugins/lsp/servers/powershell_es.lua @@ -6,13 +6,16 @@ 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, }) return { + init_options = { + enableProfileLoading = false, + }, settings = { powershell = { codeFormatting = { diff --git a/lua/plugins/lsp/settings/pyright.lua b/lua/plugins/lsp/servers/pyright.lua similarity index 95% rename from lua/plugins/lsp/settings/pyright.lua rename to lua/plugins/lsp/servers/pyright.lua index 5edccea7..834d6525 100644 --- a/lua/plugins/lsp/settings/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 diff --git a/lua/plugins/lsp/servers/ruff.lua b/lua/plugins/lsp/servers/ruff.lua new file mode 100644 index 00000000..873af64f --- /dev/null +++ b/lua/plugins/lsp/servers/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/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/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/lualine.lua b/lua/plugins/lualine.lua index 1df80b29..1cd83c66 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 @@ -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,22 +82,28 @@ local fileformat = { }, } +-- Shows the current file name. local filename = { "filename", path = 1, - padding = 0, separator = "", component_separator = "", + padding = { + left = 0, + right = 1, + }, } +-- Displays the current Git branch. local branch = { "branch", icon = "", } +-- 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"] @@ -105,6 +117,7 @@ local diff = { end, } +-- Displays LSP or diagnostic counts. local diagnostics = { "diagnostics", sources = { "nvim_diagnostic" }, @@ -118,6 +131,7 @@ local diagnostics = { end)(), } +-- Shows attached LSP client info. local lsp_info = { "lsp_info", icon = { "", align = "right" }, @@ -129,30 +143,34 @@ local lsp_info = { }, } +-- Manages and displays tab info. 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 end, } +-- Manages and displays window info. local windows = { "windows", use_mode_colors = true, filetype_names = { - NvimTree = "NvimTree", checkhealth = "checkhealth", fugitive = "Fugitive", lazy = "Lazy", mason = "Mason", - tsplayground = "TSPlayground", + oil = "Oil", }, } @@ -196,6 +214,8 @@ return { "dashboard", "fugitive", "lazy", + "man", + "mason", "quickfix", "terminal", "trouble", @@ -207,13 +227,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, }, 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() diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index 45dc184f..be7f6a70 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,34 @@ return { } end, }, + { -- Neovim extension for zk + "zk-org/zk-nvim", + main = "zk", + 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" }, + { "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", + }, + }, } diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index ccece672..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" }, }, @@ -35,10 +41,37 @@ return { "jsonls", "lua_ls", "pyright", - "ruff_lsp", + "ruff", "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/servers" + 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 +99,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, + }, }, }, } diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 60e006fb..2401be09 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -12,19 +12,57 @@ return { { "sindrets/diffview.nvim" }, }, keys = { - { "gG", "Neogit", desc = "Git Status (Neogit)" }, + { "gg", "Neogit", desc = "Git Status" }, }, opts = { kind = "tab", disable_context_highlighting = true, + process_spinner = false, integrations = { diffview = true, telescope = true, }, 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` + 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, { + 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", { desc = "Local options to apply to neogit filetypes", group = vim.api.nvim_create_augroup("NeogitBufferOptions", {}), 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..62a05f5c --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,152 @@ +-- oil.nvim | Neovim file explorer: edit your filesystem like a buffer +-- 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", + dependencies = { + -- Adds file type icons to Vim plugins + { "nvim-tree/nvim-web-devicons" }, + }, + cmd = { + "Oil", + "Explore", + "Fexplore", + "Sexplore", + "Vexplore", + }, + keys = { + { "e", "Oil --float", desc = "File explorer" }, + }, + init = function() + -- 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, + 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, + ---@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 = { + [""] = "actions.preview_scroll_up", + [""] = "actions.preview_scroll_down", + [""] = "actions.preview", + ["gd"] = { + desc = "Toggle file detail view", + callback = enable_details, + }, + }, + -- Buffer-local options to use for oil buffers + buf_options = { + bufhidden = "hide", + buflisted = false, + }, + -- Window-local options to use for oil buffers + win_options = { + 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 = { + 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, + min_width = { 50, 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, + }, + }, +} diff --git a/lua/plugins/satellite.lua b/lua/plugins/satellite.lua new file mode 100644 index 00000000..05a88282 --- /dev/null +++ b/lua/plugins/satellite.lua @@ -0,0 +1,24 @@ +-- satellite.nvim | Decorate scrollbar for Neovim +-- https://github.com/lewis6991/satellite.nvim +---@module "satellite" + +---@type LazyPluginSpec +return { + "lewis6991/satellite.nvim", + event = { "BufReadPost", "BufNewFile" }, + 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 = { + -- HACK: Disable winblend to prevent black background + -- https://github.com/neovim/neovim/issues/18576 + winblend = 0, + handlers = { + gitsigns = { enable = false }, + }, + }, +} 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 }, }, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index b7af3fd6..ad312e34 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -13,33 +13,52 @@ 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") 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 { @@ -51,23 +70,9 @@ return { preview_title = "", results_title = false, scroll_strategy = "cycle", - selection_strategy = "row", + 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", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - -- Default settings for layout themes layout_config = { height = 0.5, @@ -84,16 +89,42 @@ return { }, }, + vimgrep_arguments = { + "rg", + "--color=never", + "--column", + "--line-number", + "--no-heading", + "--smart-case", + "--with-filename", + }, + -- 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) @@ -140,7 +171,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, @@ -196,4 +231,15 @@ return { command = "setlocal wrap", }) end, + init = function() + local colors = require("config.colors") + colors.set_hl_autocmd(nil, { + 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 }, + }) + end, } diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index 7b533f20..0ab056db 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" }, @@ -32,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" }, @@ -53,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, } diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 584da222..748d59fd 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -1,9 +1,12 @@ -- toggleterm.nvim | easily manage multiple terminal windows -- https://github.com/akinsho/toggleterm.nvim +---@module "toggleterm" +---List of custom terminal configurations. +---@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 +17,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,16 +32,11 @@ local function on_close() end end --- Generate custom terminals from user opts ----@param opts table -local initialize_terminals = function(opts) +---Generate custom terminals from user 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" }) @@ -49,24 +47,35 @@ 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)" }, - { "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) - initialize_terminals(opts) + initialize_terminals(executables) end, opts = { open_mapping = "", + close_on_exit = true, direction = "float", shade_terminals = false, size = size, @@ -74,62 +83,8 @@ 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 - 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, - }, - }, - }, }, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 3712ec4d..7f27740e 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) @@ -37,6 +63,7 @@ return { "bash", "c", "comment", + "editorconfig", "gitignore", "json", "jsonc", 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, } diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 9625d8bd..07471504 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -1,14 +1,23 @@ -- Which-key | Configurations for plugin WhichKey.nvim -- https://github.com/folke/which-key.nvim +---@module "which-key" ---@type LazyPluginSpec 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", - icons = { mappings = false }, + icons = { mappings = true }, win = { row = math.huge, border = { "─", "─", "─", " ", "─", "", "", " " }, @@ -38,6 +47,7 @@ return { { "p", group = "Plugins" }, { "s", group = "Sessions" }, { "t", group = "Terminal" }, + { "x", group = "Diagnostics" }, { "z", group = "Notes" }, }) end, 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) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index fac7b89b..b5e5a94f 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 @@ -27,12 +28,14 @@ CmdlineEnter ColorColumn ColorScheme CommitID +CopyPathToClipboard CurrentVersion CursorHold CursorHoldI CursorLine CursorMoved DNSmasq +DarkGray Devicon DiffView DockerHub @@ -42,6 +45,7 @@ EventLog ExecutionPolicy ExitApp ExitPre +ExternalScript FFmpeg FileType FloatBorder @@ -51,9 +55,11 @@ GIFs GTK2 Gdiffsplit HKEY_CURRENT_USER +HSV IIFE IOError IPython +ImGui ImageMagick IncSearch IndentBlankline @@ -75,6 +81,7 @@ LspReferenceWrite LuaJIT LuaRocks LuaSnip +LÖVE MANPATH MD5 MacOS @@ -84,6 +91,7 @@ MinimumRes MouseMove Myriadth NERDTree +NES NOPASSWD NoLogo NoProfile @@ -96,10 +104,14 @@ NvimTree OSC OSD OSTYPE +Oem4 +PSReadLine +PYTHONPATH PackerCompile PackerComplete PageDown PageUp +ParameterValue PmenuSel PostgreSQL PowerShell @@ -156,6 +168,7 @@ WinEnter WinEvent WinLeave WinNew +WinSeparator WinTitle WinZoom WriteLine @@ -165,9 +178,11 @@ ZoomWin abc abi abspath +acodec addr adduser adhoc +aegisub afile agnoster ahk @@ -184,6 +199,7 @@ api apk appdata appmenu +approach appxmanifest archflags archlinux @@ -224,6 +240,7 @@ autorun autosave autosquash autostart +autosuggest autosuggestions autotag autowidth @@ -254,6 +271,7 @@ beancount bezier bg bibtex +bigfile bindkey bindsym bitrate @@ -272,6 +290,7 @@ bp bpytop branchless breakindent +broadcasthost bs btop buf @@ -320,6 +339,7 @@ chore chown chsh ci +cimgui cindent citra clangd @@ -355,6 +375,8 @@ codelens codelldb codepoints codestyle +collider +colliders colorcolumn colorflag colorizer @@ -387,6 +409,7 @@ consolas const cookiecutter cooklang +cooldowns copen copyindent copypasta @@ -431,11 +454,13 @@ damnit dap dapui darcs +darkblue darkgreen dataframe datamoshes datamoshing dataview +dbg dbui dconf deadzone @@ -518,6 +543,7 @@ dropdown ds_store dstask duckdns +dups easymotion echo editorconfig @@ -566,6 +592,7 @@ ethernet ev eval eventlog +eviline exa exe execute @@ -578,6 +605,7 @@ extmark eza f1 fallbacks +famicom favour fd fdfind @@ -622,6 +650,7 @@ foldexpr foldlevel foldlevelstart foldmethod +foldnestmax foldopen foldsep foldstart @@ -656,6 +685,7 @@ func fzf fzfterm fzy +gameboy gamesave gamesaves gc @@ -691,6 +721,7 @@ gitmodules gitrebase gitsigns glazewm +globdots globpath glsl gnu @@ -715,6 +746,7 @@ gradlew grafana graphql gravatar +graymap gruvbox gsettings gsub @@ -759,6 +791,7 @@ histsize hitbox hjkl hl +hlgroups hlsearch homebrew homelab @@ -796,6 +829,7 @@ imagemagick imap img imgcat +imgui imgur impl incsearch @@ -815,6 +849,7 @@ io ios iostream ip +ipaddr ipairs ipsum ipv4 @@ -867,6 +902,8 @@ keep keepLine keybind keybinds +keycode +keycodes keyframe keyframes keygen @@ -875,10 +912,13 @@ keymaps keypress keypressed keypresses +keyreleased keyset kickstart +koehler kommentary kotlin +kotlinc kubeadm kubectl kubelet @@ -928,6 +968,7 @@ listchars listdir listview lldb +lldebugger llvm ln lnk @@ -940,6 +981,7 @@ localleader localoptions localstate lockfile +lockfiles lockscreen loclist loglevel @@ -967,6 +1009,7 @@ lts lua luacheck luacheckrc +luadb luadoc luadocs luafile @@ -979,6 +1022,9 @@ luarc luarocks luasnip luaver +lunaperche +lunaperche/! +luv luvit macchiato macchina @@ -997,6 +1043,7 @@ markdownlint markdownlintrc matchit matchparen +matplotlib matryoshka maui maxLine @@ -1007,12 +1054,14 @@ md5 mdx mechatronics mem +mempak menuone menuselect mergetool metadata metatable mgcb +microservices microsoft middleware middlewares @@ -1042,6 +1091,7 @@ moonfly motd mountpoint mouseout +mousereleased mov moz mozillateam @@ -1058,6 +1108,7 @@ mswin mtime multiband multispace +murphy mux muxed mypy @@ -1084,6 +1135,7 @@ neorg neoterm neovide neovim +neovim's nerdfix nerdfont nerdfonts @@ -1107,6 +1159,7 @@ nodesource nodex nofile nohlsearch +noice noinsert nologo nomodifiable @@ -1157,6 +1210,7 @@ onemore ontop openid openjdk +opensource openssh openssl opensuse @@ -1173,6 +1227,7 @@ osx outdir owo p7zip +pablo packadd packercompile packercomplete @@ -1186,6 +1241,7 @@ paren parens parseable parsers +passthrough passwd pathlib pathogen @@ -1195,6 +1251,7 @@ pbm pc pcall pdm +peachpuff perf performant perl @@ -1219,6 +1276,7 @@ pixelwise pixiedust pkill plaintext +platformer plex pmenu png @@ -1361,6 +1419,7 @@ resolv restruct ret retab +retrobox retval reusability rf @@ -1368,6 +1427,7 @@ rg rgb rgb32 rgba +rglob rhs ripgrep rmd @@ -1401,6 +1461,7 @@ scaleability scanf schemastore scm +scp screenrc screensaver scrollback @@ -1417,6 +1478,7 @@ seekranges sel selene serverless +sesh sessionizer setattr setenv @@ -1431,6 +1493,7 @@ sfx sha sha1 sha256 +shada shader shaders shellcheck @@ -1466,6 +1529,7 @@ smartindent smarttab snapd softrepeat +soho sonarr source sourceforge @@ -1503,6 +1567,7 @@ startswith startuptime startx statusbar +statuscolumn statusline statuslinenc stderr @@ -1526,13 +1591,16 @@ stylelintrc stylesheet stylesheets stylua +subclassed subdir subdirectory submenu submodule submodules subnet +substates subtractive +subtrees sudo sudoedit sudoer @@ -1570,6 +1638,8 @@ tabwidth tada taplo taskbar +taskwarrior +taskwarrior/! tautulli taz tbl @@ -1589,6 +1659,7 @@ textdocument texthl textmate textobjects +textoff textwidth tga tgz @@ -1600,6 +1671,7 @@ timecode timecodes timestamp timestamps +timestep tlaplus tldr tls @@ -1608,6 +1680,7 @@ tmux tnoremap toc todo +todos todotxt toggleable toggler @@ -1616,6 +1689,7 @@ tohtml tokyonight toml tonumber +toolchain topbar topdelete topdown @@ -1624,6 +1698,7 @@ toplevel topline topsplit toptal +tostring tostring/! touchd toupper @@ -1666,6 +1741,7 @@ undercurl undolevel undotree unescape +unescaped unicode unindent unittest @@ -1705,8 +1781,10 @@ uv v0 v2 vala +valheim vbs vbscript +vcodec vcproj vcs vendored @@ -1783,6 +1861,7 @@ wifi wikilink wikipedia wildcard +wildcharm wildignore wildmenu win @@ -1793,6 +1872,7 @@ winbar winblend wincmd windo +windowizer wine64 winevent winfixheight @@ -1825,8 +1905,10 @@ xclock xconfig xdg xdg_dirs +xdigit xdotool xev +xfce xhost xinit xinitrc @@ -1853,9 +1935,11 @@ yamlls ylast yml youtube +zaibatsu zcompdump zdotdir zellij +zellner zenmode zettelkasten zfs