forked from sourcegraph/sg.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.lua
More file actions
47 lines (39 loc) · 1.5 KB
/
Copy pathconfig.lua
File metadata and controls
47 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---@brief [[
--- Config options for sg.nvim
---
--- All options can be set via
---
--- <code=lua>
--- require("sg").setup { ... }
--- </code>
---
--- Other configuration notes:
--- - To configure options for the prompt, you can use `ftplugin/cody_prompt.lua`
--- - To configure options for the history, you can use `ftplugin/cody_history.lua`
---@brief ]]
---@config { field_heading = "Configuration Options", space_prefix = 2 }
---@tag sg.setup
---@class sg.config
---@field enable_cody boolean?: Enable/disable cody integration
---@field accept_tos boolean?: Accept the TOS without being prompted
---@field download_binaries boolean?: Default true, download latest release from Github
---@field node_executable string?: path to node executable
---@field cody_agent string?: path to the cody-agent js bundle
---@field on_attach function?: function to run when attaching to sg://<file> buffers
---@type sg.config
local config = {
enable_cody = true,
download_binaries = true,
node_executable = "node",
cody_agent = vim.api.nvim_get_runtime_file("dist/cody-agent.js", false)[1],
get_nvim_agent = function()
return require("sg.private.find_artifact").find_rust_bin "sg-nvim-agent"
end,
on_attach = function(_, bufnr)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = bufnr })
vim.keymap.set("n", "gr", vim.lsp.buf.references, { buffer = bufnr })
vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = bufnr })
end,
testing = (vim.env.SG_NVIM_TESTING or "") == "true",
}
return config