coq_nvim
coq_nvim copied to clipboard
How to install and configure coq using lazy plugin manager?
I use lazy plugin manager for installing plugins on my neovim. This is how I installed coq:
return {
{
"ms-jpq/coq_nvim",
branch = "coq",
},
{
"ms-jpq/coq.artifacts",
branch = "artifacts",
},
{
"ms-jpq/coq.thirdparty",
branch = "3p",
},
}
I want to configure coq so I don't have to enter COQnow
command each time, so I have used config
property of lazy plugin manager. The problem is none of suggested ways in conf. documentation or even this comment would help. This is how I use config method:
...
{
"ms-jpq/coq_nvim",
branch = "coq",
config = function()
local vim.g.coq_settings = { auto_start = true}
end
},
...
And I get .../.config/nvim/lua/plugins/completion.lua:6: unexpected symbol near '.'
.
I have also tried this way:
vim.g.coq_settings = { auto_start = true } -- no error, but does not work
What should I do?
Just use vim.cmd("COQnow")
Just use vim.cmd("COQnow")
This works, but I am looking for configuring coq like the way conf documentation has suggested.
Maybe that was the way coq opt to init isn't support by lazy ?
I have no idea. Just seeking a way to configure coq.
Have you tried to set the configuration using the init
method of lazy.nvim
. Check here: https://github.com/folke/lazy.nvim/blob/main/doc/lazy.nvim.txt#L140
{
"ms-jpq/coq_nvim",
branch = "coq",
init = function()
vim.g.coq_settings = { auto_start = true }
end
},
This is my config:
{
"ms-jpq/coq_nvim",
branch = "coq",
lazy = false,
build = ":COQdeps",
dependencies = {
{ "ms-jpq/coq.artifacts", branch = "artifacts" },
{ "ms-jpq/coq.thirdparty", branch = "3p" },
},
init = function()
vim.g.coq_settings = {
auto_start = "shut-up",
}
end,
config = function()
-- extra config here
end,
},
@dapicester Thanks for sharing your config, this was really helpful to me.
If I may suggest a small improvement : event = "InsertEnter"
instead of lazy = false
allows the plugin to lazy load only when you start typing