From b19c10c746c3e82529e4fee2d4e76002393ce195 Mon Sep 17 00:00:00 2001 From: rootiest Date: Tue, 16 Jul 2024 15:58:09 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A0=20User-selectable=20AI=20completio?= =?UTF-8?q?n!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Allows choosing the ai-completion tool you prefer - Options are: - codeium (default) - copilot - tabnine - none --- .aitool | 1 + lua/plugins/coding.lua | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .aitool diff --git a/.aitool b/.aitool new file mode 100644 index 0000000..564705f --- /dev/null +++ b/.aitool @@ -0,0 +1 @@ +codeium diff --git a/lua/plugins/coding.lua b/lua/plugins/coding.lua index 96cd2ad..0d8ebf1 100644 --- a/lua/plugins/coding.lua +++ b/lua/plugins/coding.lua @@ -3,8 +3,45 @@ -- ----------------------------------------------------------------------------- return { - { import = "lazyvim.plugins.extras.coding.codeium" }, - { import = "lazyvim.plugins.extras.coding.tabnine" }, + { + import = "lazyvim.plugins.extras.coding.codeium", + cond = function() + if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.aitool") == 1 then + if + vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1] + == "codeium" + then + return true + end + end + end, + }, + { + import = "lazyvim.plugins.extras.coding.copilot", + cond = function() + if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.aitool") == 1 then + if + vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1] + == "copilot" + then + return true + end + end + end, + }, + { + import = "lazyvim.plugins.extras.coding.tabnine", + cond = function() + if vim.fn.filereadable(vim.fn.stdpath("config") .. "/.aitool") == 1 then + if + vim.fn.readfile(vim.fn.stdpath("config") .. "/.aitool")[1] + == "tabnine" + then + return true + end + end + end, + }, { import = "lazyvim.plugins.extras.coding.yanky" }, { import = "lazyvim.plugins.extras.coding.mini-surround" }, { import = "lazyvim.plugins.extras.vscode" },