From 7864f9365276fbdbe25713f9d3a225b3c0c4aeb1 Mon Sep 17 00:00:00 2001 From: Steve Beaulac Date: Thu, 2 Apr 2026 13:41:37 -0400 Subject: [PATCH] chore(nvim): formatted code --- config/nvim/lua/plugins/ft.lua | 133 +- config/nvim/lua/plugins/ide.lua | 2226 ++++++++++++++--------------- config/nvim/lua/plugins/init.lua | 73 +- config/nvim/lua/plugins/tools.lua | 499 ++++--- config/nvim/lua/plugins/ui.lua | 362 +++-- 5 files changed, 1607 insertions(+), 1686 deletions(-) diff --git a/config/nvim/lua/plugins/ft.lua b/config/nvim/lua/plugins/ft.lua index 6f82cee..5ea80ee 100644 --- a/config/nvim/lua/plugins/ft.lua +++ b/config/nvim/lua/plugins/ft.lua @@ -1,43 +1,34 @@ return { -{ - "mfussenegger/nvim-ansible", - lazy = true, - keys = function() - vim.keymap.set('v', 'te', function() require('ansible').run() end, { buffer = true, silent = true }) - vim.keymap.set('n', 'te', ":w :lua require('ansible').run()", { buffer = true, silent = true }) - end, - }, - -{ - "hat0uma/csvview.nvim", - ---@module "csvview" - ---@type CsvView.Options - opts = { - parser = { comments = { "#", "//" } }, - keymaps = { - -- Text objects for selecting fields - textobject_field_inner = { "if", mode = { "o", "x" } }, - textobject_field_outer = { "af", mode = { "o", "x" } }, - -- Excel-like navigation: - -- Use and to move horizontally between fields. - -- Use and to move vertically between rows and place the cursor at the end of the field. - -- Note: In terminals, you may need to enable CSI-u mode to use and . - jump_next_field_end = { "", mode = { "n", "v" } }, - jump_prev_field_end = { "", mode = { "n", "v" } }, - jump_next_row = { "", mode = { "n", "v" } }, - jump_prev_row = { "", mode = { "n", "v" } }, - }, - }, - cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" }, - }, - -{ + { + "mfussenegger/nvim-ansible", + lazy = true, + keys = function() + vim.keymap.set('v', 'te', function() require('ansible').run() end, { buffer = true, silent = true }) + vim.keymap.set('n', 'te', ":w :lua require('ansible').run()", { buffer = true, silent = true }) + end, + }, + { + "hat0uma/csvview.nvim", + opts = { + parser = { comments = { "#", "//" } }, + keymaps = { + textobject_field_inner = { "if", mode = { "o", "x" } }, + textobject_field_outer = { "af", mode = { "o", "x" } }, + jump_next_field_end = { "", mode = { "n", "v" } }, + jump_prev_field_end = { "", mode = { "n", "v" } }, + jump_next_row = { "", mode = { "n", "v" } }, + jump_prev_row = { "", mode = { "n", "v" } }, + }, + }, + cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" }, + }, + { "obsidian-nvim/obsidian.nvim", lazy = false, ft = "markdown", keys = { - { "kx", "Obsidian extract_note", desc = "Extract Note", mode = "v" }, + { "kx", "Obsidian extract_note", desc = "Extract Note", mode = "v" }, { "knn", "Obsidian new", desc = "New Obsidian note", mode = "n" }, { "knt", "Obsidian new_from_template", desc = "New from template", mode = "n" }, @@ -82,9 +73,9 @@ return { tags = "", }, completion = { - nvim_cmp = false, - blink = true, - min_chars = 2, + nvim_cmp = false, + blink = true, + min_chars = 2, }, link = { style = "wiki", @@ -101,7 +92,7 @@ return { end return suffix end, - + callbacks = { enter_note = function(note) vim.keymap.set('n', 'k.', 'Obsidian toggle_checkbox', { desc = 'toggle checkbox', buffer = note.bufnr, silent = true }) @@ -119,8 +110,7 @@ return { }) end, }, - -{ + { "salkin-mada/openscad.nvim", lazy = true, config = function() @@ -129,15 +119,14 @@ return { end, dependencies = { "L3MON4D3/LuaSnip", "junegunn/fzf.vim" }, }, - -{ + { -- 'nvim-orgmode/orgmode', 'SjB/orgmode', branch = 'sjb-wip', event = 'VeryLazy', ft = { 'org' }, config = function() - -- Setup orgmode + -- Setup orgmode local org = require('orgmode') -- org.setup_ts_grammar() org.setup({ @@ -177,8 +166,7 @@ return { }) end, }, - -{ + { "akinsho/org-bullets.nvim", config = function() require("org-bullets").setup { @@ -212,40 +200,37 @@ return { } end }, - -{ + { "chipsenkbeil/org-roam.nvim", lazy = true, ft = { 'org' }, opts = { - bindings = { + bindings = { prefix = "oO", - }, - directory = "~/Documents/notes", - extensions = { - dailies = { - directory = "journals" - }, - }, + }, + directory = "~/Documents/notes", + extensions = { + dailies = { + directory = "journals" + }, + }, }, }, - -{ - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - ft = { "markdown" }, - init = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - keys = function() - vim.keymap.set("n", "xmp", "MarkdownPreview", { desc ="Markdown Preview" }) - vim.keymap.set("n", "xms", "MarkdownPreviewStop", { desc ="Markdown Preview Stop" }) - end, - build = function() vim.fn["mkdp#util#install"]() end, - --build = "cd app && npm install", + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + ft = { "markdown" }, + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + keys = function() + vim.keymap.set("n", "xmp", "MarkdownPreview", { desc ="Markdown Preview" }) + vim.keymap.set("n", "xms", "MarkdownPreviewStop", { desc ="Markdown Preview Stop" }) + end, + build = function() vim.fn["mkdp#util#install"]() end, + --build = "cd app && npm install", }, - -{ + { "lervag/vimtex", ft = "tex", -- Load only for .tex files config = function() @@ -256,14 +241,11 @@ return { vim.g.tex_conceal = "abdmg" -- Conceal accents, bold, delimiters, math, Greek end, }, - -{ + { 'MeanderingProgrammer/render-markdown.nvim', after = { 'nvim-treesitter' }, requires = { 'nvim-tree/nvim-web-devicons', opt = true }, ft = { 'markdown', 'codecompanion', 'copilot-chat' }, - ---@module 'render-markdown' - ---@type render.md.UserConfig config = function() require('render-markdown').setup({ completions = { lsp = { enabled = true } }, @@ -299,5 +281,4 @@ return { }) end, }, - } diff --git a/config/nvim/lua/plugins/ide.lua b/config/nvim/lua/plugins/ide.lua index c0b1a93..20bc11d 100644 --- a/config/nvim/lua/plugins/ide.lua +++ b/config/nvim/lua/plugins/ide.lua @@ -1,266 +1,265 @@ return { + { + "Davidyz/VectorCode", + version = "*", + build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date + -- build = "pipx upgrade vectorcode", -- If you used pipx to install the CLI + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { 'j-hui/fidget.nvim', lazy = true }, + { + "olimorris/codecompanion.nvim", + version = "^18.0.0", + opts = {}, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "franco-ruggeri/codecompanion-spinner.nvim", + "ravitemer/codecompanion-history.nvim", + "cairijun/codecompanion-agentskills.nvim", + "ttgrules/cc-adapter-copilot-cli-acp", + }, + event = "VeryLazy", + keys = { + { "rct", "CodeCompanionChat Toggle", mode = {'n', 'v'}, { noremap = true, silent = true }, desc = "CC Toggle" }, + { "rca", "CodeCompanionActions", mode = { 'n', 'v' }, { noremap = true, silent = true }, desc = "CC Action" }, + { "rce", "CodeCompanion Explain", mode = { 'n' }, desc = "CC Explain" }, + { "rcf", "CodeCompanion Fix code", mode = { 'n' }, desc = "CC fix" }, + { "rcc", "CodeCompanionChat Add", mode = { 'v' }, { noremap = true, silent = true }, desc = "CC Add" }, + { 'rcr', 'CodeCompanion Code Review', mode = { 'v' }, desc = 'Code Review' }, + { 'rco', 'CodeCompanion Optimize Performance', mode = { 'v' }, desc = 'Optimize Code' }, + { 'rce', 'CodeCompanion Explain Code', mode = { 'v' }, desc = 'Explain Code' }, + { 'rcg', 'CodeCompanion Generate Tests', mode = { 'v' }, desc = 'Generate Tests' }, + { 'rcd', 'CodeCompanion Debug Analysis', mode = { 'v' }, desc = 'Debug Analysis' }, + }, + config = function() + local function get_abacus_key() + local handle = io.popen("pass show abacus.ai-api") + if not handle then return "" end + local result = handle:read("*a") + handle:close() + -- Remove trailing newline that 'pass' often adds + return result:gsub("%s+", "") + end -{ - "Davidyz/VectorCode", - version = "*", - build = "uv tool upgrade vectorcode", -- This helps keeping the CLI up-to-date - -- build = "pipx upgrade vectorcode", -- If you used pipx to install the CLI - dependencies = { "nvim-lua/plenary.nvim" }, - }, - { 'j-hui/fidget.nvim', lazy = true }, - { - "olimorris/codecompanion.nvim", - version = "^18.0.0", - opts = {}, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "franco-ruggeri/codecompanion-spinner.nvim", - "ravitemer/codecompanion-history.nvim", - "cairijun/codecompanion-agentskills.nvim", - "ttgrules/cc-adapter-copilot-cli-acp", - }, - event = "VeryLazy", - keys = { - { "rct", "CodeCompanionChat Toggle", mode = {'n', 'v'}, { noremap = true, silent = true }, desc = "CC Toggle" }, - { "rca", "CodeCompanionActions", mode = { 'n', 'v' }, { noremap = true, silent = true }, desc = "CC Action" }, - { "rce", "CodeCompanion Explain", mode = { 'n' }, desc = "CC Explain" }, - { "rcf", "CodeCompanion Fix code", mode = { 'n' }, desc = "CC fix" }, - { "rcc", "CodeCompanionChat Add", mode = { 'v' }, { noremap = true, silent = true }, desc = "CC Add" }, - { 'rcr', 'CodeCompanion Code Review', mode = { 'v' }, desc = 'Code Review' }, - { 'rco', 'CodeCompanion Optimize Performance', mode = { 'v' }, desc = 'Optimize Code' }, - { 'rce', 'CodeCompanion Explain Code', mode = { 'v' }, desc = 'Explain Code' }, - { 'rcg', 'CodeCompanion Generate Tests', mode = { 'v' }, desc = 'Generate Tests' }, - { 'rcd', 'CodeCompanion Debug Analysis', mode = { 'v' }, desc = 'Debug Analysis' }, - }, - config = function() - local function get_abacus_key() - local handle = io.popen("pass show abacus.ai-api") - if not handle then return "" end - local result = handle:read("*a") - handle:close() - -- Remove trailing newline that 'pass' often adds - return result:gsub("%s+", "") - end - - local codecompanion = require("codecompanion") - codecompanion.setup({ - adapters = { - http = { - opts = { - show_presets = true, - show_model_choices = true, - }, - -- openai = function() - -- return require("codecompanion.adapters").extend("openai", { - -- env = { api_key = "cmd:pass show api.openai.com" } - -- }) - -- end, - openrouter = function() - return require("codecompanion.adapters").extend("openai_compatible", { - env = { - url = "https://openrouter.ai/api", - api_key = "OPENROUTER_API_KEY", - chat_url = "/v1/chat/completions", - }, - schema = { - model = { - default = "anthropic/claude-3.7-sonnet", - }, - }, - }) - end, - abacus = function() - return require("codecompanion.adapters").extend("openai_compatible", { - name = "abacus", - formatted_name = "Abacus.AI", - env = { + local codecompanion = require("codecompanion") + codecompanion.setup({ + adapters = { + http = { + opts = { + show_presets = true, + show_model_choices = true, + }, + -- openai = function() + -- return require("codecompanion.adapters").extend("openai", { + -- env = { api_key = "cmd:pass show api.openai.com" } + -- }) + -- end, + openrouter = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + url = "https://openrouter.ai/api", + api_key = "OPENROUTER_API_KEY", + chat_url = "/v1/chat/completions", + }, + schema = { + model = { + default = "anthropic/claude-3.7-sonnet", + }, + }, + }) + end, + abacus = function() + return require("codecompanion.adapters").extend("openai_compatible", { + name = "abacus", + formatted_name = "Abacus.AI", + env = { url = "https://routellm.abacus.ai/v1", -- IMPORTANT: include /v1 in the base url api_key = get_abacus_key(), chat_url = "/chat/completions" - }, - headers = { - ["Content-Type"] = "application/json", - ["Authorization"] = "Bearer ${api_key}", - }, - schema = { - model = { - order = 1, - mapping = "parameters", - type = "enum", - desc = "The model to use for chat completions.", - default = "route-llm", - choices = { - -- Routing Model - ["route-llm"] = { opts = { desc = "Intelligent routing to best model" } }, + }, + headers = { + ["Content-Type"] = "application/json", + ["Authorization"] = "Bearer ${api_key}", + }, + schema = { + model = { + order = 1, + mapping = "parameters", + type = "enum", + desc = "The model to use for chat completions.", + default = "route-llm", + choices = { + -- Routing Model + ["route-llm"] = { opts = { desc = "Intelligent routing to best model" } }, - -- OpenAI Models - ["gpt-5.2"] = { opts = { has_vision = true } }, - ["gpt-5.1"] = { opts = { has_vision = true } }, - ["gpt-5.1-chat-latest"] = { opts = { has_vision = true } }, - ["gpt-5"] = { opts = { has_vision = true } }, - ["gpt-5-mini"] = { opts = { has_vision = true } }, - ["gpt-5-nano"] = { opts = { has_vision = true } }, - ["gpt-4o"] = { opts = { has_vision = true } }, - ["gpt-4o-mini"] = { opts = { has_vision = true } }, - ["o4-mini"] = { opts = { can_reason = true } }, - ["o3"] = { opts = { can_reason = true } }, - ["o3-pro"] = { opts = { can_reason = true } }, + -- OpenAI Models + ["gpt-5.2"] = { opts = { has_vision = true } }, + ["gpt-5.1"] = { opts = { has_vision = true } }, + ["gpt-5.1-chat-latest"] = { opts = { has_vision = true } }, + ["gpt-5"] = { opts = { has_vision = true } }, + ["gpt-5-mini"] = { opts = { has_vision = true } }, + ["gpt-5-nano"] = { opts = { has_vision = true } }, + ["gpt-4o"] = { opts = { has_vision = true } }, + ["gpt-4o-mini"] = { opts = { has_vision = true } }, + ["o4-mini"] = { opts = { can_reason = true } }, + ["o3"] = { opts = { can_reason = true } }, + ["o3-pro"] = { opts = { can_reason = true } }, - -- Anthropic Models - ["claude-4-5-sonnet"] = { opts = { has_vision = true } }, - ["claude-4-5-haiku"] = { opts = { has_vision = true } }, - ["claude-4-5-opus"] = { opts = { has_vision = true } }, - ["claude-3-opus"] = { opts = { has_vision = true } }, + -- Anthropic Models + ["claude-4-5-sonnet"] = { opts = { has_vision = true } }, + ["claude-4-5-haiku"] = { opts = { has_vision = true } }, + ["claude-4-5-opus"] = { opts = { has_vision = true } }, + ["claude-3-opus"] = { opts = { has_vision = true } }, - -- Google Models - ["gemini-3-pro"] = { opts = { has_vision = true } }, - ["gemini-3-flash"] = { opts = { has_vision = true } }, - ["gemini-2.5-pro"] = { opts = { has_vision = true } }, - ["gemini-2.5-flash"] = { opts = { has_vision = true } }, + -- Google Models + ["gemini-3-pro"] = { opts = { has_vision = true } }, + ["gemini-3-flash"] = { opts = { has_vision = true } }, + ["gemini-2.5-pro"] = { opts = { has_vision = true } }, + ["gemini-2.5-flash"] = { opts = { has_vision = true } }, - -- xAI Models - ["grok-4-1-fast"] = {}, - ["grok-4"] = {}, - ["grok-code-fast-1"] = {}, + -- xAI Models + ["grok-4-1-fast"] = {}, + ["grok-4"] = {}, + ["grok-code-fast-1"] = {}, - -- Meta Models - ["llama-4-Maverick-17B"] = {}, - ["llama-3.1-405B"] = {}, - ["llama-3.1-70B"] = {}, + -- Meta Models + ["llama-4-Maverick-17B"] = {}, + ["llama-3.1-405B"] = {}, + ["llama-3.1-70B"] = {}, - -- DeepSeek Models - ["deepseek-v3.2"] = {}, - ["deepseek-v3.1-Terminus"] = {}, - ["deepseek-R1"] = { opts = { can_reason = true } }, + -- DeepSeek Models + ["deepseek-v3.2"] = {}, + ["deepseek-v3.1-Terminus"] = {}, + ["deepseek-R1"] = { opts = { can_reason = true } }, - -- Qwen Models - ["qwen-3-Max"] = {}, - ["qwen3-coder-480b-a35b-instruct"] = {}, - ["qwen-3-32B"] = {}, - ["qwq-32B"] = { opts = { can_reason = true } }, - }, - }, - temperature = { - order = 2, - mapping = "parameters", - type = "number", - optional = true, - default = 1.0, - desc = "Controls randomness of output (0-2).", - validate = function(n) - return n >= 0 and n <= 2, "Must be between 0 and 2" - end, - }, - max_tokens = { - order = 3, - mapping = "parameters", - type = "integer", - optional = true, - default = nil, - desc = "Maximum tokens to generate.", - validate = function(n) - return n > 0, "Must be greater than 0" - end, - }, - top_p = { - order = 4, - mapping = "parameters", - type = "number", - optional = true, - default = 1.0, - desc = "Nucleus sampling parameter (0-1).", - validate = function(n) - return n >= 0 and n <= 1, "Must be between 0 and 1" - end, - }, - }, - }) - end, - ollama = function() - return require("codecompanion.adapters").extend("ollama", { - env = { - url = "http://129.100.33.66:11434", - }, - schema = { - model = { - default = "qwen3.5", -- change to whatever you pulled - }, - }, - }) - end, - copilot = function() - return require("codecompanion.adapters").extend("copilot", { - schema = { - model = { - default = "gpt-5-mini", -- Consistent model choice - }, - max_tokens = { - default = 16284, - } - } - }) - end, - }, - acp = { - opts = { - show_presets = true, - }, - copilot_cli = function() - return require("codecompanion.adapters").extend("copilot_cli", {}) - end, - codex = function() - return require("codecompanion.adapters").extend("codex", { - commands = { - default = { "codex-acp" }, - }, - schema = { - model = { - default = "github-copilot/gpt-5.2-codex", - }, - }, - defaults = { - timeout = 20000, - auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt" - }, - }) - end, - opencode = function() - return require("codecompanion.adapters").extend("codex", { - commands = { - default = { "opencode", "acp" }, - }, - schema = { - model = { - default = "github-copilot/gpt-5.2-codex", - }, - }, - defaults = { - timeout = 20000, - auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt" - }, - }) - end, - }, - }, - rules = { - opts = { - chat = { - enabled = true, - autoload = { "default" } - }, - }, - }, - opts = { + -- Qwen Models + ["qwen-3-Max"] = {}, + ["qwen3-coder-480b-a35b-instruct"] = {}, + ["qwen-3-32B"] = {}, + ["qwq-32B"] = { opts = { can_reason = true } }, + }, + }, + temperature = { + order = 2, + mapping = "parameters", + type = "number", + optional = true, + default = 1.0, + desc = "Controls randomness of output (0-2).", + validate = function(n) + return n >= 0 and n <= 2, "Must be between 0 and 2" + end, + }, + max_tokens = { + order = 3, + mapping = "parameters", + type = "integer", + optional = true, + default = nil, + desc = "Maximum tokens to generate.", + validate = function(n) + return n > 0, "Must be greater than 0" + end, + }, + top_p = { + order = 4, + mapping = "parameters", + type = "number", + optional = true, + default = 1.0, + desc = "Nucleus sampling parameter (0-1).", + validate = function(n) + return n >= 0 and n <= 1, "Must be between 0 and 1" + end, + }, + }, + }) + end, + ollama = function() + return require("codecompanion.adapters").extend("ollama", { + env = { + url = "http://129.100.33.66:11434", + }, + schema = { + model = { + default = "qwen3.5", -- change to whatever you pulled + }, + }, + }) + end, + copilot = function() + return require("codecompanion.adapters").extend("copilot", { + schema = { + model = { + default = "gpt-5-mini", -- Consistent model choice + }, + max_tokens = { + default = 16284, + } + } + }) + end, + }, + acp = { + opts = { + show_presets = true, + }, + copilot_cli = function() + return require("codecompanion.adapters").extend("copilot_cli", {}) + end, + codex = function() + return require("codecompanion.adapters").extend("codex", { + commands = { + default = { "codex-acp" }, + }, + schema = { + model = { + default = "github-copilot/gpt-5.2-codex", + }, + }, + defaults = { + timeout = 20000, + auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt" + }, + }) + end, + opencode = function() + return require("codecompanion.adapters").extend("codex", { + commands = { + default = { "opencode", "acp" }, + }, + schema = { + model = { + default = "github-copilot/gpt-5.2-codex", + }, + }, + defaults = { + timeout = 20000, + auth_method = "chatgpt", -- "openai-api-key"|"codex-api-key"|"chatgpt" + }, + }) + end, + }, + }, + rules = { + opts = { + chat = { + enabled = true, + autoload = { "default" } + }, + }, + }, + opts = { send_code = true, log_level = "WARN", -- Change to DEBUG for troubleshooting language = "English", -- NEW: Performance improvements job_start_delay = 500, -- Reduced from default 1500ms submit_delay = 1000, -- Reduced from default 2000ms - }, - extensions = { + }, + extensions = { spinner = {}, -- ddgr_search = { -- opts = { @@ -268,28 +267,28 @@ return { -- }, -- }, agentskills = { - opts = { - { "~/Documents/ai-skills", recursive = true }, - }, + opts = { + { "~/Documents/ai-skills", recursive = true }, + }, }, -- vectorcode = { lazy = true }, history = { - lazy = true, - enabled = true, - opts = { - keymap = "ghf", - save_chat_keymap = "ghs", - picker = "snacks", - dir_to_save = vim.env.HOME .. "/Documents/ai-history", - title_generation_opts = { - adapter = "copilot", - model = "gpt-5-mini", - }, - summary = { - create_summary_keymap = "ghc", - browse_summaries_keymap = "ghb", - }, - }, + lazy = true, + enabled = true, + opts = { + keymap = "ghf", + save_chat_keymap = "ghs", + picker = "snacks", + dir_to_save = vim.env.HOME .. "/Documents/ai-history", + title_generation_opts = { + adapter = "copilot", + model = "gpt-5-mini", + }, + summary = { + create_summary_keymap = "ghc", + browse_summaries_keymap = "ghb", + }, + }, }, -- mcphub = { -- callback = "mcphub.extensions.codecompanion", @@ -299,433 +298,431 @@ return { -- show_result_in_chat = true, -- }, -- }, - }, - interactions = { - chat = { + }, + interactions = { + chat = { variables = { - project = { - callback = function() - -- Get project files structure - local files = vim.fn.systemlist("fd . -type f") - return table.concat(files, "\n") - end, - description = "Share project structure" - } - }, - tools = { - opts = { - auto_submit_errors = true, -- Send any errors to the LLM automatically? - auto_submit_success = true, -- Send any successful output to the LLM automatically? - system_prompt = { - enabled = true, - replace_main_system_prompt = false, - }, - default_tools = { - "file_search", - "read_file", - "cmd_runner", - -- "ddgr_search", - }, - }, - ["fetch_enhanced"] = { - callback = function(url, options) - options = options or {} - local max_length = options.max_length or 200000 -- 200KB default - local timeout = options.timeout or 60 - - -- Use curl for better control - local cmd = string.format( - 'curl -L -s --max-time %d --user-agent "CodeCompanion-Neovim" "%s"', - timeout, - url - ) - - local handle = io.popen(cmd) - if not handle then - return nil, "Failed to execute curl" - end - - local result = handle:read("*a") - local success = handle:close() - - if not success then - return nil, "Curl command failed" - end - - -- Truncate if too long - if #result > max_length then - result = result:sub(1, max_length) .. "\n[... truncated at " .. max_length .. " characters ...]" - end - - return result - end, - opts = { - requires_approval = false, - } - }, - ["fetch_unlimited"] = { - description = "Fetch a data from the web", - callback = function(url, options) - options = options or {} - - -- Use a local proxy service or direct system calls - local temp_file = vim.fn.tempname() - local cmd = string.format( - 'wget --timeout=60 --tries=3 --output-document="%s" "%s" 2>/dev/null && cat "%s" && rm "%s"', - temp_file, url, temp_file, temp_file - ) - - local handle = io.popen(cmd) - if not handle then - return nil, "Failed to fetch URL" - end - - local result = handle:read("*a") - handle:close() - - -- Optional: Process and clean the content - -- Remove excessive whitespace, clean HTML if needed - -- result = result:gsub("%s+", " "):gsub("^\s+", ""):gsub("%s+$", "") - - return result - end, - opts = { - requires_approval = false, - description = "Fetch web content with unlimited size" - } - }, - ["fetch"] = { - description = "Fetch a webpage in a markdown format", - callback = function(url, options) - local cmd = string.format( - 'reader -o -i none %s 2>/dev/null', - url - ) - local handle = io.popen(cmd) - if not handle then - return nil, "Failed to fetch URL" - end - - local result = handle:read("*a") - handle:close() - - return result + project = { + callback = function() + -- Get project files structure + local files = vim.fn.systemlist("fd . -type f") + return table.concat(files, "\n") end, - }, - -- ["mcp"] = { -- Name this tool whatever you like - -- -- Callback provides the necessary functions to CodeCompanion - -- callback = function() - -- return require("mcphub.extensions.codecompanion") - -- end, - -- opts = { - -- -- If true, CodeCompanion will ask for approval before executing the MCP tool call - -- requires_approval = true, - -- -- Optional: Pass parameters like temperature to the underlying LLM if the chat strategy supports it - -- temperature = 0.7 - -- } - -- }, - groups = { - ['plan'] = { - description = "Planning my project and codes with enhanced web access", - prompt = "Using all the ${tools} at your disposal including enhanced web fetching. Analyze the codes and use it to help me with my query. You have access to unlimited web content fetching.", - tools = { - "fetch", -- Backup unlimited fetch - "file_search", - "grep_search", - "list_code_usages", - "next_edit_suggestion", - "read_file", - "cmd_runner", - }, - opts = { - collapse_tools = true, - -- Override default fetch behavior for this group - tool_config = { - fetch_enhanced = { - max_length = 500000, -- 500KB for planning tasks - chunk_processing = true, - }, - }, - }, - }, - ['research'] = { - description = "Deep research with unlimited web access", - prompt = "You are a research assistant with unlimited web access. Using the ${tools} fetch and analyze large documents, research papers, and comprehensive web content.", - tools = { - "fetch", - "fetch_enhanced", - "file_search", - "read_file", - }, - opts = { - collapse_tools = false, - }, - }, - -- NEW: Add development group for coding tasks - ['dev'] = { - description = "Full-stack development with all necessary tools", - prompt = "You are an expert full-stack developer. Use ${tools} to understand, modify, and test code. Always gather context before making changes.", - tools = { - "file_search", - "grep_search", - "fetch", - "list_code_usages", - "read_file", - "insert_edit_into_file", - "cmd_runner", - "next_edit_suggestion", - }, - opts = { - collapse_tools = true, - }, - }, - }, - }, - slash_commands = { - ["buffer"] = { opts = { provider = "snacks" } }, -- snacks - ["file"] = { opts = { provider = "snacks" } }, -- snackes - ['git_files'] = { - description = 'List git files', - ---@param chat CodeCompanion.Chat - callback = function(chat) - local handle = io.popen 'git ls-files' - if handle ~= nil then - local result = handle:read '*a' - handle:close() - chat:add_reference({ content = result }, 'git', '') - return vim.notify('Git files added to the chat.') - else - return vim.notify('No git files available', vim.log.levels.INFO, { title = 'CodeCompanion' }) - end - end, - opts = { - contains_code = false, - }, - }, - -- NEW: Add helpful workspace command - ["workspace"] = { - description = "Add workspace context", - callback = function(chat) - local cwd = vim.fn.getcwd() - local workspace_info = string.format("Working directory: %s", cwd) + description = "Share project structure" + } + }, + tools = { + opts = { + auto_submit_errors = true, -- Send any errors to the LLM automatically? + auto_submit_success = true, -- Send any successful output to the LLM automatically? + system_prompt = { + enabled = true, + replace_main_system_prompt = false, + }, + default_tools = { + "file_search", + "read_file", + "cmd_runner", + -- "ddgr_search", + }, + }, + ["fetch_enhanced"] = { + callback = function(url, options) + options = options or {} + local max_length = options.max_length or 200000 -- 200KB default + local timeout = options.timeout or 60 - -- Get project type - local files = vim.fn.glob(cwd .. "/*", false, true) - for _, file in ipairs(files) do - local basename = vim.fn.fnamemodify(file, ":t") - if basename == "package.json" then - workspace_info = workspace_info .. "\nProject type: Node.js/JavaScript" - break - elseif basename == "Cargo.toml" then - workspace_info = workspace_info .. "\nProject type: Rust" - break - elseif basename == "go.mod" then - workspace_info = workspace_info .. "\nProject type: Go" - break - end - end + -- Use curl for better control + local cmd = string.format( + 'curl -L -s --max-time %d --user-agent "CodeCompanion-Neovim" "%s"', + timeout, + url + ) - chat:add_reference({ content = workspace_info }, 'workspace', '') - return vim.notify('Workspace context added.') - end, - opts = { - contains_code = false, - }, - }, - }, - -- adapter = { name = "abacus", model = "route-llm" }, - -- adapter = { name = "opencode", model = "github-copilot/gpt-5.2-codex" }, - adapter = { name = "copilot", model = "gpt-5-mini" }, - }, - inline = { - -- adapter = { name = "abacus", model = "route-llm" }, - adapter = { name = "copilot", model = "gpt-5.1-codex-mini" }, - }, - cmd = { - adapter = { name = "copilot", model = "gpt-5-mini" }, - }, - background = { - adapter = { name = "copilot", model = "gpt-5-mini" }, - }, - }, - prompt_library = { - markdown = { - dirs = { - vim.fn.getcwd() .. "/.prompts", - "~/.agents/prompts", - }, - }, - ["Code Review"] = { - interaction = "chat", - description = "Review the selected code for improvements", - opts = { - mapping = "rpc", - modes = { "v" }, - adapter = { + local handle = io.popen(cmd) + if not handle then + return nil, "Failed to execute curl" + end + + local result = handle:read("*a") + local success = handle:close() + + if not success then + return nil, "Curl command failed" + end + + -- Truncate if too long + if #result > max_length then + result = result:sub(1, max_length) .. "\n[... truncated at " .. max_length .. " characters ...]" + end + + return result + end, + opts = { + requires_approval = false, + } + }, + ["fetch_unlimited"] = { + description = "Fetch a data from the web", + callback = function(url, options) + options = options or {} + + -- Use a local proxy service or direct system calls + local temp_file = vim.fn.tempname() + local cmd = string.format( + 'wget --timeout=60 --tries=3 --output-document="%s" "%s" 2>/dev/null && cat "%s" && rm "%s"', + temp_file, url, temp_file, temp_file + ) + + local handle = io.popen(cmd) + if not handle then + return nil, "Failed to fetch URL" + end + + local result = handle:read("*a") + handle:close() + + -- Optional: Process and clean the content + -- Remove excessive whitespace, clean HTML if needed + -- result = result:gsub("%s+", " "):gsub("^\s+", ""):gsub("%s+$", "") + + return result + end, + opts = { + requires_approval = false, + description = "Fetch web content with unlimited size" + } + }, + ["fetch"] = { + description = "Fetch a webpage in a markdown format", + callback = function(url, options) + local cmd = string.format( + 'reader -o -i none %s 2>/dev/null', + url + ) + local handle = io.popen(cmd) + if not handle then + return nil, "Failed to fetch URL" + end + + local result = handle:read("*a") + handle:close() + + return result + end, + }, + -- ["mcp"] = { -- Name this tool whatever you like + -- -- Callback provides the necessary functions to CodeCompanion + -- callback = function() + -- return require("mcphub.extensions.codecompanion") + -- end, + -- opts = { + -- -- If true, CodeCompanion will ask for approval before executing the MCP tool call + -- requires_approval = true, + -- -- Optional: Pass parameters like temperature to the underlying LLM if the chat strategy supports it + -- temperature = 0.7 + -- } + -- }, + groups = { + ['plan'] = { + description = "Planning my project and codes with enhanced web access", + prompt = "Using all the ${tools} at your disposal including enhanced web fetching. Analyze the codes and use it to help me with my query. You have access to unlimited web content fetching.", + tools = { + "fetch", -- Backup unlimited fetch + "file_search", + "grep_search", + "list_code_usages", + "next_edit_suggestion", + "read_file", + "cmd_runner", + }, + opts = { + collapse_tools = true, + -- Override default fetch behavior for this group + tool_config = { + fetch_enhanced = { + max_length = 500000, -- 500KB for planning tasks + chunk_processing = true, + }, + }, + }, + }, + ['research'] = { + description = "Deep research with unlimited web access", + prompt = "You are a research assistant with unlimited web access. Using the ${tools} fetch and analyze large documents, research papers, and comprehensive web content.", + tools = { + "fetch", + "fetch_enhanced", + "file_search", + "read_file", + }, + opts = { + collapse_tools = false, + }, + }, + -- NEW: Add development group for coding tasks + ['dev'] = { + description = "Full-stack development with all necessary tools", + prompt = "You are an expert full-stack developer. Use ${tools} to understand, modify, and test code. Always gather context before making changes.", + tools = { + "file_search", + "grep_search", + "fetch", + "list_code_usages", + "read_file", + "insert_edit_into_file", + "cmd_runner", + "next_edit_suggestion", + }, + opts = { + collapse_tools = true, + }, + }, + }, + }, + slash_commands = { + ["buffer"] = { opts = { provider = "snacks" } }, -- snacks + ["file"] = { opts = { provider = "snacks" } }, -- snackes + ['git_files'] = { + description = 'List git files', + ---@param chat CodeCompanion.Chat + callback = function(chat) + local handle = io.popen 'git ls-files' + if handle ~= nil then + local result = handle:read '*a' + handle:close() + chat:add_reference({ content = result }, 'git', '') + return vim.notify('Git files added to the chat.') + else + return vim.notify('No git files available', vim.log.levels.INFO, { title = 'CodeCompanion' }) + end + end, + opts = { + contains_code = false, + }, + }, + -- NEW: Add helpful workspace command + ["workspace"] = { + description = "Add workspace context", + callback = function(chat) + local cwd = vim.fn.getcwd() + local workspace_info = string.format("Working directory: %s", cwd) + + -- Get project type + local files = vim.fn.glob(cwd .. "/*", false, true) + for _, file in ipairs(files) do + local basename = vim.fn.fnamemodify(file, ":t") + if basename == "package.json" then + workspace_info = workspace_info .. "\nProject type: Node.js/JavaScript" + break + elseif basename == "Cargo.toml" then + workspace_info = workspace_info .. "\nProject type: Rust" + break + elseif basename == "go.mod" then + workspace_info = workspace_info .. "\nProject type: Go" + break + end + end + + chat:add_reference({ content = workspace_info }, 'workspace', '') + return vim.notify('Workspace context added.') + end, + opts = { + contains_code = false, + }, + }, + }, + -- adapter = { name = "abacus", model = "route-llm" }, + -- adapter = { name = "opencode", model = "github-copilot/gpt-5.2-codex" }, + adapter = { name = "copilot", model = "gpt-5-mini" }, + }, + inline = { + -- adapter = { name = "abacus", model = "route-llm" }, + adapter = { name = "copilot", model = "gpt-5.1-codex-mini" }, + }, + cmd = { + adapter = { name = "copilot", model = "gpt-5-mini" }, + }, + background = { + adapter = { name = "copilot", model = "gpt-5-mini" }, + }, + }, + prompt_library = { + markdown = { + dirs = { + vim.fn.getcwd() .. "/.prompts", + "~/.agents/prompts", + }, + }, + ["Code Review"] = { + interaction = "chat", + description = "Review the selected code for improvements", + opts = { + mapping = "rpc", + modes = { "v" }, + adapter = { name = "copilot", model = "chatgpt-5.1-codex", }, - }, - prompts = { - { - role = "system", - content = "You are an expert code reviewer. Analyze the code for: 1) Logic errors 2) Performance issues 3) Security vulnerabilities 4) Best practices 5) Code clarity and maintainability. Provide specific, actionable feedback.", - }, - { - role = "user", - content = function(context) - local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) - return "Please review this code:\n\n```" .. context.filetype .. "\n" .. code .. "\n```" - end, - }, - }, - cc_keywords = { "review", "critique", "smell", "security", "vulnerability", "best practice", "maintainab" }, - cc_threshold = 2, - }, - ["Optimize Performance"] = { - interaction = "chat", - description = "Get performance optimization suggestions", - opts = { - mapping = "rpo", - modes = { "v" }, - adapter = { + }, + prompts = { + { + role = "system", + content = "You are an expert code reviewer. Analyze the code for: 1) Logic errors 2) Performance issues 3) Security vulnerabilities 4) Best practices 5) Code clarity and maintainability. Provide specific, actionable feedback.", + }, + { + role = "user", + content = function(context) + local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + return "Please review this code:\n\n```" .. context.filetype .. "\n" .. code .. "\n```" + end, + }, + }, + cc_keywords = { "review", "critique", "smell", "security", "vulnerability", "best practice", "maintainab" }, + cc_threshold = 2, + }, + ["Optimize Performance"] = { + interaction = "chat", + description = "Get performance optimization suggestions", + opts = { + mapping = "rpo", + modes = { "v" }, + adapter = { name = "copilot", model = "chatgpt-5.2-codex", }, - }, - prompts = { - { - role = "system", - content = "You are a performance optimization expert. Focus on: 1) Time complexity improvements 2) Space efficiency 3) Algorithm optimization 4) Framework-specific optimizations 5) Caching strategies.", - }, - { - role = "user", - content = function(context) - local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) - return "How can I optimize the performance of this code?\n\n```" .. context.filetype .. "\n" .. code .. "\n```" - end, - }, - }, - cc_keywords = { "optimize", "performance", "slow", "latency", "throughput", "memory", "alloc" }, - }, - ["Debug Analysis"] = { - interaction = "chat", - description = "Analyze and debug problematic code", - opts = { - mapping = "rpd", - modes = { "v" }, + }, + prompts = { + { + role = "system", + content = "You are a performance optimization expert. Focus on: 1) Time complexity improvements 2) Space efficiency 3) Algorithm optimization 4) Framework-specific optimizations 5) Caching strategies.", + }, + { + role = "user", + content = function(context) + local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + return "How can I optimize the performance of this code?\n\n```" .. context.filetype .. "\n" .. code .. "\n```" + end, + }, + }, + cc_keywords = { "optimize", "performance", "slow", "latency", "throughput", "memory", "alloc" }, + }, + ["Debug Analysis"] = { + interaction = "chat", + description = "Analyze and debug problematic code", + opts = { + mapping = "rpd", + modes = { "v" }, - adapter = { + adapter = { name = "copilot", model = "chatgpt-5.2-codex", }, - }, - prompts = { - { - role = "system", - content = [[You are a debugging expert. Analyze code for: + }, + prompts = { + { + role = "system", + content = [[You are a debugging expert. Analyze code for: 1. Potential bugs and issues 2. Logic errors 3. Runtime errors 4. Common pitfalls 5. Debugging strategies. 6. Provide specific solutions.]], - }, - { - role = "user", - content = function(context) - local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) - return fmt( - [[Help me debug this code from buffer %d and identify potential issues: + }, + { + role = "user", + content = function(context) + local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + return fmt( + [[Help me debug this code from buffer %d and identify potential issues: ```%s %s ```]], - context.bufnr, - context.filetype, - code - ) - end, - opts = { - contains_code = true, - } - }, - }, - cc_keyword = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" }, - }, - ["Architecture Review"] = { - interaction = "chat", - description = "Review architectural patterns and design", - opts = { - mapping = "rpa", - modes = { "v" }, + context.bufnr, + context.filetype, + code + ) + end, + opts = { + contains_code = true, + } + }, + }, + cc_keyword = { "bug", "debug", "error", "exception", "crash", "stacktrace", "broken", "issue" }, + }, + ["Architecture Review"] = { + interaction = "chat", + description = "Review architectural patterns and design", + opts = { + mapping = "rpa", + modes = { "v" }, - adapter = { + adapter = { name = "copilot", model = "chatgpt-5.2-codex", }, - }, - prompts = { - { - role = "system", - content = "You are a software architect. Review code for: 1) Design patterns usage 2) SOLID principles 3) Separation of concerns 4) Scalability considerations 5) Maintainability. Suggest architectural improvements.", - }, - { - role = "user", - content = function(context) - local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) - return fmt( - [[Please review the architecture and design of this code from buffer %d: + }, + prompts = { + { + role = "system", + content = "You are a software architect. Review code for: 1) Design patterns usage 2) SOLID principles 3) Separation of concerns 4) Scalability considerations 5) Maintainability. Suggest architectural improvements.", + }, + { + role = "user", + content = function(context) + local code = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + return fmt( + [[Please review the architecture and design of this code from buffer %d: ```%s %s ```]], - context.bufnr, - context.filetype, - code - ) - end, - opts = { - contains_code = true, - } - }, - }, - cc_keywords = { "architecture", "design", "pattern", "solid", "scalab", "maintainab", "refactor" }, - }, - }, - display = { - action_palette = { - provider = "snacks", - opts = { - show_default_actions = true, - show_default_prompt_library = true, - } - }, - chat = { - show_settings = false, - render_headers = false, - icons = { - chat_context = "📎️", - }, - fold_context = true, - -- NEW: Better chat window configuration - window = { - layout = "vertical", - width = 0.45, - height = 0.8, - border = "rounded", -- Better visual - }, - auto_scroll = false, - start_in_insert_mode = false, -- More convenient - } - } - }) - end + context.bufnr, + context.filetype, + code + ) + end, + opts = { + contains_code = true, + } + }, + }, + cc_keywords = { "architecture", "design", "pattern", "solid", "scalab", "maintainab", "refactor" }, + }, + }, + display = { + action_palette = { + provider = "snacks", + opts = { + show_default_actions = true, + show_default_prompt_library = true, + } + }, + chat = { + show_settings = false, + render_headers = false, + icons = { + chat_context = "📎️", + }, + fold_context = true, + -- NEW: Better chat window configuration + window = { + layout = "vertical", + width = 0.45, + height = 0.8, + border = "rounded", -- Better visual + }, + auto_scroll = false, + start_in_insert_mode = false, -- More convenient + } + } + }) + end }, { "carlos-algms/agentic.nvim", - - opts = { -- Available by default: "claude-agent-acp" | "gemini-acp" | "codex-acp" | "opencode-acp" | "cursor-acp" | "auggie-acp" | "mistral-vibe-acp" provider = "opencode-acp", -- setting the name here is all you need to get started @@ -843,278 +840,274 @@ return { enabled = false, }, }) - end, + end, + }, + { + "PhantomYdn/fabric-ai.nvim", + cmd = { "Fabric" }, + opts = { + -- Default configuration (all optional) + fabric_path = "fabric-ai", -- Path to Fabric CLI + patterns_path = nil, -- Custom patterns dir (auto-detect if nil) + timeout = 300000, -- Command timeout in ms (5 minutes) + window = { + width = 0.8, -- 80% of editor width + height = 0.8, -- 80% of editor height + border = "rounded", + }, }, - -{ - "PhantomYdn/fabric-ai.nvim", - cmd = { "Fabric" }, - opts = { - -- Default configuration (all optional) - fabric_path = "fabric-ai", -- Path to Fabric CLI - patterns_path = nil, -- Custom patterns dir (auto-detect if nil) - timeout = 300000, -- Command timeout in ms (5 minutes) - window = { - width = 0.8, -- 80% of editor width - height = 0.8, -- 80% of editor height - border = "rounded", - }, - }, - keys = { - -- fabric-ai.nvim doesn't have default keymappings - { "fa", ":'<,'>Fabric", mode = "v", desc = "Fabric AI" }, - { "fa", ":Fabric", mode = "n", desc = "Fabric AI" }, - { "fu", ":Fabric url", mode = "n", desc = "Fabric URL" }, - }, - }, - -{ - 'L3MON4D3/LuaSnip', - dependencies = { - 'rafamadriz/friendly-snippets', - }, - version = "v2.*", - build = "make install_jsregexp", - config = function() + keys = { + -- fabric-ai.nvim doesn't have default keymappings + { "fa", ":'<,'>Fabric", mode = "v", desc = "Fabric AI" }, + { "fa", ":Fabric", mode = "n", desc = "Fabric AI" }, + { "fu", ":Fabric url", mode = "n", desc = "Fabric URL" }, + }, + }, + { + 'L3MON4D3/LuaSnip', + dependencies = { + 'rafamadriz/friendly-snippets', + }, + version = "v2.*", + build = "make install_jsregexp", + config = function() require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load({ paths = "./json_snippets" }) local luasnip = require("luasnip") luasnip.add_snippets("zig", require("snippets.zig")) - end, + end, }, + { + 'saghen/blink.cmp', + lazy = false, -- lazy loading handled internally + -- optional: provides snippets for the snippet source + dependencies = { + 'L3MON4D3/LuaSnip', + 'moyiz/blink-emoji.nvim', + 'MeanderingProgrammer/render-markdown.nvim', + 'fang2hou/blink-copilot', + --'giuxtaposition/blink-cmp-copilot', + }, + version = '1.*', + config = function() + -- NOTE: Specify the trigger character(s) used for luasnip + -- local trigger_text = ";" + require('blink.cmp').setup({ + enabled = function() + local filetype = vim.bo[0].filetype + if filetype == "TelescopePrompt" or filetype == "minifiles" or filetype == "snacks_picker_input" then + return false + end + return true + end, + snippets = { preset = 'luasnip' }, + completion = { + -- keyword = { + -- -- 'prefix' will fuzzy match on the text before the cursor + -- -- 'full' will fuzzy match on the text before *and* after the cursor + -- -- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full' + -- range = "full", + -- }, + menu = { + draw = { + treesitter = { 'lsp' } + } + -- border = "single", + }, + list = { + selection = { + preselect = false, + auto_insert = false, + } + }, + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + -- window = { + -- border = "single", + -- }, + }, + ghost_text = { enabled = false }, + }, + cmdline = { + enabled = true, + }, + signature = { enabled = true }, + sources = { + per_filetype = { + org = {'orgmode'} + }, + default = { 'orgmode', 'lsp', 'copilot', 'snippets', 'path', 'omni', 'buffer', 'codecompanion', 'markdown' }, + providers = { + codecompanion = { + name = "CodeCompanion" , + module = "codecompanion.providers.completion.blink", + enabled = true, + }, + orgmode = { + name = 'Orgmode', + module = 'orgmode.org.autocompletion.blink', + fallbacks = { 'buffer' }, + }, + copilot = { + name = 'copilot', + module = 'blink-copilot', + score_offset = 100, + async = true, + }, + markdown = { + name = 'RenderMarkdown', + module = 'render-markdown.integ.blink', + score_offset = 80, + }, + lsp = { + name = 'lsp', -- IMPORTANT: use the same name as you would for nvim-cmp + enabled = true, + module = 'blink.cmp.sources.lsp', + -- fallbacks = { 'snippets', 'buffer', 'path' }, + score_offset = 100, + }, + path = { + name = 'path', -- IMPORTANT: use the same name as you would for nvim-cmp + module = 'blink.cmp.sources.path', + score_offset = 50, + fallbacks = { 'snippets', 'buffer' }, + opts = { + trailing_slash = false, + label_trailing_slash = true, + get_cwd = function(context) + return vim.fn.expand(("#%d:p:h"):format(context.bufnr)) + end, + show_hidden_files_by_default = true, + }, + }, + buffer = { + name = "Buffer", + enabled = true, + max_items = 3, + module = "blink.cmp.sources.buffer", + min_keyword_length = 4, + score_offset = 15, -- the higher the number, the higher the priority + }, + snippets = { + name = "snippets", + enabled = true, + max_items = 15, + min_keyword_length = 2, + module = "blink.cmp.sources.snippets", + score_offset = 90, -- the higher the number, the higher the priority + }, + emoji = { + module = "blink-emoji", + name = "Emoji", + score_offset = 0, -- the higher the number, the higher the priority + opts = { insert = true }, -- Insert emoji (default) or complete its name + }, + }, + }, + appearance = { + -- Blink does not expose its default kind icons so you must copy them all (or set your custom ones) and add Copilot + kind_icons = { + Copilot = "", + Text = '󰉿', + Method = '󰊕', + Function = '󰊕', + Constructor = '󰒓', -{ - 'saghen/blink.cmp', - lazy = false, -- lazy loading handled internally - -- optional: provides snippets for the snippet source - dependencies = { - 'L3MON4D3/LuaSnip', - 'moyiz/blink-emoji.nvim', - 'MeanderingProgrammer/render-markdown.nvim', - 'fang2hou/blink-copilot', - --'giuxtaposition/blink-cmp-copilot', - }, - version = '1.*', - config = function() - -- NOTE: Specify the trigger character(s) used for luasnip - -- local trigger_text = ";" - require('blink.cmp').setup({ - enabled = function() - local filetype = vim.bo[0].filetype - if filetype == "TelescopePrompt" or filetype == "minifiles" or filetype == "snacks_picker_input" then - return false - end - return true - end, - snippets = { preset = 'luasnip' }, - completion = { - -- keyword = { - -- -- 'prefix' will fuzzy match on the text before the cursor - -- -- 'full' will fuzzy match on the text before *and* after the cursor - -- -- example: 'foo_|_bar' will match 'foo_' for 'prefix' and 'foo__bar' for 'full' - -- range = "full", - -- }, - menu = { - draw = { - treesitter = { 'lsp' } - } - -- border = "single", - }, - list = { - selection = { - preselect = false, - auto_insert = false, - } - }, - documentation = { - auto_show = true, - auto_show_delay_ms = 500, - -- window = { - -- border = "single", - -- }, - }, - ghost_text = { enabled = false }, - }, - cmdline = { - enabled = true, - }, - signature = { enabled = true }, - sources = { - per_filetype = { - org = {'orgmode'} - }, - default = { 'orgmode', 'lsp', 'copilot', 'snippets', 'path', 'omni', 'buffer', 'codecompanion', 'markdown' }, - providers = { - codecompanion = { - name = "CodeCompanion" , - module = "codecompanion.providers.completion.blink", - enabled = true, - }, - orgmode = { - name = 'Orgmode', - module = 'orgmode.org.autocompletion.blink', - fallbacks = { 'buffer' }, - }, - copilot = { - name = 'copilot', - module = 'blink-copilot', - score_offset = 100, - async = true, - }, - markdown = { - name = 'RenderMarkdown', - module = 'render-markdown.integ.blink', - score_offset = 80, - }, - lsp = { - name = 'lsp', -- IMPORTANT: use the same name as you would for nvim-cmp - enabled = true, - module = 'blink.cmp.sources.lsp', - -- fallbacks = { 'snippets', 'buffer', 'path' }, - score_offset = 100, - }, - path = { - name = 'path', -- IMPORTANT: use the same name as you would for nvim-cmp - module = 'blink.cmp.sources.path', - score_offset = 50, - fallbacks = { 'snippets', 'buffer' }, - opts = { - trailing_slash = false, - label_trailing_slash = true, - get_cwd = function(context) - return vim.fn.expand(("#%d:p:h"):format(context.bufnr)) - end, - show_hidden_files_by_default = true, - }, - }, - buffer = { - name = "Buffer", - enabled = true, - max_items = 3, - module = "blink.cmp.sources.buffer", - min_keyword_length = 4, - score_offset = 15, -- the higher the number, the higher the priority - }, - snippets = { - name = "snippets", - enabled = true, - max_items = 15, - min_keyword_length = 2, - module = "blink.cmp.sources.snippets", - score_offset = 90, -- the higher the number, the higher the priority - }, - emoji = { - module = "blink-emoji", - name = "Emoji", - score_offset = 0, -- the higher the number, the higher the priority - opts = { insert = true }, -- Insert emoji (default) or complete its name - }, - }, - }, - appearance = { - -- Blink does not expose its default kind icons so you must copy them all (or set your custom ones) and add Copilot - kind_icons = { - Copilot = "", - Text = '󰉿', - Method = '󰊕', - Function = '󰊕', - Constructor = '󰒓', + Field = '󰜢', + Variable = '󰆦', + Property = '󰖷', - Field = '󰜢', - Variable = '󰆦', - Property = '󰖷', + Class = '󱡠', + Interface = '󱡠', + Struct = '󱡠', + Module = '󰅩', - Class = '󱡠', - Interface = '󱡠', - Struct = '󱡠', - Module = '󰅩', + Unit = '󰪚', + Value = '󰦨', + Enum = '󰦨', + EnumMember = '󰦨', - Unit = '󰪚', - Value = '󰦨', - Enum = '󰦨', - EnumMember = '󰦨', + Keyword = '󰻾', + Constant = '󰏿', - Keyword = '󰻾', - Constant = '󰏿', - - Snippet = '󱄽', - Color = '󰏘', - File = '󰈔', - Reference = '󰬲', - Folder = '󰉋', - Event = '󱐋', - Operator = '󰪚', - TypeParameter = '󰬛', - }, - }, - }) - end - }, - -{ + Snippet = '󱄽', + Color = '󰏘', + File = '󰈔', + Reference = '󰬲', + Folder = '󰉋', + Event = '󱐋', + Operator = '󰪚', + TypeParameter = '󰬛', + }, + }, + }) + end + }, + { 'stevearc/conform.nvim', event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, keys = { - { - 'bf', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, - mode = { 'n', 'v' }, - desc = 'Format buffer', - }, + { + 'bf', + function() + require('conform').format { async = true, lsp_format = 'fallback' } + end, + mode = { 'n', 'v' }, + desc = 'Format buffer', + }, }, opts = { - notify_on_error = false, - -- format_on_save = function(bufnr) - -- -- Disable "format_on_save lsp_fallback" for languages that don't - -- -- have a well standardized coding style. You can add additional - -- -- languages here or re-enable it for the disabled ones. - -- local disable_filetypes = { c = true, cpp = true } - -- local lsp_format_opt - -- if disable_filetypes[vim.bo[bufnr].filetype] then - -- lsp_format_opt = 'never' - -- else - -- lsp_format_opt = 'fallback' - -- end - -- return { - -- timeout_ms = 500, - -- lsp_format = lsp_format_opt, - -- } - -- end, - formatters = { - shfmt = { - prepend_args = { "-i", "2", "-ci" }, - }, - dprint = { - condition = function(ctx) - return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1] - end, - }, - }, - formatters_by_ft = { - c = { "clang_format" }, - cpp = { "clang_format" }, - lua = { 'stylua' }, - go = { "goimports", "gofmt" }, - rust = { "dprint", "rustfmt", lsp_format = "fallback" }, - python = { "isort", "black", stop_after_first = true }, - javascript = { "dprint", "prettier", stop_after_first = true }, - markdown = { "dprint", "prettier", stop_after_first = true }, - javascriptreact = { "dprint", "prettier", stop_after_first = true }, - typescript = { "dprint", "prettier", stop_after_first = true }, - typescriptreact = { "dprint", "prettier", stop_after_first = true }, - svelte = { "dprint", "prettier", stop_after_first = true }, - html = { "dprint", "prettier", stop_after_first = true }, - }, + notify_on_error = false, + -- format_on_save = function(bufnr) + -- -- Disable "format_on_save lsp_fallback" for languages that don't + -- -- have a well standardized coding style. You can add additional + -- -- languages here or re-enable it for the disabled ones. + -- local disable_filetypes = { c = true, cpp = true } + -- local lsp_format_opt + -- if disable_filetypes[vim.bo[bufnr].filetype] then + -- lsp_format_opt = 'never' + -- else + -- lsp_format_opt = 'fallback' + -- end + -- return { + -- timeout_ms = 500, + -- lsp_format = lsp_format_opt, + -- } + -- end, + formatters = { + shfmt = { + prepend_args = { "-i", "2", "-ci" }, + }, + dprint = { + condition = function(ctx) + return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1] + end, + }, + }, + formatters_by_ft = { + c = { "clang_format" }, + cpp = { "clang_format" }, + lua = { 'stylua' }, + go = { "goimports", "gofmt" }, + rust = { "dprint", "rustfmt", lsp_format = "fallback" }, + python = { "isort", "black", stop_after_first = true }, + javascript = { "dprint", "prettier", stop_after_first = true }, + markdown = { "dprint", "prettier", stop_after_first = true }, + javascriptreact = { "dprint", "prettier", stop_after_first = true }, + typescript = { "dprint", "prettier", stop_after_first = true }, + typescriptreact = { "dprint", "prettier", stop_after_first = true }, + svelte = { "dprint", "prettier", stop_after_first = true }, + html = { "dprint", "prettier", stop_after_first = true }, + }, }, - }, + }, { 'lewis6991/gitsigns.nvim', event = "VimEnter", keys = { - { 'uG', "Gitsigns toggle_signs", mode = { 'n' }, desc = 'Gitsigns toggle', }, + { 'uG', "Gitsigns toggle_signs", mode = { 'n' }, desc = 'Gitsigns toggle', }, }, opts = { auto_attach = true, @@ -1163,116 +1156,110 @@ return { end, } }, + { + "sindrets/diffview.nvim", + }, + { + "NicolasGB/jj.nvim", + version = "*", -- Use latest stable release + -- Or from the main branch (uncomment the branch line and comment the version line) + -- branch = "main", + keys = function() + local cmd = require("jj.cmd") + local annotate = require("jj.annotate") -{ - "sindrets/diffview.nvim", - }, - -{ - "NicolasGB/jj.nvim", - version = "*", -- Use latest stable release - -- Or from the main branch (uncomment the branch line and comment the version line) - -- branch = "main", - keys = function() - local cmd = require("jj.cmd") - local annotate = require("jj.annotate") - - vim.keymap.set("n", "va", annotate.file, { desc = "JJ annotate file" }) - vim.keymap.set("n", "vA", annotate.line, { desc = "JJ annotate line" }) - vim.keymap.set("n", "vbc", cmd.bookmark_create, { desc = "JJ bookmark create" }) - vim.keymap.set("n", "vbd", cmd.bookmark_delete, { desc = "JJ bookmark delete" }) - vim.keymap.set("n", "vbm", cmd.bookmark_move, { desc = "JJ bookmark move" }) - vim.keymap.set("n", "vd", cmd.describe, { desc = "JJ describe" }) - vim.keymap.set("n", "vl", cmd.log, { desc = "JJ log" }) - vim.keymap.set("n", "ve", cmd.edit, { desc = "JJ edit" }) - vim.keymap.set("n", "vn", cmd.new, { desc = "JJ new" }) - vim.keymap.set("n", "vs", cmd.status, { desc = "JJ status" }) - vim.keymap.set("n", "vS", cmd.squash, { desc = "JJ squash" }) - vim.keymap.set("n", "vju", cmd.undo, { desc = "JJ undo" }) - vim.keymap.set("n", "vjr", cmd.redo, { desc = "JJ redo" }) - vim.keymap.set("n", "vr", cmd.rebase, { desc = "JJ rebase" }) - vim.keymap.set("n", "vf", cmd.fetch, { desc = "JJ fetch" }) - vim.keymap.set("n", "vx", cmd.abandon, { desc = "JJ abandon" }) - vim.keymap.set("n", "vp", cmd.push, { desc = "JJ push" }) - vim.keymap.set("n", "vpr", cmd.open_pr, { desc = "JJ open PR from bookmark in current revision or parent" }) - vim.keymap.set("n", "vpl", function() - cmd.open_pr { list_bookmarks = true } - end, { desc = "JJ open PR listing available bookmarks" }) + vim.keymap.set("n", "va", annotate.file, { desc = "JJ annotate file" }) + vim.keymap.set("n", "vA", annotate.line, { desc = "JJ annotate line" }) + vim.keymap.set("n", "vbc", cmd.bookmark_create, { desc = "JJ bookmark create" }) + vim.keymap.set("n", "vbd", cmd.bookmark_delete, { desc = "JJ bookmark delete" }) + vim.keymap.set("n", "vbm", cmd.bookmark_move, { desc = "JJ bookmark move" }) + vim.keymap.set("n", "vd", cmd.describe, { desc = "JJ describe" }) + vim.keymap.set("n", "vl", cmd.log, { desc = "JJ log" }) + vim.keymap.set("n", "ve", cmd.edit, { desc = "JJ edit" }) + vim.keymap.set("n", "vn", cmd.new, { desc = "JJ new" }) + vim.keymap.set("n", "vs", cmd.status, { desc = "JJ status" }) + vim.keymap.set("n", "vS", cmd.squash, { desc = "JJ squash" }) + vim.keymap.set("n", "vju", cmd.undo, { desc = "JJ undo" }) + vim.keymap.set("n", "vjr", cmd.redo, { desc = "JJ redo" }) + vim.keymap.set("n", "vr", cmd.rebase, { desc = "JJ rebase" }) + vim.keymap.set("n", "vf", cmd.fetch, { desc = "JJ fetch" }) + vim.keymap.set("n", "vx", cmd.abandon, { desc = "JJ abandon" }) + vim.keymap.set("n", "vp", cmd.push, { desc = "JJ push" }) + vim.keymap.set("n", "vpr", cmd.open_pr, { desc = "JJ open PR from bookmark in current revision or parent" }) + vim.keymap.set("n", "vpl", function() + cmd.open_pr { list_bookmarks = true } + end, { desc = "JJ open PR listing available bookmarks" }) - -- Diff commands - local diff = require("jj.diff") - vim.keymap.set("n", "vjd", function() diff.open_vdiff() end, { desc = "JJ diff current buffer" }) - vim.keymap.set("n", "vjD", function() diff.open_hsplit() end, { desc = "JJ hdiff current buffer" }) + -- Diff commands + local diff = require("jj.diff") + vim.keymap.set("n", "vjd", function() diff.open_vdiff() end, { desc = "JJ diff current buffer" }) + vim.keymap.set("n", "vjD", function() diff.open_hsplit() end, { desc = "JJ hdiff current buffer" }) - -- Pickers - local picker = require("jj.picker") - vim.keymap.set("n", "vjs", function() picker.status() end, { desc = "JJ Picker status" }) - vim.keymap.set("n", "vjh", function() picker.file_history() end, { desc = "JJ Picker history" }) + -- Pickers + local picker = require("jj.picker") + vim.keymap.set("n", "vjs", function() picker.status() end, { desc = "JJ Picker status" }) + vim.keymap.set("n", "vjh", function() picker.file_history() end, { desc = "JJ Picker history" }) - -- Some functions like `log` can take parameters - vim.keymap.set("n", "vL", function() - cmd.log { - revisions = "all()", -- equivalent to jj log -r :: - } - end, { desc = "JJ log all" }) + -- Some functions like `log` can take parameters + vim.keymap.set("n", "vL", function() + cmd.log { + revisions = "all()", -- equivalent to jj log -r :: + } + end, { desc = "JJ log all" }) - -- This is an alias i use for moving bookmarks its so good - vim.keymap.set("n", "vt", function() - cmd.j "tug" - cmd.log {} - end, { desc = "JJ tug" }) + -- This is an alias i use for moving bookmarks its so good + vim.keymap.set("n", "vt", function() + cmd.j "tug" + cmd.log {} + end, { desc = "JJ tug" }) - end, - config = function() - require("jj").setup({ - diff = { - backend = "native", - }, - cmd = { + end, + config = function() + require("jj").setup({ + diff = { + backend = "native", + }, + cmd = { describe = { - editor = { + editor = { type = "buffer", - } - } - }, - describe = { - editor = { + } + } + }, + describe = { + editor = { type = "buffer", - } - } - }) - end, - }, - -{ - "julienvincent/hunk.nvim", - cmd = { "DiffEditor" }, - config = function() - require("hunk").setup() - end, - }, - -{ - -- "PrayagS/jj-diffconflicts", - -- branch = 'fix-for-jj-v0_37_0', - "rafikdraoui/jj-diffconflicts" - }, - -{ - 'Glhou/jjsigns.nvim', - branch = 'fix/skip-extra-lines', - config = function() - require('jjsigns').setup({ - enabled = true, - attach = { - auto = false, - } - }) - end, - }, - + } + } + }) + end, + }, + { + "julienvincent/hunk.nvim", + cmd = { "DiffEditor" }, + config = function() + require("hunk").setup() + end, + }, + { + -- "PrayagS/jj-diffconflicts", + -- branch = 'fix-for-jj-v0_37_0', + "rafikdraoui/jj-diffconflicts" + }, + { + 'Glhou/jjsigns.nvim', + branch = 'fix/skip-extra-lines', + config = function() + require('jjsigns').setup({ + enabled = true, + attach = { + auto = false, + } + }) + end, + }, { 'williamboman/mason.nvim', lazy = true, opts = {} }, { 'williamboman/mason-lspconfig.nvim', lazy = true }, { 'WhoIsSethDaniel/mason-tool-installer.nvim', lazy = true }, @@ -1490,50 +1477,47 @@ return { }) end, }, + { + "Saecki/crates.nvim", + lazy = true, + keys = function() + local crates = require("crates") + local opts = { silent = true } - -{ - "Saecki/crates.nvim", - lazy = true, - keys = function() - local crates = require("crates") - local opts = { silent = true } - - vim.keymap.set("n", "cct", crates.toggle, { desc = 'toggle' }) - vim.keymap.set("n", "ccr", crates.reload, { desc = 'reload' }) - vim.keymap.set("n", "ccv", crates.show_versions_popup, { desc = 'show versions' }) - vim.keymap.set("n", "ccf", crates.show_features_popup, { desc = 'show features' }) - vim.keymap.set("n", "ccd", crates.show_dependencies_popup, { desc = 'show dependencies' }) - vim.keymap.set("n", "ccu", crates.update_crate, { desc = 'update' }) - vim.keymap.set("v", "ccu", crates.update_crates, { desc = 'update' }) - vim.keymap.set("n", "cca", crates.update_all_crates, { desc = 'update all' }) - vim.keymap.set("n", "ccU", crates.upgrade_crate, { desc = 'upgrade' }) - vim.keymap.set("v", "ccU", crates.upgrade_crates, { desc = 'upgrade' }) - vim.keymap.set("n", "ccA", crates.upgrade_all_crates, { desc = 'upgrade all' }) - vim.keymap.set("n", "ccx", crates.expand_plain_crate_to_inline_table, { desc = 'expand' }) - vim.keymap.set("n", "ccX", crates.extract_crate_into_table, { desc = 'extract' }) - vim.keymap.set("n", "ccH", crates.open_homepage, { desc = 'open homepage' }) - vim.keymap.set("n", "ccR", crates.open_repository, { desc = 'open repository' }) - vim.keymap.set("n", "ccD", crates.open_documentation, { desc = 'open documents' }) - vim.keymap.set("n", "ccC", crates.open_crates_io, { desc = 'open crates.io' }) - vim.keymap.set("n", "ccL", crates.open_lib_rs, { desc = 'open lib.rs' }) - end, - opts = { - completion = { - crates = { - enabled = true, - }, - }, - lsp = { - enabled = true, - actions = true, - completion = true, - hover = true, - }, - }, - }, - -{ + vim.keymap.set("n", "cct", crates.toggle, { desc = 'toggle' }) + vim.keymap.set("n", "ccr", crates.reload, { desc = 'reload' }) + vim.keymap.set("n", "ccv", crates.show_versions_popup, { desc = 'show versions' }) + vim.keymap.set("n", "ccf", crates.show_features_popup, { desc = 'show features' }) + vim.keymap.set("n", "ccd", crates.show_dependencies_popup, { desc = 'show dependencies' }) + vim.keymap.set("n", "ccu", crates.update_crate, { desc = 'update' }) + vim.keymap.set("v", "ccu", crates.update_crates, { desc = 'update' }) + vim.keymap.set("n", "cca", crates.update_all_crates, { desc = 'update all' }) + vim.keymap.set("n", "ccU", crates.upgrade_crate, { desc = 'upgrade' }) + vim.keymap.set("v", "ccU", crates.upgrade_crates, { desc = 'upgrade' }) + vim.keymap.set("n", "ccA", crates.upgrade_all_crates, { desc = 'upgrade all' }) + vim.keymap.set("n", "ccx", crates.expand_plain_crate_to_inline_table, { desc = 'expand' }) + vim.keymap.set("n", "ccX", crates.extract_crate_into_table, { desc = 'extract' }) + vim.keymap.set("n", "ccH", crates.open_homepage, { desc = 'open homepage' }) + vim.keymap.set("n", "ccR", crates.open_repository, { desc = 'open repository' }) + vim.keymap.set("n", "ccD", crates.open_documentation, { desc = 'open documents' }) + vim.keymap.set("n", "ccC", crates.open_crates_io, { desc = 'open crates.io' }) + vim.keymap.set("n", "ccL", crates.open_lib_rs, { desc = 'open lib.rs' }) + end, + opts = { + completion = { + crates = { + enabled = true, + }, + }, + lsp = { + enabled = true, + actions = true, + completion = true, + hover = true, + }, + }, + }, + { 'mrcjkb/rustaceanvim', -- version = '^6', -- Recommended lazy = true, @@ -1541,11 +1525,11 @@ return { opts = { server = { default_settings = { - cargo = { - allFeatures = false, - loadOutDirsFromCheck = true, - buildScripts = { enable = true }, - }, + cargo = { + allFeatures = false, + loadOutDirsFromCheck = true, + buildScripts = { enable = true }, + }, }, on_attach = function(_, bufnr) vim.keymap.set("n", "lr", function() @@ -1567,83 +1551,77 @@ return { vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) end, }, - -{ - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - -- 'p00f/nvim-ts-rainbow', - }, - config = function() - require('nvim-treesitter.configs').setup({ - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { - 'c', - "lua", - "markdown", - "markdown_inline", - "vim", - "vimdoc", - "query", - "html", - "go", - "bash", - "zig", - "typescript", - "javascript", - "dockerfile", - "xml", - "regex", - "rust" - }, - ignore_install = { 'org' }, - auto_install = true, - -- disable = function(lang, buf) - -- local max_filesize = 100 * 1024 - -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buff_get_name(buf)) - -- if ok and stats and stats.size > max_filesize then - -- return true - -- end - -- end, - highlight = { enable = true, }, - indent = { enable = true }, - }) - end, - }, - - { - 'JoosepAlviste/nvim-ts-context-commentstring', - lazy = true, - opts = { - enable_autocmd = false, - } - }, - - { - 'nvim-treesitter/nvim-treesitter-context', - enabled = true, - opts = { mode = "cursor", max_lines = 3 }, - }, - -{ - "folke/todo-comments.nvim", - lazy = true, - keys = { - { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, - { "sT", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME", "NOTE" } }) end, desc = "Todo/Fix/Fixme/Note" }, - }, - opts = {}, + { + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + -- 'p00f/nvim-ts-rainbow', + }, + config = function() + require('nvim-treesitter.configs').setup({ + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { + 'c', + "lua", + "markdown", + "markdown_inline", + "vim", + "vimdoc", + "query", + "html", + "go", + "bash", + "zig", + "typescript", + "javascript", + "dockerfile", + "xml", + "regex", + "rust" + }, + ignore_install = { 'org' }, + auto_install = true, + -- disable = function(lang, buf) + -- local max_filesize = 100 * 1024 + -- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buff_get_name(buf)) + -- if ok and stats and stats.size > max_filesize then + -- return true + -- end + -- end, + highlight = { enable = true, }, + indent = { enable = true }, + }) + end, }, - -{ + { + 'JoosepAlviste/nvim-ts-context-commentstring', + lazy = true, + opts = { + enable_autocmd = false, + } + }, + { + 'nvim-treesitter/nvim-treesitter-context', + enabled = true, + opts = { mode = "cursor", max_lines = 3 }, + }, + { + "folke/todo-comments.nvim", + lazy = true, + keys = { + { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, + { "sT", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME", "NOTE" } }) end, desc = "Todo/Fix/Fixme/Note" }, + }, + opts = {}, + }, + { "mbbill/undotree", lazy = true, keys = { - { 'uu', vim.cmd.UndotreeToggle, desc = 'Format buffer' } + { 'uu', vim.cmd.UndotreeToggle, desc = 'Format buffer' } }, }, - } diff --git a/config/nvim/lua/plugins/init.lua b/config/nvim/lua/plugins/init.lua index e35a17d..91e9d7f 100644 --- a/config/nvim/lua/plugins/init.lua +++ b/config/nvim/lua/plugins/init.lua @@ -1,15 +1,11 @@ return { - -{ "nvim-lua/plenary.nvim", lazy = true }, - -{ "nvim-tree/nvim-web-devicons", lazy = true, opts = {} }, - -{ + { "nvim-lua/plenary.nvim", lazy = true }, + { "nvim-tree/nvim-web-devicons", lazy = true, opts = {} }, + { 'nvim-mini/mini.extra', lazy = true, }, - -{ + { 'nvim-mini/mini.ai', lazy = false, version = '*', @@ -35,14 +31,12 @@ return { }) end }, - -{ + { 'nvim-mini/mini.move', lazy = false, version = '*', opts = {} }, - { 'nvim-mini/mini.align', lazy = false, version = '*', opts = {} }, { 'nvim-mini/mini.bracketed', lazy = false, version = '*', opts = {} }, { @@ -57,8 +51,7 @@ return { sort = { prefix = 'gs', func = nil, } } }, - -{ + { 'nvim-mini/mini.surround', lazy = false, version = '*', @@ -82,21 +75,19 @@ return { }, } }, - -{ - 'nvim-mini/mini.splitjoin', - lazy = false, - version = false, - config = function() - require('mini.splitjoin').setup() - end, - }, - -{ - "nvim-mini/mini.hipatterns", - lazy = false, - event = "BufReadPre", - config = function() + { + 'nvim-mini/mini.splitjoin', + lazy = false, + version = false, + config = function() + require('mini.splitjoin').setup() + end, + }, + { + "nvim-mini/mini.hipatterns", + lazy = false, + event = "BufReadPre", + config = function() local MiniExtra = require("mini.extra") local hi_words = MiniExtra.gen_highlighter.words require('mini.hipatterns').setup({ @@ -112,10 +103,9 @@ return { -- hex_color = hipatterns.gen_highlighter.hex_color(), }, }) - end, + end, }, - -{ + { 'nvim-mini/mini.files', event = 'VeryLazy', version = '*', @@ -133,17 +123,15 @@ return { }, } }, - -{ - 'nvim-mini/mini.sessions', - version = '*', - lazy = false, - config = function() - require('mini.sessions').setup() - end, - }, - -{ + { + 'nvim-mini/mini.sessions', + version = '*', + lazy = false, + config = function() + require('mini.sessions').setup() + end, + }, + { "folke/snacks.nvim", priority = 1000, lazy = false, @@ -421,5 +409,4 @@ return { }) end, }, - } diff --git a/config/nvim/lua/plugins/tools.lua b/config/nvim/lua/plugins/tools.lua index 1fe2bfc..134c8e7 100644 --- a/config/nvim/lua/plugins/tools.lua +++ b/config/nvim/lua/plugins/tools.lua @@ -1,208 +1,201 @@ return { + { + 'Civitasv/cmake-tools.nvim', + lazy = true, + config = function () + local osys = require("cmake-tools.osys") + require("cmake-tools").setup { + cmake_command = "cmake", -- this is used to specify cmake command path + ctest_command = "ctest", -- this is used to specify ctest command path + cmake_use_preset = true, + cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt + cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate` + cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild` + -- support macro expansion: + -- ${kit} + -- ${kitGenerator} + -- ${variant:xx} + cmake_build_directory = function() + if osys.iswin32 then + return "out\\${variant:buildType}" + end + return "out/${variant:buildType}" + end, -- this is used to specify generate directory for cmake, allows macro expansion, can be a string or a function returning the string, relative to cwd. + cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir + cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false + cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage + cmake_variants_message = { + short = { show = true }, -- whether to show short message + long = { show = true, max_length = 40 }, -- whether to show long message + }, + cmake_dap_configuration = { -- debug settings for cmake + name = "cpp", + type = "codelldb", + request = "launch", + stopOnEntry = false, + runInTerminal = true, + console = "integratedTerminal", + }, + cmake_executor = { -- executor to use + name = "quickfix", -- name of the executor + opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. + default_opts = { -- a list of default and possible values for executors + quickfix = { + show = "always", -- "always", "only_on_error" + position = "belowright", -- "vertical", "horizontal", "leftabove", "aboveleft", "rightbelow", "belowright", "topleft", "botright", use `:h vertical` for example to see help on them + size = 10, + encoding = "utf-8", -- if encoding is not "utf-8", it will be converted to "utf-8" using `vim.fn.iconv` + auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. + }, + toggleterm = { + direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float' + close_on_exit = false, -- whether close the terminal when exit + auto_scroll = true, -- whether auto scroll to the bottom + singleton = true, -- single instance, autocloses the opened one, if present + }, + overseer = { + new_task_opts = { + strategy = { + "toggleterm", + direction = "horizontal", + autos_croll = true, + quit_on_exit = "success" + } + }, -- options to pass into the `overseer.new_task` command + on_new_task = function(task) + require("overseer").open( + { enter = false, direction = "right" } + ) + end, -- a function that gets overseer.Task when it is created, before calling `task:start` + }, + terminal = { + name = "Main Terminal", + prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name + split_direction = "horizontal", -- "horizontal", "vertical" + split_size = 11, -{ - 'Civitasv/cmake-tools.nvim', - lazy = true, - config = function () - local osys = require("cmake-tools.osys") - require("cmake-tools").setup { - cmake_command = "cmake", -- this is used to specify cmake command path - ctest_command = "ctest", -- this is used to specify ctest command path - cmake_use_preset = true, - cmake_regenerate_on_save = true, -- auto generate when save CMakeLists.txt - cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, -- this will be passed when invoke `CMakeGenerate` - cmake_build_options = {}, -- this will be passed when invoke `CMakeBuild` - -- support macro expansion: - -- ${kit} - -- ${kitGenerator} - -- ${variant:xx} - cmake_build_directory = function() - if osys.iswin32 then - return "out\\${variant:buildType}" - end - return "out/${variant:buildType}" - end, -- this is used to specify generate directory for cmake, allows macro expansion, can be a string or a function returning the string, relative to cwd. - cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir - cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false - cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage - cmake_variants_message = { - short = { show = true }, -- whether to show short message - long = { show = true, max_length = 40 }, -- whether to show long message - }, - cmake_dap_configuration = { -- debug settings for cmake - name = "cpp", - type = "codelldb", - request = "launch", - stopOnEntry = false, - runInTerminal = true, - console = "integratedTerminal", - }, - cmake_executor = { -- executor to use - name = "quickfix", -- name of the executor - opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. - default_opts = { -- a list of default and possible values for executors - quickfix = { - show = "always", -- "always", "only_on_error" - position = "belowright", -- "vertical", "horizontal", "leftabove", "aboveleft", "rightbelow", "belowright", "topleft", "botright", use `:h vertical` for example to see help on them - size = 10, - encoding = "utf-8", -- if encoding is not "utf-8", it will be converted to "utf-8" using `vim.fn.iconv` - auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. - }, - toggleterm = { - direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float' - close_on_exit = false, -- whether close the terminal when exit - auto_scroll = true, -- whether auto scroll to the bottom - singleton = true, -- single instance, autocloses the opened one, if present - }, - overseer = { - new_task_opts = { - strategy = { - "toggleterm", - direction = "horizontal", - autos_croll = true, - quit_on_exit = "success" - } - }, -- options to pass into the `overseer.new_task` command - on_new_task = function(task) - require("overseer").open( - { enter = false, direction = "right" } - ) - end, -- a function that gets overseer.Task when it is created, before calling `task:start` - }, - terminal = { - name = "Main Terminal", - prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name - split_direction = "horizontal", -- "horizontal", "vertical" - split_size = 11, + -- Window handling + single_terminal_per_instance = true, -- Single viewport, multiple windows + single_terminal_per_tab = true, -- Single viewport per tab + keep_terminal_static_location = true, -- Static location of the viewport if avialable + auto_resize = true, -- Resize the terminal if it already exists - -- Window handling - single_terminal_per_instance = true, -- Single viewport, multiple windows - single_terminal_per_tab = true, -- Single viewport per tab - keep_terminal_static_location = true, -- Static location of the viewport if avialable - auto_resize = true, -- Resize the terminal if it already exists + -- Running Tasks + start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun + focus = false, -- Focus on terminal when cmake task is launched. + do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. + }, -- terminal executor uses the values in cmake_terminal + }, + }, + cmake_runner = { -- runner to use + name = "terminal", -- name of the runner + opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values. + default_opts = { -- a list of default and possible values for runners + quickfix = { + show = "always", -- "always", "only_on_error" + position = "belowright", -- "bottom", "top" + size = 10, + encoding = "utf-8", + auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. + }, + toggleterm = { + direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float' + close_on_exit = false, -- whether close the terminal when exit + auto_scroll = true, -- whether auto scroll to the bottom + singleton = true, -- single instance, autocloses the opened one, if present + }, + overseer = { + new_task_opts = { + strategy = { + "toggleterm", + direction = "horizontal", + autos_croll = true, + quit_on_exit = "success" + } + }, -- options to pass into the `overseer.new_task` command + on_new_task = function(task) + end, -- a function that gets overseer.Task when it is created, before calling `task:start` + }, + terminal = { + name = "Main Terminal", + prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name + split_direction = "horizontal", -- "horizontal", "vertical" + split_size = 11, - -- Running Tasks - start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun - focus = false, -- Focus on terminal when cmake task is launched. - do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. - }, -- terminal executor uses the values in cmake_terminal - }, - }, - cmake_runner = { -- runner to use - name = "terminal", -- name of the runner - opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values. - default_opts = { -- a list of default and possible values for runners - quickfix = { - show = "always", -- "always", "only_on_error" - position = "belowright", -- "bottom", "top" - size = 10, - encoding = "utf-8", - auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful. - }, - toggleterm = { - direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float' - close_on_exit = false, -- whether close the terminal when exit - auto_scroll = true, -- whether auto scroll to the bottom - singleton = true, -- single instance, autocloses the opened one, if present - }, - overseer = { - new_task_opts = { - strategy = { - "toggleterm", - direction = "horizontal", - autos_croll = true, - quit_on_exit = "success" - } - }, -- options to pass into the `overseer.new_task` command - on_new_task = function(task) - end, -- a function that gets overseer.Task when it is created, before calling `task:start` - }, - terminal = { - name = "Main Terminal", - prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name - split_direction = "horizontal", -- "horizontal", "vertical" - split_size = 11, + -- Window handling + single_terminal_per_instance = true, -- Single viewport, multiple windows + single_terminal_per_tab = true, -- Single viewport per tab + keep_terminal_static_location = true, -- Static location of the viewport if avialable + auto_resize = true, -- Resize the terminal if it already exists - -- Window handling - single_terminal_per_instance = true, -- Single viewport, multiple windows - single_terminal_per_tab = true, -- Single viewport per tab - keep_terminal_static_location = true, -- Static location of the viewport if avialable - auto_resize = true, -- Resize the terminal if it already exists - - -- Running Tasks - start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun - focus = false, -- Focus on terminal when cmake task is launched. - do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. - }, - }, - }, - cmake_notifications = { - runner = { enabled = true }, - executor = { enabled = true }, - spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display - refresh_rate_ms = 100, -- how often to iterate icons - }, - cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner) - } - end, - }, -{ - "al1-ce/just.nvim", - dependencies = { - 'nvim-lua/plenary.nvim', -- async jobs - 'j-hui/fidget.nvim', -- task progress (optional) + -- Running Tasks + start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun + focus = false, -- Focus on terminal when cmake task is launched. + do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter. + }, + }, + }, + cmake_notifications = { + runner = { enabled = true }, + executor = { enabled = true }, + spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display + refresh_rate_ms = 100, -- how often to iterate icons + }, + cmake_virtual_text_support = true, -- Show the target related to current file using virtual text (at right corner) + } + end, }, - config = true -}, - -{ - 'mistweaverco/kulala.nvim', - ft = {"http", "rest"}, - }, - -{ - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- add options here - -- or leave it empty to use the default settings - }, - keys = { - -- suggested keymap - { "kp", "PasteImage", desc = "Paste image from system clipboard" }, - }, - }, - -{ - "uhs-robert/sshfs.nvim", - opts = { - mounts = { - base_dir = vim.fn.expand("$HOME") .. "/Public", -- where remote mounts are created - }, - -- Refer to the configuration section below - -- or leave empty for defaults - }, - }, - -{ - "esmuellert/codediff.nvim", - dependencies = { "MunifTanjim/nui.nvim" }, - cmd = "CodeDiff", - }, - -{ - "ejrichards/mise.nvim", - keys = { - { "xm", "Lazy reload mise.nvim", desc = "Reload mise environment" } - }, - opts = { - unset_vars = true, - load_on_setup = true, - force_run = true, - } + { + "al1-ce/just.nvim", + dependencies = { + 'nvim-lua/plenary.nvim', -- async jobs + 'j-hui/fidget.nvim', -- task progress (optional) + }, + config = true }, - -{ + { + 'mistweaverco/kulala.nvim', + ft = {"http", "rest"}, + }, + { + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- add options here + -- or leave it empty to use the default settings + }, + keys = { + -- suggested keymap + { "kp", "PasteImage", desc = "Paste image from system clipboard" }, + }, + }, + { + "uhs-robert/sshfs.nvim", + opts = { + mounts = { + base_dir = vim.fn.expand("$HOME") .. "/Public", -- where remote mounts are created + }, + -- Refer to the configuration section below + -- or leave empty for defaults + }, + }, + { + "esmuellert/codediff.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + cmd = "CodeDiff", + }, + { + "ejrichards/mise.nvim", + keys = { + { "xm", "Lazy reload mise.nvim", desc = "Reload mise environment" } + }, + opts = { + unset_vars = true, + load_on_setup = true, + force_run = true, + } + }, + { 'NeogitOrg/neogit', dependencies = { 'nvim-lua/plenary.nvim', -- required @@ -210,8 +203,8 @@ return { }, lazy = true, keys = { - { 'gn', "Neogit kind=auto", desc = 'Neogit'}, - { 'gN', "Neogit kind=floating", desc = 'Neogit'} + { 'gn', "Neogit kind=auto", desc = 'Neogit'}, + { 'gN', "Neogit kind=floating", desc = 'Neogit'} }, opts = { -- disable_context_highlighting = true, @@ -219,19 +212,18 @@ return { disable_insert_on_commit = false, disable_signs = true, integrations = { diffview = true, fz_lua = false }, - auto_refresh = false, - console_timeout = 5000, - auto_show_console = false, - sections = { - stashes = { - folded = false, - }, - recent = { folded = false }, - }, + auto_refresh = false, + console_timeout = 5000, + auto_show_console = false, + sections = { + stashes = { + folded = false, + }, + recent = { folded = false }, + }, } }, - -{ + { 'stevearc/overseer.nvim', keys = { { "xo", "OverseerOpen", desc = "Open Overseer" }, @@ -275,41 +267,38 @@ return { end, }, - -{ + { 'stevearc/quicker.nvim', event = "FileType qf", ---@module "quicker" ---@type quicker.SetupOptions opts = {}, }, - -{ - "saxon1964/neovim-tips", - version = "*", -- Only update on tagged releases - lazy = false, -- Load on startup (recommended for daily tip feature) - dependencies = { - "MunifTanjim/nui.nvim", - -- OPTIONAL: Choose your preferred markdown renderer (or omit for raw markdown) - "MeanderingProgrammer/render-markdown.nvim", -- Clean rendering - -- OR: "OXY2DEV/markview.nvim", -- Rich rendering with advanced features - }, - opts = { - -- OPTIONAL: Location of user defined tips (default value shown below) - user_file = vim.fn.stdpath("config") .. "/neovim_tips/user_tips.md", - -- OPTIONAL: Prefix for user tips to avoid conflicts (default: "[User] ") - user_tip_prefix = "[User] ", - -- OPTIONAL: Show warnings when user tips conflict with builtin (default: true) - warn_on_conflicts = true, - -- OPTIONAL: Daily tip mode (default: 1) - -- 0 = off, 1 = once per day, 2 = every startup - daily_tip = 1, - -- OPTIONAL: Bookmark symbol (default: "🌟 ") - bookmark_symbol = "🌟 ", - }, - }, - -{ + { + "saxon1964/neovim-tips", + version = "*", -- Only update on tagged releases + lazy = false, -- Load on startup (recommended for daily tip feature) + dependencies = { + "MunifTanjim/nui.nvim", + -- OPTIONAL: Choose your preferred markdown renderer (or omit for raw markdown) + "MeanderingProgrammer/render-markdown.nvim", -- Clean rendering + -- OR: "OXY2DEV/markview.nvim", -- Rich rendering with advanced features + }, + opts = { + -- OPTIONAL: Location of user defined tips (default value shown below) + user_file = vim.fn.stdpath("config") .. "/neovim_tips/user_tips.md", + -- OPTIONAL: Prefix for user tips to avoid conflicts (default: "[User] ") + user_tip_prefix = "[User] ", + -- OPTIONAL: Show warnings when user tips conflict with builtin (default: true) + warn_on_conflicts = true, + -- OPTIONAL: Daily tip mode (default: 1) + -- 0 = off, 1 = once per day, 2 = every startup + daily_tip = 1, + -- OPTIONAL: Bookmark symbol (default: "🌟 ") + bookmark_symbol = "🌟 ", + }, + }, + { "nvim-pack/nvim-spectre", lazy = true, cmd = { "Spectre" }, @@ -331,23 +320,21 @@ return { }, } }, - -{ - "thunder-coding/zincoxide", - opts = { - -- name of zoxide binary in your "$PATH" or path to the binary - -- the command is executed using vim.fn.system() - -- eg. "zoxide" or "/usr/bin/zoxide" - zincoxide_cmd = "zoxide", - -- Kinda experimental as of now - complete = true, - -- Available options { "tabs", "window", "global" } - behaviour = "tabs", - }, - cmd = { "Z", "Zg", "Zt", "Zw" }, + { + "thunder-coding/zincoxide", + opts = { + -- name of zoxide binary in your "$PATH" or path to the binary + -- the command is executed using vim.fn.system() + -- eg. "zoxide" or "/usr/bin/zoxide" + zincoxide_cmd = "zoxide", + -- Kinda experimental as of now + complete = true, + -- Available options { "tabs", "window", "global" } + behaviour = "tabs", + }, + cmd = { "Z", "Zg", "Zt", "Zw" }, }, - -{ + { "folke/persistence.nvim", event = "BufReadPre", opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" } }, diff --git a/config/nvim/lua/plugins/ui.lua b/config/nvim/lua/plugins/ui.lua index 06788df..bc3e47c 100644 --- a/config/nvim/lua/plugins/ui.lua +++ b/config/nvim/lua/plugins/ui.lua @@ -1,6 +1,5 @@ return { - -{ + { "otavioschwanck/arrow.nvim", dependencies = { { @@ -15,8 +14,7 @@ return { buffer_leader_key = ';', -- Per Buffer Mappings } }, - -{ + { "utilyre/barbecue.nvim", dependencies = { { 'SmiteshP/nvim-navic', lazy = true }, @@ -24,8 +22,7 @@ return { event = "VeryLazy", opts = {}, }, - -{ + { "folke/flash.nvim", event = "VeryLazy", ---@type Flash.Config @@ -63,8 +60,7 @@ return { { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, }, }, - -{ + { "folke/snacks.nvim", opts = { notifier = { @@ -102,175 +98,168 @@ return { }, }, }, + { + 'nvim-lualine/lualine.nvim', + event = "VeryLazy", + config = function() + local function truncate_branch_name(branch) + if not branch or branch == "" then + return "" + end -{ - 'nvim-lualine/lualine.nvim', - event = "VeryLazy", - config = function() - local function truncate_branch_name(branch) - if not branch or branch == "" then - return "" - end + -- Match the branch name to the specified format + local _, _, ticket_number = string.find(branch, "skdillon/sko%-(%d+)%-") - -- Match the branch name to the specified format - local _, _, ticket_number = string.find(branch, "skdillon/sko%-(%d+)%-") + -- If the branch name matches the format, display sko-{ticket_number}, otherwise display the full branch name + if ticket_number then + return "sko-" .. ticket_number + else + return branch + end + end - -- If the branch name matches the format, display sko-{ticket_number}, otherwise display the full branch name - if ticket_number then - return "sko-" .. ticket_number - else - return branch - end - end - - require("lualine").setup({ - options = { - -- theme = "rose-pine", - globalstatus = true, - -- component_separators = { left = "", right = "" }, - -- section_separators = { left = "█", right = "█" }, - icons_enabled = true, - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - tabline = { - lualine_a = {}, - lualine_b = {'branch'}, - lualine_c = {'filename'}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {} - }, - }, - sections = { - lualine_b = { - { "branch", icon = "", fmt = truncate_branch_name }, - "diff", - "diagnostics", - }, - lualine_c = { - { 'lsp_progress' }, - { - 'buffers', - show_filename_only = true, -- Shows shortened relative path when set to false. - hide_filename_extension = false, -- Hide filename extension when set to true. - show_modified_status = true, -- Shows indicator when the buffer is modified. - mode = 0, - max_length = vim.o.columns * 2 / 3, - filetype_names = { - TelescopePrompt = ' ', - }, - -- it can also be a function that returns - -- the value of `max_length` dynamically. - use_mode_colors = false, - symbols = { - modified = ' ●', -- Text to show when the buffer is modified - alternate_file = '#', -- Text to show to identify the alternate file - directory = '', -- Text to show when the buffer is a directory - }, - }, - }, - lualine_x = { - "windows", - "fileformat", - "filetype", - }, - }, - }) - end, - }, - -{ - "hedyhli/outline.nvim", - lazy = true, - cmd = { "Outline", "OutlineOpen" }, - keys = { -- Example mapping to toggle outline - { "so", "Outline", desc = "Toggle outline" }, - }, - opts = { - symbol_folding = { - -- Unfold entire symbol tree by default with false, otherwise enter a - -- number starting from 1 - autofold_depth = false, - -- autofold_depth = 1, + require("lualine").setup({ + options = { + -- theme = "rose-pine", + globalstatus = true, + -- component_separators = { left = "", right = "" }, + -- section_separators = { left = "█", right = "█" }, + icons_enabled = true, + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + tabline = { + lualine_a = {}, + lualine_b = {'branch'}, + lualine_c = {'filename'}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + }, + sections = { + lualine_b = { + { "branch", icon = "", fmt = truncate_branch_name }, + "diff", + "diagnostics", + }, + lualine_c = { + { 'lsp_progress' }, + { + 'buffers', + show_filename_only = true, -- Shows shortened relative path when set to false. + hide_filename_extension = false, -- Hide filename extension when set to true. + show_modified_status = true, -- Shows indicator when the buffer is modified. + mode = 0, + max_length = vim.o.columns * 2 / 3, + filetype_names = { + TelescopePrompt = ' ', + }, + -- it can also be a function that returns + -- the value of `max_length` dynamically. + use_mode_colors = false, + symbols = { + modified = ' ●', -- Text to show when the buffer is modified + alternate_file = '#', -- Text to show to identify the alternate file + directory = '', -- Text to show when the buffer is a directory + }, + }, + }, + lualine_x = { + "windows", + "fileformat", + "filetype", + }, + }, + }) + end, + }, + { + "hedyhli/outline.nvim", + lazy = true, + cmd = { "Outline", "OutlineOpen" }, + keys = { -- Example mapping to toggle outline + { "so", "Outline", desc = "Toggle outline" }, + }, + opts = { + symbol_folding = { + -- Unfold entire symbol tree by default with false, otherwise enter a + -- number starting from 1 + autofold_depth = false, + -- autofold_depth = 1, + }, }, - }, }, - -{ - 'stevearc/quicker.nvim', - ft = "qf", - ---@module "quicker" - ---@type quicker.SetupOptions - opts = {}, - }, - -{ - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - -- { "", "TmuxNavigatePrevious" }, - }, + { + 'stevearc/quicker.nvim', + ft = "qf", + ---@module "quicker" + ---@type quicker.SetupOptions + opts = {}, }, - -{ - 'akinsho/toggleterm.nvim', - lazy = false, - config = function() - require("toggleterm").setup({ - -- highlights = require("rose-pine.plugins.toggleterm"), - size = 20, - open_mapping = [[]], - hide_numbers = true, - shade_terminals = true, - shading_factor = 2, - start_in_insert = true, - insert_mappings = true, - persiste_size = true, - direction = 'horizontal', - close_on_exit = true, - float_opts = { - border = "curved", - } - }) - end, - keys = { - { "", "", desc = "Escape input", mode = { "t" } } - }, - }, - -{ + { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + -- { "", "TmuxNavigatePrevious" }, + }, + }, + { + 'akinsho/toggleterm.nvim', + lazy = false, + config = function() + require("toggleterm").setup({ + -- highlights = require("rose-pine.plugins.toggleterm"), + size = 20, + open_mapping = [[]], + hide_numbers = true, + shade_terminals = true, + shading_factor = 2, + start_in_insert = true, + insert_mappings = true, + persiste_size = true, + direction = 'horizontal', + close_on_exit = true, + float_opts = { + border = "curved", + } + }) + end, + keys = { + { "", "", desc = "Escape input", mode = { "t" } } + }, + }, + { 'ten3roberts/window-picker.nvim', opts = { - -- Default keys to annotate, keys will be used in order. The default uses the - -- most accessible keys from the home row and then top row. - keys = 'alskdjfhgwoeiruty', - -- Swap windows by holding shift + letter - swap_shift = true, - -- Windows containing filetype to exclude - exclude = { qf = true, NvimTree = true, aerial = true }, - -- Flash the cursor line of the newly focused window for 300ms. - -- Set to 0 or false to disable. - flash_duration = 300, - }, - keys = { - { "a", "WindowPick", desc = "Windows Pick"}, - { "a", "WindowPick", desc = "Windows Pick"}, - { "D", "WindowZap", desc = "Windows Delete"}, - { "S", "WindowSwap", desc = "Windows Swap"}, - }, + -- Default keys to annotate, keys will be used in order. The default uses the + -- most accessible keys from the home row and then top row. + keys = 'alskdjfhgwoeiruty', + -- Swap windows by holding shift + letter + swap_shift = true, + -- Windows containing filetype to exclude + exclude = { qf = true, NvimTree = true, aerial = true }, + -- Flash the cursor line of the newly focused window for 300ms. + -- Set to 0 or false to disable. + flash_duration = 300, + }, + keys = { + { "a", "WindowPick", desc = "Windows Pick"}, + { "a", "WindowPick", desc = "Windows Pick"}, + { "D", "WindowZap", desc = "Windows Delete"}, + { "S", "WindowSwap", desc = "Windows Swap"}, + }, }, - -{ + { "folke/which-key.nvim", event = "VimEnter", opts = { @@ -311,26 +300,25 @@ return { }, }, spec = { - { "g", group = "+goto" }, - { "]", group = "+next" }, - { "[", group = "+prev" }, - { "c", group = "+code", mode = { 'n', 'x' } }, - { "b", group = "+buffer" }, - { "f", group = "+find" }, - { "g", group = "+goto" }, - { "k", group = "+obsidian" }, - { "l", group = "+lsp" }, - { "m", group = "+bookmark" }, - { "o", group = "+notes" }, - { "r", group = "+ai" }, - { "s", group = "+search" }, - { "t", group = "+trouble" }, - { "v", group = "+vcs", mode = { 'n', 'v' } }, - { "w", group = "+workspace" }, - { "x", group = "+extra" }, - { "u", group = "+toggle" }, + { "g", group = "+goto" }, + { "]", group = "+next" }, + { "[", group = "+prev" }, + { "c", group = "+code", mode = { 'n', 'x' } }, + { "b", group = "+buffer" }, + { "f", group = "+find" }, + { "g", group = "+goto" }, + { "k", group = "+obsidian" }, + { "l", group = "+lsp" }, + { "m", group = "+bookmark" }, + { "o", group = "+notes" }, + { "r", group = "+ai" }, + { "s", group = "+search" }, + { "t", group = "+trouble" }, + { "v", group = "+vcs", mode = { 'n', 'v' } }, + { "w", group = "+workspace" }, + { "x", group = "+extra" }, + { "u", group = "+toggle" }, }, }, }, - }