This commit is contained in:
2025-12-08 00:52:01 +00:00
parent 256a5695ed
commit dc5d2e20ff
5 changed files with 355 additions and 82 deletions

View File

@@ -1,6 +1,6 @@
-- AI code completion
if (vim.fn.getenv('COPILOT_API_KEY') ~= vim.NIL) then
if vim.fn.getenv 'COPILOT_API_KEY' ~= vim.NIL then
return {
'zbirenbaum/copilot.lua',
event = 'InsertEnter',
@@ -10,7 +10,7 @@ if (vim.fn.getenv('COPILOT_API_KEY') ~= vim.NIL) then
enabled = true,
auto_trigger = true,
keymap = {
accept = '<Tab>',
accept = '<A-a>',
},
},
filetypes = {
@@ -48,8 +48,9 @@ return {
provider = 'openai_compatible',
request_timeout = 3,
throttle = 500, -- Increase to reduce costs and avoid rate limits
debounce = 300, -- Increase to reduce costs and avoid rate limits
debounce = 400, -- Increase to reduce costs and avoid rate limits
n_completions = 1,
before_cursor_filter_length = 10,
provider_options = {
openai_compatible = {
api_key = 'COMPLETION_OPENAI_API_KEY',