From 5c4be23141eb4829acf90f8cb5e0b6ec41acf486 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 12 Apr 2025 12:52:26 -0400 Subject: [PATCH] feat: adding all the services logic on database --- lua/cargdev/plugins/aicargdev.lua | 4 +-- lua/cargdev/plugins/copilot.lua | 45 +++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/lua/cargdev/plugins/aicargdev.lua b/lua/cargdev/plugins/aicargdev.lua index 0ddbb82..5cb22a8 100644 --- a/lua/cargdev/plugins/aicargdev.lua +++ b/lua/cargdev/plugins/aicargdev.lua @@ -9,9 +9,9 @@ return { vendors = { cargdev = { name = "cargdev", -- Optional - endpoint = "http://api.ai.cargdev.io/api/generate", + endpoint = "https://api-ai.cargdev.io/api/generate", api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below - model = "deepseek-r1:latest", + model = "deepseek-coder:6.7b", __inherited_from = "ollama", -- ensures compatibility max_tokens = 8192, }, diff --git a/lua/cargdev/plugins/copilot.lua b/lua/cargdev/plugins/copilot.lua index cebfe89..499360c 100644 --- a/lua/cargdev/plugins/copilot.lua +++ b/lua/cargdev/plugins/copilot.lua @@ -1,12 +1,41 @@ return { - "github/copilot.vim", - lazy = false, -- Force load on startup - enabled = false, + "zbirenbaum/copilot.lua", + lazy = false, -- Load at startup + enabled = true, config = function() - vim.g.copilot_no_tab_map = true -- Disable default Tab mapping - vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', { expr = true, silent = true }) - vim.api.nvim_set_keymap("i", "", "copilot#Next()", { expr = true, silent = true }) - vim.api.nvim_set_keymap("i", "", "copilot#Previous()", { expr = true, silent = true }) - vim.api.nvim_set_keymap("i", "", "copilot#Dismiss()", { expr = true, silent = true }) + require("copilot").setup({ + panel = { + enabled = true, + auto_refresh = false, + keymap = { + jump_prev = "[[", + jump_next = "]]", + accept = "", + refresh = "gr", + open = "", + }, + layout = { + position = "bottom", -- | top | left | right | horizontal | vertical + ratio = 0.4, + }, + }, + suggestion = { + enabled = true, + auto_trigger = true, + debounce = 75, + trigger_on_accept = true, + keymap = { + accept = "", -- Accept suggestion + next = "", -- Next suggestion + prev = "", -- Previous suggestion + dismiss = "", -- Dismiss suggestion + }, + }, + filetypes = { + markdown = true, + ["*"] = true, -- Enable for all filetypes + }, + copilot_node_command = "node", -- Ensure your system's Node.js is v20+ + }) end, }