Skip to content

Commit 8c86a24

Browse files
kermadlants
authored andcommitted
add installation instructions for vim-plug users
1 parent 0dcaf5d commit 8c86a24

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

README.md

+31-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ magenta.nvim is a plugin for leveraging LLM agents in neovim. Think cursor-compo
77
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.
88
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.
99

10-
# Installation (lazy.nvim)
10+
# Installation
1111

1212
Install [bun](https://bun.sh/)
1313

14+
The plugin will look for configuration for providers in the following env variables:
15+
16+
- anthropic: ANTHROPIC_API_KEY
17+
- openai: OPENAI_API_KEY, OPENAI_BASE_URL
18+
19+
## Using lazy.nvim
20+
1421
```lua
1522
{
1623
"dlants/magenta.nvim",
@@ -22,10 +29,30 @@ Install [bun](https://bun.sh/)
2229
},
2330
```
2431

25-
The plugin will look for configuration for providers in the following env variables:
32+
## Using vim-plug
2633

27-
- anthropic: ANTHROPIC_API_KEY
28-
- openai: OPENAI_API_KEY, OPENAI_BASE_URL
34+
Example with the openai provider and lazy loading.
35+
36+
```lua
37+
local vim = vim
38+
local Plug = vim.fn['plug#']
39+
40+
vim.call('plug#begin')
41+
Plug('dlants/magenta.vim', {
42+
['do'] = 'bun install --frozen-lockfile',
43+
['on'] = 'Magenta',
44+
})
45+
vim.call('plug#end')
46+
47+
local magenta = require('magenta')
48+
49+
magenta.setup({
50+
provider = 'openai',
51+
openai = {
52+
model = 'gpt-4o'
53+
},
54+
})
55+
```
2956

3057
# Usage
3158

0 commit comments

Comments
 (0)