Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install and configure coq using lazy plugin manager? #620

Open
thisisjab opened this issue Feb 16, 2024 · 7 comments
Open

How to install and configure coq using lazy plugin manager? #620

thisisjab opened this issue Feb 16, 2024 · 7 comments

Comments

@thisisjab
Copy link

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?

@jasinco
Copy link

jasinco commented Feb 18, 2024

Just use
vim.cmd("COQnow")

@thisisjab
Copy link
Author

Just use vim.cmd("COQnow")

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

@jasinco
Copy link

jasinco commented Feb 20, 2024

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

@thisisjab
Copy link
Author

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

@felixsch
Copy link

felixsch commented Feb 23, 2024

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

@dapicester
Copy link

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

@HalibutGitWiz
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants