Open udmehrot opened 2 months ago
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,
}
Enabled copilot for Markdown and Yaml with following -
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])