From 63d946942e485b2e52350db3f625cac5e8d47a59 Mon Sep 17 00:00:00 2001 From: marshmallow Date: Fri, 24 Oct 2025 17:34:53 +1100 Subject: [PATCH] try out everforest --- candy/lua/marshmallow/defaults.lua | 4 +- candy/lua/marshmallow/init.lua | 1 - candy/lua/marshmallow/remap.lua | 2 +- candy/lua/marshmallow/statusline.lua | 35 +++++---- candy/lua/marshmallow/usercommand.lua | 106 +++++++++++++------------- flake.nix | 5 +- 6 files changed, 81 insertions(+), 72 deletions(-) diff --git a/candy/lua/marshmallow/defaults.lua b/candy/lua/marshmallow/defaults.lua index 4446060..fb905c4 100644 --- a/candy/lua/marshmallow/defaults.lua +++ b/candy/lua/marshmallow/defaults.lua @@ -4,7 +4,9 @@ vim.o.timeout = true vim.o.timeoutlen = 300 -- Colourscheme -- -vim.cmd.colorscheme("lackluster-mint") +vim.g.everforest_enable_italic = true +vim.g.everforest_background = "hard" +vim.cmd.colorscheme("everforest") -- Terminal -- vim.opt.termguicolors = true diff --git a/candy/lua/marshmallow/init.lua b/candy/lua/marshmallow/init.lua index 3805074..5c0fe7f 100644 --- a/candy/lua/marshmallow/init.lua +++ b/candy/lua/marshmallow/init.lua @@ -22,4 +22,3 @@ require("marshmallow.usercommand") require("marshmallow.autocmd") require("marshmallow.env") require("marshmallow.git") -require("marshmallow.llm") diff --git a/candy/lua/marshmallow/remap.lua b/candy/lua/marshmallow/remap.lua index 133d393..eab086e 100644 --- a/candy/lua/marshmallow/remap.lua +++ b/candy/lua/marshmallow/remap.lua @@ -107,7 +107,7 @@ vim.keymap.set("n", "/", function() local cope = function() local query = require("mini.pick").get_picker_query() - vim.cmd("Ggrep " .. table.concat(query)) + vim.cmd("vimgrep " .. table.concat(query)) return true end diff --git a/candy/lua/marshmallow/statusline.lua b/candy/lua/marshmallow/statusline.lua index f957594..eb2e12b 100644 --- a/candy/lua/marshmallow/statusline.lua +++ b/candy/lua/marshmallow/statusline.lua @@ -30,13 +30,28 @@ local function set_highlights_lackluster(recording) }) end +local function set_highlights_everforest(recording) + local config = vim.fn["everforest#get_configuration"]() + local palette = vim.fn["everforest#get_palette"](config.background, config.colors_override) + local set_hl = vim.fn["everforest#highlight"] + + local bg = palette.bg1 + local fg = recording and palette.red or palette.fg + + set_hl("StatusLine", fg, bg) + set_hl("Ruler", palette.statusline3, bg) + set_hl("StatusLsp", palette.statusline3, bg) + set_hl("StatusFt", palette.statusline2, bg) + set_hl("StatusHead", palette.statusline1, bg) +end + local augroup = vim.api.nvim_create_augroup("StatusLine", { clear = true }) vim.api.nvim_create_autocmd({ "ColorScheme", "RecordingLeave" }, { pattern = "*", group = augroup, callback = function() - set_highlights_lackluster(false) + set_highlights_everforest(false) end, }) @@ -44,20 +59,10 @@ vim.api.nvim_create_autocmd({ "RecordingEnter" }, { pattern = "*", group = augroup, callback = function() - set_highlights_lackluster(true) + set_highlights_everforest(true) end, }) -local function get_scrollbar() - local bars = { "🭶", "🭷", "🭸", "🭹", "🭺", "🭻" } - local current_line = vim.api.nvim_win_get_cursor(0)[1] - local lines = vim.api.nvim_buf_line_count(0) - - local i = math.floor((current_line - 1) / lines * #bars) + 1 - - return "%p%% %#Ruler#" .. string.rep(bars[i], 2) -end - local function finish() local bufnr = vim.api.nvim_get_current_buf() local clients = vim.lsp.get_clients({ bufnr = bufnr }) @@ -65,11 +70,11 @@ local function finish() return value.name end, clients) - return "%(%#StatusLsp#" .. vim.fn.join(names, ", ") .. "%* %#StatusFt#%y%* %l,%c " .. get_scrollbar() .. "%)" + return "%(%#StatusLsp#" .. vim.fn.join(names, ", ") .. "%* %#StatusFt#%y%* %l,%c %)" end local function git() - return " %{FugitiveStatusline()} " + return " %#StatusHead#%{FugitiveStatusline()} " end local function first() @@ -89,4 +94,6 @@ function M.statusline() return first() .. "%=" .. center() .. finish() end +set_highlights_everforest(false) + return M diff --git a/candy/lua/marshmallow/usercommand.lua b/candy/lua/marshmallow/usercommand.lua index 300f6eb..e7ca0dd 100644 --- a/candy/lua/marshmallow/usercommand.lua +++ b/candy/lua/marshmallow/usercommand.lua @@ -79,59 +79,59 @@ local mods_prompt = function(context, arg) -- buf = buf, -- }) - local obj = vim.system({ "mods", arg }, { - stdin = context, - text = true, - detach = true, - stdout = function(err, data) - vim.schedule(function() - -- if string.find(data, "\n") then - -- local lines = vim.split(data, "\n") - -- local last_line = vim.api.nvim_buf_line_count(buf) - -- vim.api.nvim_buf_set_lines(buf, last_line, last_line, false, lines) - -- else - - local lines = vim.split(data, "\n") - - local first = true - - for key, line in pairs(lines) do - local length = vim.api.nvim_buf_line_count(buf) - - if not first then - vim.api.nvim_buf_set_lines(buf, length, length, false, { "" }) - length = length + 1 - end - - local col = vim.fn.col({ length, "$" }) - 1 - -- local existing_line = vim.api.nvim_buf_get_text(buf, length - 1, 0, length - 1, -1, {})[1] - -- local new_line = existing_line .. data - -- - -- vim.api.nvim_buf_set_lines(buf, length - 1, length - 1, false, { - -- new_line, - -- }) - vim.api.nvim_buf_set_text(buf, length - 1, col, length - 1, col, { - line, - }) - - first = false - end - - -- if string.find(data, "\n") then - -- vim.api.nvim_buf_set_lines(buf, length, length, false, { "" }) - -- end - - -- vim.api.nvim_win_call(window, function() - -- vim.cmd("normal! G") - -- end) - end) - end, - stderr = function(err, data) - vim.schedule(function() - vim.notify(data, vim.log.levels.ERROR) - end) - end, - }) + -- local obj = vim.system({ "mods", arg }, { + -- stdin = context, + -- text = true, + -- detach = true, + -- stdout = function(err, data) + -- vim.schedule(function() + -- -- if string.find(data, "\n") then + -- -- local lines = vim.split(data, "\n") + -- -- local last_line = vim.api.nvim_buf_line_count(buf) + -- -- vim.api.nvim_buf_set_lines(buf, last_line, last_line, false, lines) + -- -- else + -- + -- local lines = vim.split(data, "\n") + -- + -- local first = true + -- + -- for key, line in pairs(lines) do + -- local length = vim.api.nvim_buf_line_count(buf) + -- + -- if not first then + -- vim.api.nvim_buf_set_lines(buf, length, length, false, { "" }) + -- length = length + 1 + -- end + -- + -- local col = vim.fn.col({ length, "$" }) - 1 + -- -- local existing_line = vim.api.nvim_buf_get_text(buf, length - 1, 0, length - 1, -1, {})[1] + -- -- local new_line = existing_line .. data + -- -- + -- -- vim.api.nvim_buf_set_lines(buf, length - 1, length - 1, false, { + -- -- new_line, + -- -- }) + -- vim.api.nvim_buf_set_text(buf, length - 1, col, length - 1, col, { + -- line, + -- }) + -- + -- first = false + -- end + -- + -- -- if string.find(data, "\n") then + -- -- vim.api.nvim_buf_set_lines(buf, length, length, false, { "" }) + -- -- end + -- + -- -- vim.api.nvim_win_call(window, function() + -- -- vim.cmd("normal! G") + -- -- end) + -- end) + -- end, + -- stderr = function(err, data) + -- vim.schedule(function() + -- vim.notify(data, vim.log.levels.ERROR) + -- end) + -- end, + -- }) vim.print(obj) end diff --git a/flake.nix b/flake.nix index 4666661..31c55a6 100644 --- a/flake.nix +++ b/flake.nix @@ -72,6 +72,7 @@ pyright tinymist sourcekit-lsp + ripgrep ]; config = { plugins = @@ -87,10 +88,11 @@ nvim-treesitter.withAllGrammars nvim-lspconfig catppuccin-nvim + lackluster-nvim + everforest mini-nvim colorizer luasnip - minuet-ai-nvim (opt conform-nvim) plenary-nvim (pkgs.vimUtils.buildVimPlugin { @@ -99,7 +101,6 @@ doCheck = false; }) rustaceanvim - lackluster-nvim typescript-tools-nvim direnv-vim vim-dotenv -- 2.51.2