monkoose/neocodeium

could you please add an option to disable all filetypes except the few I enable in the filetypes table

gaven140 opened this issue · 1 comments

Problem

An option to disable for all filetypes except the ones I explicitly enable in the filetypes table.

Expected behavior

filetypes = {
  all = false,
  lua = true,
  python = true,
  ...
}


-- OR
filetypes_disable_all = true,
filetypes = {
  -- filetypes to enable
}

@gaven140
I have implemented possibility for enabled option to be a function.
So you can implement whatever logic you want to disable in specific buffer or another required situations (like for whole privacy required projects etc).

For your request it would be something like

local filetyps = { 'lua', 'python' }
neocodeium.setup({
   -- function accepts one argument `bufnr`
   enabled = function(bufnr)
      if vim.tbl_contains(filetypes, vim.api.nvim_get_option_value('filetype',  { buf = bufnr})) then
         return true
      end
      return false
   end
})

I had some RL issues, so it has taken that much time.