From da216e84c93cb4b2569e13c99d787c2ac31dfbf8 Mon Sep 17 00:00:00 2001 From: Daniel Winkler Date: Fri, 17 Apr 2026 18:05:04 +1000 Subject: [PATCH] fix for new neovim --- flake.lock | 120 --------------------------------------- plugin/00_options.lua | 5 +- plugin/10_keymap.lua | 8 +-- plugin/24_completion.lua | 63 +++++++++++--------- 4 files changed, 44 insertions(+), 152 deletions(-) delete mode 100644 flake.lock diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 62b5dce..0000000 --- a/flake.lock +++ /dev/null @@ -1,120 +0,0 @@ -{ - "nodes": { - "fran": { - "inputs": { - "nixpkgs": [ - "rixpkgs" - ] - }, - "locked": { - "lastModified": 1776140472, - "narHash": "sha256-yOR+i8ZLzATQhR2zANTog8lpmenm0c4Et/PIV4vBZZY=", - "owner": "dwinkler1", - "repo": "fran", - "rev": "697a1c07e7f0c69a5850667804aa439f9dd733b1", - "type": "github" - }, - "original": { - "owner": "dwinkler1", - "repo": "fran", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1776169885, - "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "plugins-cmp-pandoc-references": { - "flake": false, - "locked": { - "lastModified": 1743491695, - "narHash": "sha256-XsdneGNJzmRBggk8lz9JNDQYk7wbYfUAF2oZLXzFb9c=", - "owner": "jmbuhr", - "repo": "cmp-pandoc-references", - "rev": "130eae4f75029d6495808e0ea4b769fa1ce4c9ac", - "type": "github" - }, - "original": { - "owner": "jmbuhr", - "repo": "cmp-pandoc-references", - "type": "github" - } - }, - "plugins-r": { - "flake": false, - "locked": { - "lastModified": 1776340770, - "narHash": "sha256-o/8UZIc/Bq9dWTjA+MpSR5uMUpE7KHTErk+TwWID8Ww=", - "owner": "R-nvim", - "repo": "R.nvim", - "rev": "b9cfffeb9b4e484aa9e13f01c0eb80230aada455", - "type": "github" - }, - "original": { - "owner": "R-nvim", - "repo": "R.nvim", - "type": "github" - } - }, - "rixpkgs": { - "locked": { - "lastModified": 1771303851, - "narHash": "sha256-tgveHozOJ2D/mi3LxVy/FcmLFDlM5XKZxsNB2XpvzaM=", - "owner": "dwinkler1", - "repo": "rixpkgs", - "rev": "af2dd3f7b4b172077747c0869d4e30702fb71b0e", - "type": "github" - }, - "original": { - "owner": "dwinkler1", - "ref": "nixpkgs", - "repo": "rixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "fran": "fran", - "nixpkgs": "nixpkgs", - "plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references", - "plugins-r": "plugins-r", - "rixpkgs": "rixpkgs", - "wrappers": "wrappers" - } - }, - "wrappers": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1776375800, - "narHash": "sha256-/SSAR77Brr9fbapsh1cb2K47JXCbvwS1GjM4yyDxle8=", - "owner": "BirdeeHub", - "repo": "nix-wrapper-modules", - "rev": "f11469ca69068bac13d9e163b2bd268cc06dff57", - "type": "github" - }, - "original": { - "owner": "BirdeeHub", - "repo": "nix-wrapper-modules", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/plugin/00_options.lua b/plugin/00_options.lua index 2714fa1..2b4485b 100644 --- a/plugin/00_options.lua +++ b/plugin/00_options.lua @@ -66,8 +66,9 @@ if vim.fn.has('nvim-0.11') == 1 then vim.o.winborder = 'rounded' -- Use double-line as default border end if vim.fn.has('nvim-0.12') == 1 then - vim.o.pummaxwidth = 100 -- Limit maximum width of popup menu - vim.o.completefuzzycollect = 'keyword,files,whole_line' -- Use fuzzy matching when collecting candidates + vim.o.pummaxwidth = 100 -- Limit maximum width of popup menu + -- vim.o.completefuzzycollect = 'keyword,files,whole_line' -- Use fuzzy matching when collecting candidates + vim.opt.completeopt = { "menu", "popup", "fuzzy", "longest" } end vim.o.complete = '.,w,b,kspell' -- Use spell check and don't use tags for completion diff --git a/plugin/10_keymap.lua b/plugin/10_keymap.lua index c18bfd9..ebbebf0 100644 --- a/plugin/10_keymap.lua +++ b/plugin/10_keymap.lua @@ -67,18 +67,18 @@ nmap_leader('', 'bprev', 'Prev buffer') -- a is for 'AI' nmap_leader("ac", "CodeCompanionChat Toggle", "Chat Toggle") -nmap_leader("ae", "CodeCompanion /explain", "Explain Code") -nmap_leader("af", "CodeCompanion /fix", "Fix Code") +-- nmap_leader("ae", "CodeCompanion /explain", "Explain Code") +-- nmap_leader("af", "CodeCompanion /fix", "Fix Code") nmap_leader("ag", "CodeCompanion /commit", "Generate commit message") nmap_leader("ai", "CodeCompanionActions", "Chat Action") nmap_leader("al", "CodeCompanion /lsp", "Explain LSP Diagnostics") nmap_leader("an", "CodeCompanionChat Add", "Chat New") nmap_leader("as", "CodeCompanion /suggest", "Suggest Improvements") -nmap_leader("ax", "CodeCompanion /fixer", "Code Fixer") +--nmap_leader("ax", "CodeCompanion /fixer", "Code Fixer") nmap_leader("ax", "CodeCompanion /fixer", "Code Fixer") xmap_leader("ae", "CodeCompanion /explain", "Explain Code") xmap_leader("af", "CodeCompanion /fix", "Fix Code") -xmap_leader("ap", "CodeCompanion /expert", "Code Fixer") +--xmap_leader("ap", "CodeCompanion /expert", "Code Fixer") xmap_leader("ap", "CodeCompanion /expert", "Code Fixer") xmap_leader("as", "CodeCompanion /suggest", "Suggest Improvements") diff --git a/plugin/24_completion.lua b/plugin/24_completion.lua index 2b21185..3e0f00c 100644 --- a/plugin/24_completion.lua +++ b/plugin/24_completion.lua @@ -1,5 +1,6 @@ local add = Config.add local later = MiniDeps.later +local now = MiniDeps.now local now_if_args = Config.now_if_args -- Constants @@ -83,16 +84,33 @@ end local function get_codecompanion_config() return { - adapters = { - http = { - copilot = function() - return require("codecompanion.adapters").extend("copilot", { - schema = { - model = { default = "gemini-3-pro-preview" } - } - }) - end, - } + interactions = { + chat = { + adapter = { + name = "copilot", + model = "gemini-3.1-pro-preview", + }, + opts = { + completion_provider = "blink", + }, + }, + inline = { + adapter = { + name = "copilot", + model = "gemini-3.1-pro-preview", + } + }, + keymaps = { + accept_change = { + modes = { n = "ga" }, + description = "Accept the suggested change", + }, + reject_change = { + modes = { n = "gr" }, + opts = { nowait = true }, + description = "Reject the suggested change", + }, + }, }, display = { chat = { @@ -105,10 +123,10 @@ local function get_codecompanion_config() }, }, prompt_library = { - ["Code Expert"] = { - strategy = "chat", + ["expert"] = { + interaction = "chat", description = "Get expert advice from an LLM", - opts = create_common_opts("ae", "expert"), + --opts = create_common_opts("ae", "expert"), prompts = { { role = "system", @@ -125,10 +143,10 @@ local function get_codecompanion_config() }, }, }, - ["Code Fixer"] = { - strategy = "chat", + ["fixer"] = { + interaction = "chat", description = "Fix code errors with expert guidance", - opts = create_common_opts("af", "afixer"), + --opts = create_common_opts("af", "afixer"), prompts = { { role = "system", @@ -145,17 +163,10 @@ local function get_codecompanion_config() }, }, }, - ["Suggest"] = { - strategy = "chat", + ["suggest"] = { + interaction = "chat", description = "Suggest improvements to the buffer", - opts = { - mapping = "as", - modes = { "v" }, - short_name = "suggest", - auto_submit = true, - user_prompt = false, - stop_context_insertion = false, - }, + --opts = create_common_opts("as", "suggest"), prompts = { { role = "system",