coq_nvim icon indicating copy to clipboard operation
coq_nvim copied to clipboard

How to install and configure coq using lazy plugin manager?

Open thisisjab opened this issue 1 year ago • 7 comments

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?

thisisjab avatar Feb 16 '24 21:02 thisisjab

Just use vim.cmd("COQnow")

jasinco avatar Feb 18 '24 03:02 jasinco

Just use vim.cmd("COQnow")

This works, but I am looking for configuring coq like the way conf documentation has suggested.

thisisjab avatar Feb 19 '24 09:02 thisisjab

Maybe that was the way coq opt to init isn't support by lazy ?

jasinco avatar Feb 20 '24 14:02 jasinco

I have no idea. Just seeking a way to configure coq.

thisisjab avatar Feb 20 '24 16:02 thisisjab

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
},

felixsch avatar Feb 23 '24 20:02 felixsch

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 avatar Feb 26 '24 04:02 dapicester

@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

HalibutGitWiz avatar May 01 '24 10:05 HalibutGitWiz