-
Notifications
You must be signed in to change notification settings - Fork 0
/
copilot.lua
58 lines (56 loc) · 1.31 KB
/
copilot.lua
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
48
49
50
51
52
53
54
55
56
57
58
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
event = "InsertEnter",
opts = {
filetypes = { markdown = true },
panel = { enabled = false },
suggestion = { enabled = false },
},
keys = {
{
"<leader>ta",
function()
if require("copilot.client").is_disabled() then
require("copilot.command").enable()
else
require("copilot.command").disable()
end
end,
desc = "ai (copilot)",
},
},
config = function(_, opts)
require("copilot").setup(opts)
local component = require("util.copilot")
do
local ok, lualine = pcall(require, "lualine")
if not ok then
return
end
local lualine_cfg = lualine.get_config()
table.insert(lualine_cfg.sections.lualine_x, 1, component)
lualine.setup(lualine_cfg)
end
end,
},
{
"saghen/blink.cmp",
dependencies = { "giuxtaposition/blink-cmp-copilot" },
opts = {
sources = {
default = { "copilot" },
providers = {
copilot = {
name = "copilot",
module = "blink-cmp-copilot",
score_offset = 70,
async = true,
},
},
},
},
},
}