diff --git a/flake.nix b/flake.nix --- 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 diff --git a/candy/lua/marshmallow/defaults.lua b/candy/lua/marshmallow/defaults.lua --- a/candy/lua/marshmallow/defaults.lua +++ b/candy/lua/marshmallow/defaults.lua @@ -4,7 +4,9 @@ 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 --- a/candy/lua/marshmallow/init.lua +++ b/candy/lua/marshmallow/init.lua @@ -22,4 +22,3 @@ 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 --- a/candy/lua/marshmallow/remap.lua +++ b/candy/lua/marshmallow/remap.lua @@ -107,7 +107,7 @@ 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 --- a/candy/lua/marshmallow/statusline.lua +++ b/candy/lua/marshmallow/statusline.lua @@ -30,13 +30,28 @@ }) 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,19 +59,9 @@ 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() @@ -65,11 +70,11 @@ 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() @@ -88,5 +93,7 @@ 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 --- a/candy/lua/marshmallow/usercommand.lua +++ b/candy/lua/marshmallow/usercommand.lua @@ -79,59 +79,59 @@ -- 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