From 8c86a248c1e34168f6f9fcaa5638d7756d7da414 Mon Sep 17 00:00:00 2001 From: kerma Date: Fri, 10 Jan 2025 18:07:06 +0200 Subject: [PATCH 1/3] add installation instructions for vim-plug users --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87bc875..e2abcf3 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,17 @@ magenta.nvim is a plugin for leveraging LLM agents in neovim. Think cursor-compo Rather than writing complex code to compress your repo and send it to the LLM (like a repomap, etc...), magenta is built around the idea that the LLM can ask for what it needs to via tools. Flagship models will continue to get better at tools use, and as this happens, the gap between tools like magenta and other agentic tools will grow smaller. -# Installation (lazy.nvim) +# Installation Install [bun](https://bun.sh/) +The plugin will look for configuration for providers in the following env variables: + +- anthropic: ANTHROPIC_API_KEY +- openai: OPENAI_API_KEY, OPENAI_BASE_URL + +## Using lazy.nvim + ```lua { "dlants/magenta.nvim", @@ -22,10 +29,30 @@ Install [bun](https://bun.sh/) }, ``` -The plugin will look for configuration for providers in the following env variables: +## Using vim-plug -- anthropic: ANTHROPIC_API_KEY -- openai: OPENAI_API_KEY, OPENAI_BASE_URL +Example with the openai provider and lazy loading. + +```lua +local vim = vim +local Plug = vim.fn['plug#'] + +vim.call('plug#begin') +Plug('dlants/magenta.vim', { + ['do'] = 'bun install --frozen-lockfile', + ['on'] = 'Magenta', +}) +vim.call('plug#end') + +local magenta = require('magenta') + +magenta.setup({ + provider = 'openai', + openai = { + model = 'gpt-4o' + }, +}) +``` # Usage From 6494fabf16cef56c29ebf8d427ba152a4c386ebc Mon Sep 17 00:00:00 2001 From: kerma Date: Fri, 10 Jan 2025 21:44:55 +0200 Subject: [PATCH 2/3] use default config for vim-plug ..and fix a typo --- README.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e2abcf3..444ef74 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,6 @@ The plugin will look for configuration for providers in the following env variab ## Using vim-plug -Example with the openai provider and lazy loading. - ```lua local vim = vim local Plug = vim.fn['plug#'] @@ -40,18 +38,10 @@ local Plug = vim.fn['plug#'] vim.call('plug#begin') Plug('dlants/magenta.vim', { ['do'] = 'bun install --frozen-lockfile', - ['on'] = 'Magenta', }) vim.call('plug#end') -local magenta = require('magenta') - -magenta.setup({ - provider = 'openai', - openai = { - model = 'gpt-4o' - }, -}) +require('magenta').setup() ``` # Usage @@ -68,7 +58,7 @@ TLDR: - `mt` is for `:Magenta toggle`, will toggle the sidebar on and off. - `mp` is for `:Magenta paste-selection`. In visual mode it will take the current selection and paste it into the input buffer. -- `mc` is for `:Magenta context-files` with your _current_ file. It will pin the current file to your context. +- `mb` is for `:Magenta context-files` with your _current_ file. It will pin the current file to your context. - `mf` is for `:Magenta context-files` it allows you to select files via fzf-lua, and will pin those files to your context. This requires that fzf-lua is installed. - `mc` is for `:Magenta clear`, which will clear the current chat. - `ma` is for `:Magenta abort`, which will abort the current in-flight request. From c052b431d1693ff23f9d244602b66bf104612be3 Mon Sep 17 00:00:00 2001 From: Margus Kerma Date: Sat, 11 Jan 2025 12:28:43 +0200 Subject: [PATCH 3/3] fix prettier check --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 754ee06..d40aa9d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,6 @@ Note! I am probably going to port this from bun to node, see https://github.com/dlants/magenta.nvim/issues/25 - ## issues and discussions I'd like to keep the issues down to just known bugs and things that I'm confident about implementing. Support questions and feature requests should go in the discussion board.