From 255070a0b1d6cb1254efa460b2fdf6a394f3b151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 30 May 2023 22:37:26 +0800 Subject: [PATCH] feat(ui)!: unify UI components: cmp, wilder, floats (#772) * feat(ui)!: unify UI components: cmp, wilder, floats --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: huge-pancake * fix entry tags * fixup! fix entry tags --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: huge-pancake --- init.lua | 17 -- lazy-lock.json | 22 +- lua/modules/configs/completion/cmp.lua | 93 ++++---- lua/modules/configs/completion/lsp.lua | 2 +- .../configs/completion/servers/clangd.lua | 2 +- lua/modules/configs/tool/nvim-tree.lua | 10 +- lua/modules/configs/tool/toggleterm.lua | 11 +- lua/modules/configs/tool/wilder.lua | 8 +- lua/modules/configs/ui/alpha.lua | 6 +- lua/modules/configs/ui/catppuccin.lua | 202 +++++------------- lua/modules/plugins/completion.lua | 2 +- lua/modules/plugins/ui.lua | 3 +- lua/modules/utils/init.lua | 4 +- 13 files changed, 126 insertions(+), 256 deletions(-) diff --git a/init.lua b/init.lua index 66fc38337c..15445091f2 100644 --- a/init.lua +++ b/init.lua @@ -1,20 +1,3 @@ if not vim.g.vscode then require("core") - - -- Release note - vim.schedule(function() - vim.notify_once( - [[ -We've released version v3.0.0! -Visit https://github.com/ayamir/nvimdots/releases to see the release notes. -If you have icons that can't be rendered correctly (e.g., 𑨩 and � ) or icons with incorrect size, be sure to read this! - -To silence this message, remove it from `init.lua` at the config's root directory. - -To check the glyphs size, make sure the following icons are very close to the crosses but there is no overlap: -XXXXXXXXX -]], - vim.log.levels.WARN - ) - end) end diff --git a/lazy-lock.json b/lazy-lock.json index a25e833a23..caebbf2fd6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,12 +3,12 @@ "LuaSnip": { "branch": "master", "commit": "a83e4b1ba7edc6fecdad09e39753a7d5eee1d01c" }, "accelerated-jk.nvim": { "branch": "main", "commit": "8fb5dad4ccc1811766cebf16b544038aeeb7806f" }, "alpha-nvim": { "branch": "main", "commit": "1838ae926e8d49fe5330d1498ee8289ae2c340bc" }, - "auto-session": { "branch": "main", "commit": "571ecb873654554109f63eac3193b133aec2f90c" }, - "autoclose.nvim": { "branch": "main", "commit": "fec0b890ea2d2ab9e62c4ab48d097a0382226999" }, + "auto-session": { "branch": "main", "commit": "b6bac3accc9a753be830aa059f834b787efe2f79" }, + "autoclose.nvim": { "branch": "main", "commit": "6695f308c0141239ab28494e76f8aceed748e179" }, "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" }, "bigfile.nvim": { "branch": "main", "commit": "a34e42616c20bfd52943ed5d6632bb28d22b057e" }, "bufferline.nvim": { "branch": "main", "commit": "32d74d5d044f7cc89892d4781a83d55ee4ed552a" }, - "catppuccin": { "branch": "main", "commit": "1d3eda15703ba70f57e94e6451db55914ff7017f" }, + "catppuccin": { "branch": "refactor/syntax-highlighting", "commit": "c0f7432052a837c6295a7770e39fdc07ede3305c" }, "clever-f.vim": { "branch": "master", "commit": "6a3ac5e3688598af9411ab741737f98c47370c22" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, @@ -17,12 +17,12 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, "cmp-tmux": { "branch": "main", "commit": "984772716f66d8ee88535a6bf3f94c4b4e1301f5" }, - "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, + "cmp-treesitter": { "branch": "master", "commit": "c8e3a74b51597d69d240085a258636972ce98e15" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "codeium.nvim": { "branch": "main", "commit": "29195dc9e58232b2dbd18669db206218188a321f" }, "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, - "copilot.lua": { "branch": "master", "commit": "653bbdc44cd569a5fd0617e5a9d3df2b1359e230" }, + "copilot.lua": { "branch": "master", "commit": "77e3a4907928f0813024e573b882dc879dfc0c6b" }, "crates.nvim": { "branch": "main", "commit": "3648f8787656d7572740560331553abdaa8cb982" }, "csv.vim": { "branch": "master", "commit": "15ff93edf5b26c466affbb356e0696b7d6a3b499" }, "diffview.nvim": { "branch": "main", "commit": "bff58a6ea3e081ca50049700f9848b2f84ea57be" }, @@ -33,9 +33,9 @@ "gitsigns.nvim": { "branch": "main", "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" }, "hop.nvim": { "branch": "v2", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" }, "indent-blankline.nvim": { "branch": "master", "commit": "ceaf730b13e332cd76600d9795722413c236c684" }, - "lazy.nvim": { "branch": "main", "commit": "a93d8983c4335b6ae7d6e7d516a191d929186d5b" }, + "lazy.nvim": { "branch": "main", "commit": "ebdd0499551765e6a7aba220cc8ae4e0cdb6be69" }, "lsp_signature.nvim": { "branch": "master", "commit": "7a26ebaa7e36aa2aefa6c1994b2b866c96de32e6" }, - "lspsaga.nvim": { "branch": "main", "commit": "01b9633aefd010f272d6c7e3d8293c44fcfe7696" }, + "lspsaga.nvim": { "branch": "main", "commit": "4c557ed5c7cf3284bcd8fb926f329f24a0f141bf" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "f0ce33f4794a2364eb08d09d09380e8b04ec5e6a" }, @@ -44,18 +44,18 @@ "neodim": { "branch": "master", "commit": "89c16fccccfdb5b7e6ad3a6e8286736debc11705" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, "nord.nvim": { "branch": "master", "commit": "fab04b2dd4b64f4b1763b9250a8824d0b5194b8f" }, - "null-ls.nvim": { "branch": "main", "commit": "77e53bc3bac34cc273be8ed9eb9ab78bcf67fa48" }, + "null-ls.nvim": { "branch": "main", "commit": "4b055d84be42c90a7240785d3c83340d259d3d46" }, "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, - "nvim-cmp": { "branch": "main", "commit": "1088b3743b83ffd8973ad65e6b5fed010da0ffd2" }, + "nvim-cmp": { "branch": "main", "commit": "b43bfaf3229d6b39d8baaa567b13c6be0623bf12" }, "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, "nvim-dap": { "branch": "master", "commit": "56118cee6af15cb9ddba9d080880949d8eeb0c9f" }, "nvim-dap-ui": { "branch": "master", "commit": "c693e80f8d7b6369f4152e7fdab10db4847c5c71" }, - "nvim-lspconfig": { "branch": "master", "commit": "465042c0f786992212284311ebb5da1f89479774" }, + "nvim-lspconfig": { "branch": "master", "commit": "9166622781a39a829878d1fd24c174529d996838" }, "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" }, "nvim-scrollview": { "branch": "main", "commit": "4a04039b80c270f6bd2075935cd3c7943f6ad140" }, "nvim-tree.lua": { "branch": "master", "commit": "e2a4c9d09d205ebe5f071264f43f73a0077c43a3" }, "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "a76db88548bb7fe008cd7e4f2d2ec2ccc080dede" }, + "nvim-treesitter": { "branch": "master", "commit": "1d670b0c906716b1543270b3b087d44b09f3b523" }, "nvim-treesitter-context": { "branch": "master", "commit": "7cd5ac1c384b89e7e607238a936f13963f97ba32" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "95b76b95eff25e1e64f363938cd853852355d70a" }, "nvim-ts-autotag": { "branch": "main", "commit": "40615e96075c743ef47aaf9de966dc348bec6459" }, diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua index 5add8c6a0d..26a1daf07e 100644 --- a/lua/modules/configs/completion/cmp.lua +++ b/lua/modules/configs/completion/cmp.lua @@ -10,13 +10,13 @@ return function() local border = function(hl) return { - { "╭", hl }, + { "┌", hl }, { "─", hl }, - { "╮", hl }, + { "┐", hl }, { "│", hl }, - { "╯", hl }, + { "┘", hl }, { "─", hl }, - { "╰", hl }, + { "└", hl }, { "│", hl }, } end @@ -32,47 +32,18 @@ return function() return (diff < 0) end - local function cmp_format(opts) - opts = opts or {} - - return function(entry, vim_item) - if opts.before then - vim_item = opts.before(entry, vim_item) - end - - local kind_symbol = opts.symbol_map[vim_item.kind] or icons.kind.Undefined - local source_symbol = opts.symbol_map[entry.source.name] or icons.cmp.undefined - - vim_item.menu = " " .. source_symbol .. " |" - vim_item.kind = string.format(" 〔 %s %s 〕", kind_symbol, vim_item.kind) - - if opts.maxwidth ~= nil then - if opts.ellipsis_char == nil then - vim_item.abbr = string.sub(vim_item.abbr, 1, opts.maxwidth) - else - local label = vim_item.abbr - local truncated_label = vim.fn.strcharpart(label, 0, opts.maxwidth) - if truncated_label ~= label then - vim_item.abbr = truncated_label .. opts.ellipsis_char - end - end - end - return vim_item - end - end - local cmp = require("cmp") cmp.setup({ preselect = cmp.PreselectMode.Item, window = { completion = { - border = border("Normal"), - max_width = 80, - max_height = 20, + border = border("PmenuBorder"), + winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:PmenuSel", scrollbar = false, }, documentation = { border = border("CmpDocBorder"), + winhighlight = "Normal:CmpDoc", }, }, sorting = { @@ -96,14 +67,38 @@ return function() }, }, formatting = { - fields = { "menu", "abbr", "kind" }, + fields = { "abbr", "kind", "menu" }, format = function(entry, vim_item) - local kind_map = vim.tbl_deep_extend("force", icons.kind, icons.type, icons.cmp) - local kind = cmp_format({ - maxwidth = 50, - symbol_map = kind_map, - })(entry, vim_item) - return kind + local lspkind_icons = vim.tbl_deep_extend("force", icons.kind, icons.type, icons.cmp) + -- load lspkind icons + vim_item.kind = + string.format(" %s %s", lspkind_icons[vim_item.kind] or icons.cmp.undefined, vim_item.kind or "") + + vim_item.menu = setmetatable({ + cmp_tabnine = "[TN]", + copilot = "[CPLT]", + buffer = "[BUF]", + orgmode = "[ORG]", + nvim_lsp = "[LSP]", + nvim_lua = "[LUA]", + path = "[PATH]", + tmux = "[TMUX]", + treesitter = "[TS]", + luasnip = "[SNIP]", + spell = "[SPELL]", + }, { + __index = function() + return "[BTN]" -- builtin/unknown source names + end, + })[entry.source.name] + + local label = vim_item.abbr + local truncated_label = vim.fn.strcharpart(label, 0, 80) + if truncated_label ~= label then + vim_item.abbr = truncated_label .. "..." + end + + return vim_item end, }, matching = { @@ -151,17 +146,7 @@ return function() { name = "nvim_lua" }, { name = "luasnip" }, { name = "path" }, - { - name = "treesitter", - entry_filter = function(entry) - local ignore_list = { - "Error", - "Comment", - } - local kind = entry:get_completion_item().cmp.kind_text - return not vim.tbl_contains(ignore_list, kind) - end, - }, + { name = "treesitter" }, { name = "spell" }, { name = "tmux" }, { name = "orgmode" }, diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index 5197dfc903..a048a7ac55 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -3,7 +3,7 @@ return function() local mason = require("mason") local mason_lspconfig = require("mason-lspconfig") - require("lspconfig.ui.windows").default_options.border = "single" + require("lspconfig.ui.windows").default_options.border = "rounded" local icons = { ui = require("modules.utils.icons").get("ui", true), diff --git a/lua/modules/configs/completion/servers/clangd.lua b/lua/modules/configs/completion/servers/clangd.lua index 7a15dcd3bd..5b556d6d6f 100644 --- a/lua/modules/configs/completion/servers/clangd.lua +++ b/lua/modules/configs/completion/servers/clangd.lua @@ -67,7 +67,7 @@ return function(options) "--header-insertion-decorators", "--header-insertion=iwyu", "--limit-references=3000", - "--limit-results=350", + "--limit-results=270", }, commands = { ClangdSwitchSourceHeader = { diff --git a/lua/modules/configs/tool/nvim-tree.lua b/lua/modules/configs/tool/nvim-tree.lua index d903ee868a..d38d9a808f 100644 --- a/lua/modules/configs/tool/nvim-tree.lua +++ b/lua/modules/configs/tool/nvim-tree.lua @@ -62,7 +62,7 @@ return function() show = { file = true, folder = true, - folder_arrow = false, + folder_arrow = true, git = true, }, padding = " ", @@ -81,10 +81,10 @@ return function() ignored = icons.git.Ignore, --◌ }, folder = { - -- arrow_open = "", - -- arrow_closed = "", - arrow_open = "", - arrow_closed = "", + arrow_open = icons.ui.ArrowOpen, + arrow_closed = icons.ui.ArrowClosed, + -- arrow_open = "", + -- arrow_closed = "", default = icons.ui.Folder, open = icons.ui.FolderOpen, empty = icons.ui.EmptyFolder, diff --git a/lua/modules/configs/tool/toggleterm.lua b/lua/modules/configs/tool/toggleterm.lua index 19dd6a2dcd..d8c2bc7ea8 100644 --- a/lua/modules/configs/tool/toggleterm.lua +++ b/lua/modules/configs/tool/toggleterm.lua @@ -1,7 +1,4 @@ return function() - local colors = require("modules.utils").get_palette() - local floatborder_hl = require("modules.utils").hl_to_rgb("FloatBorder", false, colors.blue) - require("toggleterm").setup({ -- size can be a number or function which is passed the current terminal size = function(term) @@ -18,8 +15,14 @@ return function() vim.api.nvim_set_option_value("foldexpr", "0", { scope = "local" }) end, highlights = { + Normal = { + link = "Normal", + }, + NormalFloat = { + link = "NormalFloat", + }, FloatBorder = { - guifg = floatborder_hl, + link = "FloatBorder", }, }, open_mapping = false, -- [[]], diff --git a/lua/modules/configs/tool/wilder.lua b/lua/modules/configs/tool/wilder.lua index a45bba4750..9206e98f59 100644 --- a/lua/modules/configs/tool/wilder.lua +++ b/lua/modules/configs/tool/wilder.lua @@ -1,6 +1,5 @@ return function() local wilder = require("wilder") - local colors = require("modules.utils").get_palette() local icons = { ui = require("modules.utils.icons").get("ui") } wilder.setup({ modes = { ":", "/", "?" } }) @@ -25,13 +24,12 @@ return function() ), }) - local match_hl = require("modules.utils").hl_to_rgb("String", false, colors.green) - local popupmenu_renderer = wilder.popupmenu_renderer(wilder.popupmenu_border_theme({ border = "rounded", highlights = { - border = "Title", -- highlight to use for the border - accent = wilder.make_hl("WilderAccent", "Pmenu", { { a = 0 }, { a = 0 }, { foreground = match_hl } }), + default = "Pmenu", + border = "PmenuBorder", -- highlight to use for the border + accent = wilder.make_hl("WilderAccent", "CmpItemAbbr", "CmpItemAbbrMatch"), }, empty_message = wilder.popupmenu_empty_message_with_spinner(), highlighter = wilder.lua_fzy_highlighter(), diff --git a/lua/modules/configs/ui/alpha.lua b/lua/modules/configs/ui/alpha.lua index 372213b147..82eba3baa7 100644 --- a/lua/modules/configs/ui/alpha.lua +++ b/lua/modules/configs/ui/alpha.lua @@ -35,8 +35,8 @@ return function() cursor = 5, width = 50, align_shortcut = "right", - hl = "AlphaButton", - hl_shortcut = "AlphaAttr", + hl = "AlphaButtons", + hl_shortcut = "AlphaShortcut", } if nil == keybind then @@ -118,7 +118,7 @@ return function() end, }), } - dashboard.section.buttons.opts.hl = "AlphaButton" + dashboard.section.buttons.opts.hl = "AlphaButtons" local function footer() local stats = require("lazy").stats() diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index 1df0c7caf7..ea1265f530 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -1,5 +1,6 @@ return function() local transparent_background = require("core.settings").transparent_background + local clear = {} require("catppuccin").setup({ flavour = "mocha", -- Can be one of: latte, frappe, macchiato, mocha @@ -82,175 +83,74 @@ return function() symbols_outline = false, telekasten = false, telescope = true, - treesitter_context = false, + treesitter_context = true, ts_rainbow = true, vim_sneak = false, vimwiki = false, which_key = true, }, - color_overrides = { - mocha = { - rosewater = "#F5E0DC", - flamingo = "#F2CDCD", - mauve = "#DDB6F2", - pink = "#F5C2E7", - red = "#F28FAD", - maroon = "#E8A2AF", - peach = "#F8BD96", - yellow = "#FAE3B0", - green = "#ABE9B3", - blue = "#96CDFB", - sky = "#89DCEB", - teal = "#B5E8E0", - lavender = "#C9CBFF", - - text = "#D9E0EE", - subtext1 = "#BAC2DE", - subtext0 = "#A6ADC8", - overlay2 = "#C3BAC6", - overlay1 = "#988BA2", - overlay0 = "#6E6C7E", - surface2 = "#6E6C7E", - surface1 = "#575268", - surface0 = "#302D41", - - base = "#1E1E2E", - mantle = "#1A1826", - crust = "#161320", - }, - }, + color_overrides = {}, highlight_overrides = { - mocha = function(cp) + ---@param cp palette + all = function(cp) return { - -- For base configs. - NormalFloat = { fg = cp.text, bg = transparent_background and cp.none or cp.base }, + -- For base configs + NormalFloat = { fg = cp.text, bg = transparent_background and cp.none or cp.mantle }, + FloatBorder = { + fg = transparent_background and cp.blue or cp.mantle, + bg = transparent_background and cp.none or cp.mantle, + }, CursorLineNr = { fg = cp.green }, - Search = { bg = cp.surface1, fg = cp.pink, style = { "bold" } }, - IncSearch = { bg = cp.pink, fg = cp.surface1 }, - Keyword = { fg = cp.pink }, - Type = { fg = cp.blue }, - Typedef = { fg = cp.yellow }, - StorageClass = { fg = cp.red, style = { "italic" } }, - -- For native lsp configs. + -- For native lsp configs DiagnosticVirtualTextError = { bg = cp.none }, DiagnosticVirtualTextWarn = { bg = cp.none }, DiagnosticVirtualTextInfo = { bg = cp.none }, - DiagnosticVirtualTextHint = { fg = cp.rosewater, bg = cp.none }, - - DiagnosticHint = { fg = cp.rosewater }, - LspDiagnosticsDefaultHint = { fg = cp.rosewater }, - LspDiagnosticsHint = { fg = cp.rosewater }, - LspDiagnosticsVirtualTextHint = { fg = cp.rosewater }, - LspDiagnosticsUnderlineHint = { sp = cp.rosewater }, - - -- For fidget. + DiagnosticVirtualTextHint = { bg = cp.none }, + LspInfoBorder = { link = "FloatBorder" }, + + -- For mason.nvim + MasonNormal = { link = "NormalFloat" }, + + -- For nvim-cmp and wilder.nvim + Pmenu = { fg = cp.overlay2, bg = transparent_background and cp.none or cp.base }, + PmenuBorder = { fg = cp.surface1, bg = transparent_background and cp.none or cp.base }, + PmenuSel = { bg = cp.green, fg = cp.base }, + CmpItemAbbr = { fg = cp.overlay2 }, + CmpItemAbbrMatch = { fg = cp.blue, style = { "bold" } }, + CmpDoc = { link = "NormalFloat" }, + CmpDocBorder = { + fg = transparent_background and cp.surface1 or cp.mantle, + bg = transparent_background and cp.none or cp.mantle, + }, + + -- For fidget FidgetTask = { bg = cp.none, fg = cp.surface2 }, FidgetTitle = { fg = cp.blue, style = { "bold" } }, + -- For nvim-tree + NvimTreeRootFolder = { fg = cp.pink }, + NvimTreeIndentMarker = { fg = cp.surface0 }, + -- For trouble.nvim TroubleNormal = { bg = transparent_background and cp.none or cp.base }, - -- For lsp semantic tokens - ["@lsp.type.comment"] = { fg = cp.overlay0 }, - ["@lsp.type.enum"] = { link = "@type" }, - ["@lsp.type.property"] = { link = "@property" }, - ["@lsp.type.macro"] = { link = "@constant" }, - ["@lsp.typemod.function.defaultLibrary"] = { fg = cp.blue, style = { "bold", "italic" } }, - ["@lsp.typemod.function.defaultLibrary.c"] = { fg = cp.blue, style = { "bold" } }, - ["@lsp.typemod.function.defaultLibrary.cpp"] = { fg = cp.blue, style = { "bold" } }, - ["@lsp.typemod.method.defaultLibrary"] = { link = "@lsp.typemod.function.defaultLibrary" }, - ["@lsp.typemod.variable.defaultLibrary"] = { fg = cp.flamingo }, - - -- For treesitter. - ["@field"] = { fg = cp.rosewater }, - ["@property"] = { fg = cp.yellow }, - - ["@include"] = { fg = cp.teal }, - -- ["@operator"] = { fg = cp.sky }, - ["@keyword.operator"] = { fg = cp.sky }, - ["@punctuation.special"] = { fg = cp.maroon }, - - -- ["@float"] = { fg = cp.peach }, - -- ["@number"] = { fg = cp.peach }, - -- ["@boolean"] = { fg = cp.peach }, - - ["@constructor"] = { fg = cp.lavender }, - -- ["@constant"] = { fg = cp.peach }, - -- ["@conditional"] = { fg = cp.mauve }, - -- ["@repeat"] = { fg = cp.mauve }, - ["@exception"] = { fg = cp.peach }, - - ["@constant.builtin"] = { fg = cp.lavender }, - -- ["@function.builtin"] = { fg = cp.peach, style = { "italic" } }, - -- ["@type.builtin"] = { fg = cp.yellow, style = { "italic" } }, - ["@type.qualifier"] = { link = "@keyword" }, - ["@variable.builtin"] = { fg = cp.red, style = { "italic" } }, - - -- ["@function"] = { fg = cp.blue }, - ["@function.macro"] = { fg = cp.red, style = {} }, - ["@parameter"] = { fg = cp.rosewater }, - ["@keyword"] = { fg = cp.red, style = { "italic" } }, - ["@keyword.function"] = { fg = cp.maroon }, - ["@keyword.return"] = { fg = cp.pink, style = {} }, - - -- ["@text.note"] = { fg = cp.base, bg = cp.blue }, - -- ["@text.warning"] = { fg = cp.base, bg = cp.yellow }, - -- ["@text.danger"] = { fg = cp.base, bg = cp.red }, - -- ["@constant.macro"] = { fg = cp.mauve }, - - -- ["@label"] = { fg = cp.blue }, - ["@method"] = { fg = cp.blue, style = { "italic" } }, - ["@namespace"] = { fg = cp.rosewater, style = {} }, - - ["@punctuation.delimiter"] = { fg = cp.teal }, - ["@punctuation.bracket"] = { fg = cp.overlay2 }, - -- ["@string"] = { fg = cp.green }, - -- ["@string.regex"] = { fg = cp.peach }, - ["@type"] = { fg = cp.yellow }, - ["@variable"] = { fg = cp.text }, - ["@tag.attribute"] = { fg = cp.mauve, style = { "italic" } }, - ["@tag"] = { fg = cp.peach }, - ["@tag.delimiter"] = { fg = cp.maroon }, - ["@text"] = { fg = cp.text }, - - -- ["@text.uri"] = { fg = cp.rosewater, style = { "italic", "underline" } }, - -- ["@text.literal"] = { fg = cp.teal, style = { "italic" } }, - -- ["@text.reference"] = { fg = cp.lavender, style = { "bold" } }, - -- ["@text.title"] = { fg = cp.blue, style = { "bold" } }, - -- ["@text.emphasis"] = { fg = cp.maroon, style = { "italic" } }, - -- ["@text.strong"] = { fg = cp.maroon, style = { "bold" } }, - -- ["@string.escape"] = { fg = cp.pink }, - - -- ["@property.toml"] = { fg = cp.blue }, - -- ["@field.yaml"] = { fg = cp.blue }, - - -- ["@label.json"] = { fg = cp.blue }, - - ["@function.builtin.bash"] = { fg = cp.red, style = { "italic" } }, - ["@parameter.bash"] = { fg = cp.yellow, style = { "italic" } }, - - ["@field.lua"] = { fg = cp.lavender }, - ["@constructor.lua"] = { fg = cp.flamingo }, - ["@variable.builtin.lua"] = { fg = cp.flamingo, style = { "italic" } }, - - ["@constant.java"] = { fg = cp.teal }, - - ["@property.typescript"] = { fg = cp.lavender, style = { "italic" } }, - -- ["@constructor.typescript"] = { fg = cp.lavender }, - - -- ["@constructor.tsx"] = { fg = cp.lavender }, - -- ["@tag.attribute.tsx"] = { fg = cp.mauve }, - - ["@type.css"] = { fg = cp.lavender }, - ["@property.css"] = { fg = cp.yellow, style = { "italic" } }, - - ["@type.builtin.c"] = { fg = cp.yellow, style = {} }, - - ["@property.cpp"] = { fg = cp.text }, - ["@type.builtin.cpp"] = { fg = cp.yellow, style = {} }, - - -- ["@symbol"] = { fg = cp.flamingo }, + -- For telescope.nvim + TelescopeBorder = { fg = cp.mantle, bg = cp.mantle }, + TelescopePromptBorder = { fg = cp.surface0, bg = cp.surface0 }, + TelescopePromptNormal = { fg = cp.text, bg = cp.surface0 }, + TelescopePromptPrefix = { fg = cp.flamingo, bg = cp.surface0 }, + TelescopeNormal = { bg = cp.mantle }, + TelescopePreviewTitle = { fg = cp.base, bg = cp.green }, + TelescopePromptTitle = { fg = cp.base, bg = cp.red }, + TelescopeResultsTitle = { fg = cp.mantle, bg = cp.mantle }, + TelescopeSelection = { fg = cp.text, bg = cp.surface0 }, + TelescopeResultsDiffAdd = { fg = cp.green }, + TelescopeResultsDiffChange = { fg = cp.yellow }, + TelescopeResultsDiffDelete = { fg = cp.red }, + + -- For treesitter + ["@keyword.return"] = { fg = cp.pink, style = clear }, } end, }, diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua index 7282022a0a..addfb00d8c 100644 --- a/lua/modules/plugins/completion.lua +++ b/lua/modules/plugins/completion.lua @@ -42,7 +42,7 @@ completion["hrsh7th/nvim-cmp"] = { { "f3fora/cmp-spell" }, { "hrsh7th/cmp-buffer" }, { "kdheepak/cmp-latex-symbols" }, - { "ray-x/cmp-treesitter" }, + { "ray-x/cmp-treesitter", commit = "c8e3a74" }, -- { "tzachar/cmp-tabnine", build = "./install.sh", config = require("completion.tabnine") }, { "jcdickinson/codeium.nvim", diff --git a/lua/modules/plugins/ui.lua b/lua/modules/plugins/ui.lua index dc203ef8f8..9f0b7eb471 100644 --- a/lua/modules/plugins/ui.lua +++ b/lua/modules/plugins/ui.lua @@ -10,8 +10,9 @@ ui["akinsho/bufferline.nvim"] = { event = { "BufReadPost", "BufAdd", "BufNewFile" }, config = require("ui.bufferline"), } -ui["catppuccin/nvim"] = { +ui["Jint-lzxy/nvim"] = { lazy = false, + branch = "refactor/syntax-highlighting", name = "catppuccin", config = require("ui.catppuccin"), } diff --git a/lua/modules/utils/init.lua b/lua/modules/utils/init.lua index bf0371c479..1df349d689 100644 --- a/lua/modules/utils/init.lua +++ b/lua/modules/utils/init.lua @@ -195,8 +195,8 @@ function M.gen_alpha_hl() local colors = M.get_palette() vim.api.nvim_set_hl(0, "AlphaHeader", { fg = colors.blue, default = true }) - vim.api.nvim_set_hl(0, "AlphaButton", { fg = colors.green, default = true }) - vim.api.nvim_set_hl(0, "AlphaAttr", { fg = colors.pink, italic = true, default = true }) + vim.api.nvim_set_hl(0, "AlphaButtons", { fg = colors.green, default = true }) + vim.api.nvim_set_hl(0, "AlphaShortcut", { fg = colors.pink, italic = true, default = true }) vim.api.nvim_set_hl(0, "AlphaFooter", { fg = colors.yellow, default = true }) end