Copilot.lua plugin settings

Hi, I’m trying to enable auto_trigger for copilot.lua. I have the following in my init.lua:

	use {
		"zbirenbaum/copilot.lua",
		event = "VimEnter",
		config = function()
			vim.defer_fn(function()
				require('copilot').setup {
					suggestion = { auto_trigger = true }
				}
			end, 100)
		end,
	}

However the setting seems to have no effect - auto triggering is not enabled when starting the editor. Auto triggering works fine when I manually toggle it on with:

:lua require('copilot.suggestion').toggle_auto_trigger()

What am I doing wrong?

After you open neovim, what’s the output of:

  • :lua print(vim.inspect(require('copilot.config'))) (expected to contain suggestion = { auto_trigger = true,)
  • :lua print(vim.b.copilot_suggestion_auto_trigger) (expected to be nil)

Also, did you run :PackerCompile after you updated your config?

1 Like

For some reason it started working by itself, I’m not entirely clear why. Maybe I wasn’t waiting long enough or something. Thanks anyway!