Copilot stays disabled for yaml and markdown file types
Enabled copilot for Markdown and Yaml with following -
1 │ return {
2 │ "zbirenbaum/copilot.lua",
3 │ cmd = "Copilot",
4 │ event = "InsertEnter",
5 │ config = function()
6 │ require("copilot").setup({
7 │ suggestion = { enabled = false },
8 │ panel = { enabled = false },
9 │ filetypes = {
10 │ yaml = true,
11 │ markdown = true,
12 │ },
13 │ })
14 │ end,
15 │ }
Exit out of nvim and enter again.
Open a yaml file. Copilot is not loaded.
Open a JSON file and Copilot is loaded.
Switch to YAML file buffer and run :Copilot status. I get the following error - [Copilot] Disabled ('filetype' yaml rejected by internal_filetypes[yaml])
I tried to add ["*"] = true to filtypes in my plugins filetypes configuration to no avail.
Adding following to init.lua does not work either.
-- Enable copilot filetypes
vim.g.copilot_filetypes = {
"yaml",
"yml",
"markdown",
}
A point to note, I had installed gihub/copilot.vim before installing this plugin. I am wondering if there is lingering config from that plugin that is preventing me from overriding defaults.
Any help with be appreciated.
I tried the example config from the projects README and it kinda works.
Using only ["."] = true, does not work for markdown, but explicitly adding markdown = true, does.
BUT
It did not automatically start Copilot inside the markdown buffer (other buffers like make, C++, Python worked without any issue).
I had to run Copilot enable manually.
Hope this helps. Here is my config as reference:
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = {
enabled = true,
auto_trigger = true,
keymap = {
accept = "<M-y>",
accept_word = false,
accept_line = false,
next = "<M-l>",
prev = "<M-h>",
dismiss = "<C-]>",
},
},
filetypes = {
yaml = true,
markdown = true,
help = true,
gitcommit = true,
gitrebase = true,
hgcommit = true,
svn = true,
cvs = false,
["."] = true,
}
})
end,
}
Is the issue resolved? I tried to replicate it but it works fine for markdown files.