Skip to content

Commit be3b592

Browse files
author
Zhe Yu
committed
update documentations.
1 parent db9f17e commit be3b592

1 file changed

Lines changed: 30 additions & 32 deletions

File tree

docs/neovim/README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ option explained below.
180180

181181
```lua
182182
---@module "vectorcode"
183-
require('codecompanion').setup({
183+
require("codecompanion").setup({
184184
extensions = {
185185
vectorcode = {
186186
---@type VectorCode.CodeCompanion.ExtensionOpts
@@ -215,14 +215,14 @@ require('codecompanion').setup({
215215
enabled = false,
216216
adapter = nil,
217217
query_augmented = true,
218-
}
218+
},
219219
},
220220
files_ls = {},
221-
files_rm = {}
222-
}
221+
files_rm = {},
222+
},
223223
},
224224
},
225-
}
225+
},
226226
})
227227
```
228228

@@ -291,7 +291,7 @@ you can refer to if you wish to build local RAG APPs with CodeCompanion.nvim and
291291
VectorCode.
292292

293293
```lua
294-
require('codecompanion').setup{
294+
require("codecompanion").setup({
295295
extensions = {
296296
vectorcode = {
297297
---@type VectorCode.CodeCompanion.ExtensionOpts
@@ -301,20 +301,20 @@ require('codecompanion').setup{
301301
{
302302
["Neovim Tutor"] = {
303303
-- this is for demonstration only.
304-
-- "Neovim Tutor" is shipped with this plugin
305-
-- and you don't need to add it in the config
304+
-- "Neovim Tutor" is shipped with this plugin already,
305+
-- and you don't need to add it in the config
306306
-- unless you're not happy with the defaults.
307307
project_root = vim.env.VIMRUNTIME,
308308
file_patterns = { "lua/**/*.lua", "doc/**/*.txt" },
309309
-- system_prompt = ...,
310310
-- user_prompt = ...,
311311
},
312312
},
313-
}
314-
}
315-
}
316-
}
317-
}
313+
},
314+
},
315+
},
316+
},
317+
})
318318
```
319319

320320
The `prompt_library` option is a mapping of prompt name (`string`) to a lua table
@@ -346,13 +346,14 @@ contextual information about your codebase to enhance Copilot's responses. Add t
346346
to your CopilotChat configuration:
347347

348348
```lua
349-
local vectorcode_ctx = require('vectorcode.integrations.copilotchat').make_context_provider({
350-
prompt_header = "Here are relevant files from the repository:", -- Customize header text
351-
prompt_footer = "\nConsider this context when answering:", -- Customize footer text
352-
skip_empty = true, -- Skip adding context when no files are retrieved
353-
})
354-
355-
require('CopilotChat').setup({
349+
local vectorcode_ctx =
350+
require("vectorcode.integrations.copilotchat").make_context_provider({
351+
prompt_header = "Here are relevant files from the repository:", -- Customize header text
352+
prompt_footer = "\nConsider this context when answering:", -- Customize footer text
353+
skip_empty = true, -- Skip adding context when no files are retrieved
354+
})
355+
356+
require("CopilotChat").setup({
356357
-- Your other CopilotChat options...
357358

358359
contexts = {
@@ -364,10 +365,10 @@ require('CopilotChat').setup({
364365
prompts = {
365366
Explain = {
366367
prompt = "Explain the following code in detail:\n$input",
367-
context = {"selection", "vectorcode"}, -- Add vectorcode to the context
368+
context = { "selection", "vectorcode" }, -- Add vectorcode to the context
368369
},
369370
-- Other prompts...
370-
}
371+
},
371372
})
372373
```
373374

@@ -395,7 +396,7 @@ The integration includes caching to avoid sending duplicate context to the LLM,
395396
You can configure VectorCode to be part of your sticky prompts, ensuring every conversation includes relevant codebase context automatically:
396397

397398
```lua
398-
require('CopilotChat').setup({
399+
require("CopilotChat").setup({
399400
-- Your other CopilotChat options...
400401

401402
sticky = {
@@ -416,8 +417,8 @@ cached retrieval results.
416417
```lua
417418
tabline = {
418419
lualine_y = {
419-
require("vectorcode.integrations").lualine(opts)
420-
}
420+
require("vectorcode.integrations").lualine(opts),
421+
},
421422
}
422423
```
423424
`opts` is a table with the following configuration option:
@@ -442,7 +443,7 @@ tabline = {
442443
end
443444
end,
444445
},
445-
}
446+
},
446447
}
447448
```
448449
This will further delay the loading of VectorCode to the moment you (or one of
@@ -589,12 +590,9 @@ vim.api.nvim_create_autocmd("LspAttach", {
589590
callback = function()
590591
local bufnr = vim.api.nvim_get_current_buf()
591592
cacher.async_check("config", function()
592-
cacher.register_buffer(
593-
bufnr,
594-
{
595-
n_query = 10,
596-
}
597-
)
593+
cacher.register_buffer(bufnr, {
594+
n_query = 10,
595+
})
598596
end, nil)
599597
end,
600598
desc = "Register buffer for VectorCode",

0 commit comments

Comments
 (0)