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',

View File

@@ -4,7 +4,7 @@ return {
event = 'VimEnter',
version = '1.*',
dependencies = {
'L3MON4D3/LuaSnip',
-- 'L3MON4D3/LuaSnip',
'folke/lazydev.nvim',
},
--- @module 'blink.cmp'
@@ -61,7 +61,7 @@ return {
},
},
snippets = { preset = 'luasnip' },
-- snippets = { preset = 'luasnip' },
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
-- which automatically downloads a prebuilt binary when enabled.

View File

@@ -17,6 +17,10 @@ return {
require('luasnip.loaders.from_lua').load {
paths = { snippets_dir },
}
ls.setup {
update_events = 'TextChanged,TextChangedI',
enable_autosnippets = true,
}
end,
opts = {},
}