From 2d6d322f8e8620f758c75104047e673da602582e Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 8 Feb 2025 20:17:50 -0500 Subject: [PATCH] add new condtionals for plugins that can be toggled/disabled --- lua/data/cond.lua | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lua/data/cond.lua b/lua/data/cond.lua index 5c91d2f..0da46c4 100644 --- a/lua/data/cond.lua +++ b/lua/data/cond.lua @@ -36,14 +36,17 @@ M.barsNlines = function() return false end +--- Avante conditional options M.avante = function() return func.check_global_var('useavante', true, false) end +--- ChatGPT conditional options M.chatgpt = function() return func.check_global_var('usechatgpt', true, false) end +--- GP conditional options M.gp = function() return func.check_global_var('usegpai', true, false) end @@ -79,6 +82,11 @@ M.bufferline = function() return false end +-- Code-Companion conditional options +M.codecompanion = function() + return func.check_global_var('usecodecomp', true, false) +end + --- CoPilot conditional options M.copilot = function() return vim.g.aitool == 'copilot' @@ -172,16 +180,29 @@ M.nekifoch = function() return func.is_kitty() end ---- Tabnine conditional options --- Codeium conditional options M.neocodeium = function() return func.check_global_var('aitool', 'neocodeium', 'neocodeium') end +M.neotree = function() + return func.check_global_var('useneotree', true, true) +end + +M.treesitter = function() + -- Only load for editable buffers + return vim.bo.buftype == '' and not vim.bo.readonly +end + +--- Tabnine conditional options M.tabnine = function() return func.check_global_var('aitool', 'tabnine', 'neocodeium') end +M.tiny_inline_diagnostic = function() + return func.check_global_var('usetinyinline', true, false) +end + M.todo = function() if func.check_global_var('usetodo', true, true) then if not func.is_neovide() then @@ -200,6 +221,12 @@ M.tmux = function() return func.is_tmux() end +--- Use Smart-splits conditional +M.use_splits = function() + -- return not func.is_ghostty() + return true +end + --- WakaTime conditional options M.wakatime = function() return vim.g.usewakatime @@ -210,4 +237,9 @@ M.wezterm = function() return func.is_wezterm() end +--- Yazi conditional options +M.yazi = function() + return func.check_global_var('useyazi', true, false) +end + return M