nvim disable copilot for dotfiles

plugins init:

...
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = { "InsertEnter", "BufEnter", "BufRead" },
config = function()
return require "configs.copilot"
end,
},
...

copilot setup:

require("copilot").setup {
panel = {
enabled = true,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>",
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_accept = true,
auto_trigger = true,
debounce = 75,
keymap = {
accept = "<Tab>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
yaml = false,
markdown = true,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
sh = function()
if string.match(vim.fs.basename(vim.api.nvim_buf_get_name(0)), "^%.env.*") then
-- disable for .env files
return false
end
return true
end,
},
copilot_node_command = "node", -- Node.js version must be > 16.x
server_opts_overrides = {},
}