From 02bc1c9d542a3e2c331bb1808fc05cb2c780370b Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 19 Jul 2024 20:43:38 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Fancify=20hlchunck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add fancy glyphs and colors - Reduce visibility and auto-dark the colors - Reduces distraction while still providing information - Make cmp-yanky only use history from the same filetyle --- lua/config/ui.lua | 84 ++++++++++++++++++++++++++++++++++++++++++ lua/plugins/coding.lua | 66 +++------------------------------ 2 files changed, 90 insertions(+), 60 deletions(-) diff --git a/lua/config/ui.lua b/lua/config/ui.lua index a70bdb0..f8554fd 100644 --- a/lua/config/ui.lua +++ b/lua/config/ui.lua @@ -33,4 +33,88 @@ return { return not ssh end, }, + { + "shellRaining/hlchunk.nvim", + event = "BufEnter", + config = function() + local cb = function() + if vim.g.colors_name == "tokyonight" then + return "#806d9c" + elseif vim.g.colors_name:find("catppuccin") then + local catpalette = require("catppuccin.palettes").get_palette() + return catpalette.teal + elseif vim.g.colors_name == "monochrome" or "github_dark" then + return "#CCCCCC" + elseif vim.g.colors_name == "gruvbox" then + return "#a9b665" + elseif vim.g.colors_name == "dracula" or "eldritch" then + return "#50fa7b" + elseif vim.g.colors_name == "onedark" or "nightfox" then + return "#98C379" + elseif vim.g.colors_name == "nord" then + return "#81A1C1" + elseif vim.g.colors_name == "kanagawa" then + return "#73C8AD" + elseif vim.g.colors_name == "everforest" then + return "#8FBCBB" + elseif vim.g.colors_name == "github_light" or "paper" then + return "#3f3f5a" + elseif vim.g.colors_name == "neofusion" then + return "#420ADD" + else + return "#7581FF" + end + end + local common_config = { + chunk = { + style = { + { fg = cb }, + }, + enable = true, + }, + indent = { + enable = true, + use_treesitter = true, + chars = { + "․․", + "⁚⁚", + "⁖⁖", + "⁘⁘", + "⁙⁙", + "󱗿󱗿", + "󱗽󱗽", + "󱗼󱗼", + }, + }, + } + if vim.o.background == "dark" then + common_config.indent.style = { + { fg = "#434437" }, + { fg = "#2f4440" }, + { fg = "#433054" }, + { fg = "#284251" }, + { fg = "#3e4451" }, + { fg = "#565c64" }, + { fg = "#6b737f" }, + { fg = "#848a91" }, + } + else + common_config.indent.style = { + { fg = "#d0b0b0" }, + { fg = "#b0b0d0" }, + { fg = "#b0d0b0" }, + { fg = "#a0a0a0" }, + { fg = "#c0c0c0" }, + { fg = "#e0e0e0" }, + { fg = "#f0f0f0" }, + { fg = "#ffffff" }, + } + end + require("hlchunk").setup(common_config) + end, + }, + { + "ton/vim-alternate", + event = "VeryLazy", + }, } diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 1e2690d..c1a9628 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -76,7 +76,12 @@ return { end, dependencies = { "hrsh7th/cmp-emoji", - "chrisgrieser/cmp_yanky", + { + "chrisgrieser/cmp_yanky", + option = { + onlyCurrentFiletype = false, + }, + }, "SergioRibera/cmp-dotenv", "hrsh7th/cmp-calc", "davidsierradz/cmp-conventionalcommits", @@ -101,63 +106,4 @@ return { }, }, }, - { - "shellRaining/hlchunk.nvim", - event = "BufEnter", - config = function() - local cb = function() - if vim.g.colors_name == "tokyonight" then - return "#806d9c" - elseif vim.g.colors_name:find("catppuccin") then - local catpalette = require("catppuccin.palettes").get_palette() - return catpalette.green - elseif vim.g.colors_name == "monochrome" then - return "#CCCCCC" - elseif vim.g.colors_name == "gruvbox" then - return "#a9b665" - elseif vim.g.colors_name == "dracula" then - return "#50fa7b" - elseif vim.g.colors_name == "onedark" then - return "#98C379" - elseif vim.g.colors_name == "nightfox" then - return "#98C379" - elseif vim.g.colors_name == "nord" then - return "#81A1C1" - elseif vim.g.colors_name == "kanagawa" then - return "#73C8AD" - elseif vim.g.colors_name == "everforest" then - return "#8FBCBB" - elseif vim.g.colors_name == "github_dark" then - return "#FFFFFF" - elseif vim.g.colors_name == "github_light" then - return "#3f3f3f" - elseif vim.g.colors_name == "neofusion" then - return "#420ADD" - else - return "#7581FF" - end - end - require("hlchunk").setup({ - chunk = { - style = { - { fg = cb }, - }, - enable = true, - }, - indent = { - enable = function() - if vim.g.colors_name == "monochrome" then - return false - else - return true - end - end, - }, - }) - end, - }, - { - "ton/vim-alternate", - event = "VeryLazy", - }, }