From b1bf9a5f9f3667e94c2b8864135ab9da586ac64a Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Sun, 8 Feb 2026 19:04:38 +1030 Subject: [PATCH] chore: added amp for testing --- .config/nvim/lua/lazyvim/plugins/amp.lua | 8 + .config/nvim/lua/lazyvim/plugins/cmp.lua | 200 +++++++++--------- .../lua/lazyvim/plugins/codecompanion.lua | 86 ++++---- 3 files changed, 151 insertions(+), 143 deletions(-) create mode 100644 .config/nvim/lua/lazyvim/plugins/amp.lua diff --git a/.config/nvim/lua/lazyvim/plugins/amp.lua b/.config/nvim/lua/lazyvim/plugins/amp.lua new file mode 100644 index 0000000..d4e93af --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/amp.lua @@ -0,0 +1,8 @@ +return { + { + "sourcegraph/amp.nvim", + branch = "main", + lazy = false, + opts = { auto_start = true, log_level = "info" }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/cmp.lua b/.config/nvim/lua/lazyvim/plugins/cmp.lua index afd954d..6c33c9b 100644 --- a/.config/nvim/lua/lazyvim/plugins/cmp.lua +++ b/.config/nvim/lua/lazyvim/plugins/cmp.lua @@ -1,106 +1,106 @@ return { - { - 'saghen/blink.cmp', - enabled = true, - -- optional: provides snippets for the snippet source - dependencies = 'rafamadriz/friendly-snippets', + { + "saghen/blink.cmp", + enabled = true, + -- optional: provides snippets for the snippet source + dependencies = "rafamadriz/friendly-snippets", - -- use a release tag to download pre-built binaries - version = '*', - -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', - -- If you use nix, you can build from source using latest nightly rust with: - -- build = 'nix run .#build-plugin', + -- use a release tag to download pre-built binaries + version = "*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - enabled = function() - -- you list filetypes where you dob't want blink blink to work here - local disabled_filetypes = { "oil_preview", "oil", "TelescopePrompt" } -- you can add extra fileypes you do not want blink enabled. - return not vim.tbl_contains(disabled_filetypes, vim.bo.filetype) - end, - -- 'default' for mappings similar to built-in completion - -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) - -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept - -- See the full "keymap" documentation for information on defining your own keymap. - keymap = { - preset = 'enter', - }, + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + enabled = function() + -- you list filetypes where you dob't want blink blink to work here + local disabled_filetypes = { "oil_preview", "oil", "TelescopePrompt" } -- you can add extra fileypes you do not want blink enabled. + return not vim.tbl_contains(disabled_filetypes, vim.bo.filetype) + end, + -- 'default' for mappings similar to built-in completion + -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) + -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept + -- See the full "keymap" documentation for information on defining your own keymap. + keymap = { + preset = "enter", + }, - appearance = { - -- Sets the fallback highlight groups to nvim-cmp's highlight groups - -- Useful for when your theme doesn't support blink.cmp - -- Will be removed in a future release - use_nvim_cmp_as_default = true, - -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono' - }, + appearance = { + -- Sets the fallback highlight groups to nvim-cmp's highlight groups + -- Useful for when your theme doesn't support blink.cmp + -- Will be removed in a future release + use_nvim_cmp_as_default = true, + -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + }, - -- Default list of enabled providers defined so that you can extend it - -- elsewhere in your config, without redefining it, due to `opts_extend` - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer', 'codecompanion' }, - -- default = { 'lsp', 'path', 'snippets', 'buffer' }, - }, - }, - opts_extend = { "sources.default" } - }, - { - "hrsh7th/nvim-cmp", - enabled = false, - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-path", - "hrsh7th/cmp-emoji", - "hrsh7th/cmp-buffer", - -- "saadparwaiz1/cmp_luasnip", - }, - config = function() - local cmp = require("cmp") - cmp.setup({ - completion = { - completeopt = "menu,menuone,noinsert", - }, - snippet = { - -- expand = function(args) - -- require("luasnip").lsp_expand(args.body) - -- end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - }), - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - -- { name = "luasnip" }, - { name = "path" }, - { name = "emoji" }, - { name = "buffer" }, - -- { name = "copilot" }, - }), - formatting = { - format = function(_, item) - local icons = require("lazyvim.config.icons").kind - if icons[item.kind] then - item.kind = icons[item.kind] .. " " .. item.kind - end - return item - end, - }, - experimental = { - ghost_text = { - hl_group = "LspCodeLens", - }, - }, - }) - end, - }, + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + -- default = { 'lsp', 'path', 'snippets', 'buffer', 'codecompanion' }, + default = { "lsp", "path", "snippets", "buffer" }, + }, + }, + opts_extend = { "sources.default" }, + }, + { + "hrsh7th/nvim-cmp", + enabled = false, + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-emoji", + "hrsh7th/cmp-buffer", + -- "saadparwaiz1/cmp_luasnip", + }, + config = function() + local cmp = require("cmp") + cmp.setup({ + completion = { + completeopt = "menu,menuone,noinsert", + }, + snippet = { + -- expand = function(args) + -- require("luasnip").lsp_expand(args.body) + -- end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + -- { name = "luasnip" }, + { name = "path" }, + { name = "emoji" }, + { name = "buffer" }, + -- { name = "copilot" }, + }), + formatting = { + format = function(_, item) + local icons = require("lazyvim.config.icons").kind + if icons[item.kind] then + item.kind = icons[item.kind] .. " " .. item.kind + end + return item + end, + }, + experimental = { + ghost_text = { + hl_group = "LspCodeLens", + }, + }, + }) + end, + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/codecompanion.lua b/.config/nvim/lua/lazyvim/plugins/codecompanion.lua index e21777c..27baddb 100644 --- a/.config/nvim/lua/lazyvim/plugins/codecompanion.lua +++ b/.config/nvim/lua/lazyvim/plugins/codecompanion.lua @@ -1,45 +1,45 @@ return { - { - "olimorris/codecompanion.nvim", - enabled = require('lazyvim.utils').exists('$HOME/.config/openai/KEY'), - lazy = false, - dependencies = { - { "nvim-lua/plenary.nvim", branch = "master" }, - "nvim-treesitter/nvim-treesitter", - "ravitemer/mcphub.nvim", - }, - keys = { - { "C", "CodeCompanionChat", desc = "Open CodeCompanion Chat" } - }, - opts = { - strategies = { - chat = { adapter = "openai" }, - inline = { adapter = "openai" }, - }, - extensions = { - mcphub = { - callback = "mcphub.extensions.codecompanion", - opts = { - make_vars = true, - make_slash_commands = true, - show_result_in_chat = true - } - } - }, - opts = { - log_level = "DEBUG", - }, - adapters = { - http = { - openai = function() - return require("codecompanion.adapters").extend("openai", { - env = { - api_key = "cmd:cat $HOME/.config/openai/KEY", - }, - }) - end, - }, - }, - }, - }, + { + "olimorris/codecompanion.nvim", + enabled = false and require("lazyvim.utils").exists("$HOME/.config/openai/KEY"), + lazy = false, + dependencies = { + { "nvim-lua/plenary.nvim", branch = "master" }, + "nvim-treesitter/nvim-treesitter", + "ravitemer/mcphub.nvim", + }, + keys = { + { "C", "CodeCompanionChat", desc = "Open CodeCompanion Chat" }, + }, + opts = { + strategies = { + chat = { adapter = "openai" }, + inline = { adapter = "openai" }, + }, + extensions = { + mcphub = { + callback = "mcphub.extensions.codecompanion", + opts = { + make_vars = true, + make_slash_commands = true, + show_result_in_chat = true, + }, + }, + }, + opts = { + log_level = "DEBUG", + }, + adapters = { + http = { + openai = function() + return require("codecompanion.adapters").extend("openai", { + env = { + api_key = "cmd:cat $HOME/.config/openai/KEY", + }, + }) + end, + }, + }, + }, + }, }