From 7918544153bb6b05c4ba7ea50b1dbf25a6f9218c Mon Sep 17 00:00:00 2001 From: Steven Crawford Date: Thu, 11 Dec 2025 23:01:44 -0600 Subject: [PATCH] cleaning things up --- lua/shelbybark/plugins/lsp/lspconfig.lua | 17 ++-- lua/shelbybark/plugins/lualine.lua | 100 +++++++++++++++++++++-- lua/shelbybark/plugins/minuet-ai.lua | 49 +++++++++++ 3 files changed, 154 insertions(+), 12 deletions(-) create mode 100644 lua/shelbybark/plugins/minuet-ai.lua diff --git a/lua/shelbybark/plugins/lsp/lspconfig.lua b/lua/shelbybark/plugins/lsp/lspconfig.lua index 10be9d8..be5477d 100644 --- a/lua/shelbybark/plugins/lsp/lspconfig.lua +++ b/lua/shelbybark/plugins/lsp/lspconfig.lua @@ -50,13 +50,18 @@ return { }) ----------------------------------------------------------------------- - -- 2) Diagnostics signs (same icons you had; adjust if you used others) + -- 2) Diagnostics signs (modern approach) ----------------------------------------------------------------------- - local signs = { Error = "", Warn = "", Hint = "󰌵", Info = "" } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = "", + [vim.diagnostic.severity.HINT] = "󰌵", + [vim.diagnostic.severity.INFO] = "", + }, + }, + }) ----------------------------------------------------------------------- -- 3) Capabilities (nvim-cmp) applied to *all* servers diff --git a/lua/shelbybark/plugins/lualine.lua b/lua/shelbybark/plugins/lualine.lua index ddc751c..0dc3303 100644 --- a/lua/shelbybark/plugins/lualine.lua +++ b/lua/shelbybark/plugins/lualine.lua @@ -5,19 +5,87 @@ return { local lualine = require("lualine") local lazy_status = require("lazy.status") -- to configure lazy pending updates count - -- CodeCompanion status function + -- Toggle for shortened mode names + vim.g.lualine_use_short_modes = vim.g.lualine_use_short_modes or true + + -- Short mode names (single letters) + local short_mode_map = { + ['n'] = 'N', + ['no'] = 'N', + ['nov'] = 'N', + ['noV'] = 'N', + ['niI'] = 'N', + ['niR'] = 'N', + ['niV'] = 'N', + ['i'] = 'I', + ['ic'] = 'I', + ['ix'] = 'I', + ['v'] = 'V', + ['V'] = 'VL', + [''] = 'VB', + ['s'] = 'S', + ['S'] = 'SL', + [''] = 'SB', + ['r'] = 'R', + ['rm'] = 'R', + ['r?'] = 'R', + ['R'] = 'R', + ['Rv'] = 'R', + ['c'] = 'C', + ['cv'] = 'C', + ['ce'] = 'C', + ['t'] = 'T', + } + + -- Full mode names + local full_mode_map = { + ['n'] = 'NORMAL', + ['no'] = 'NORMAL', + ['nov'] = 'NORMAL', + ['noV'] = 'NORMAL', + ['niI'] = 'NORMAL', + ['niR'] = 'NORMAL', + ['niV'] = 'NORMAL', + ['i'] = 'INSERT', + ['ic'] = 'INSERT', + ['ix'] = 'INSERT', + ['v'] = 'VISUAL', + ['V'] = 'V-LINE', + [''] = 'V-BLOCK', + ['s'] = 'SELECT', + ['S'] = 'S-LINE', + [''] = 'S-BLOCK', + ['r'] = 'REPLACE', + ['rm'] = 'REPLACE', + ['r?'] = 'REPLACE', + ['R'] = 'REPLACE', + ['Rv'] = 'REPLACE', + ['c'] = 'COMMAND', + ['cv'] = 'COMMAND', + ['ce'] = 'COMMAND', + ['t'] = 'TERMINAL', + } + + -- Better CodeCompanion status function local function codecompanion_status() local ok, codecompanion = pcall(require, "codecompanion") if not ok then return "" end + -- Check for active chats or requests local status = codecompanion.status() if status and status ~= "" then - return "🤖 " .. status - else - return "" + return "🤖" end + + -- Also check if there are any active chat buffers + local chat_ok, chat = pcall(codecompanion.buf_get_chat) + if chat_ok and chat then + return "💬" + end + + return "" end local colors = { @@ -74,6 +142,18 @@ return { section_separators = "", }, sections = { + lualine_a = { + { + function() + local mode = vim.fn.mode() + if vim.g.lualine_use_short_modes then + return short_mode_map[mode] or mode + else + return full_mode_map[mode] or mode + end + end, + }, + }, lualine_x = { { codecompanion_status, @@ -84,11 +164,19 @@ return { cond = lazy_status.has_updates, color = { fg = "#ff9e64" }, }, - { "encoding" }, - { "fileformat" }, { "filetype" }, }, }, }) + + -- Create command to toggle short modes + vim.api.nvim_create_user_command('ToggleLualineShortModes', function() + vim.g.lualine_use_short_modes = not vim.g.lualine_use_short_modes + require('lualine').refresh() + local status = vim.g.lualine_use_short_modes and 'short (single letter)' or 'full words' + vim.notify('Lualine modes set to ' .. status, vim.log.levels.INFO) + end, { + desc = 'Toggle between short and full mode names in lualine' + }) end, } diff --git a/lua/shelbybark/plugins/minuet-ai.lua b/lua/shelbybark/plugins/minuet-ai.lua new file mode 100644 index 0000000..59817fd --- /dev/null +++ b/lua/shelbybark/plugins/minuet-ai.lua @@ -0,0 +1,49 @@ +return { + "milanglacier/minuet-ai.nvim", + dependencies = { + "hrsh7th/nvim-cmp", + "nvim-lua/plenary.nvim", + }, + event = "InsertEnter", + config = function() + require("minuet").setup({ + provider = "gemini", + provider_options = { + gemini = { + model = "gemini-1.5-flash", -- or "gemini-1.5-pro" + api_key = "GEMINI_API_KEY", -- Environment variable name + max_tokens = 512, + temperature = 0.1, + top_p = 1, + }, + }, + -- Completion settings + completion = { + enabled = true, + auto_trigger = true, + trigger_delay = 100, -- ms + max_lines = 20, + }, + -- Display settings + display = { + ghost_text = { + enabled = true, + hl_group = "Comment", + }, + notification = { + enabled = true, + timeout = 3000, + }, + }, + -- Keymaps + keymaps = { + accept = "", + accept_word = "", + accept_line = "", + dismiss = "", + cycle_next = "", + cycle_prev = "", + }, + }) + end, +}