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

Start coq on Neovim launch #630

Open
Andy3153 opened this issue Mar 31, 2024 · 6 comments
Open

Start coq on Neovim launch #630

Andy3153 opened this issue Mar 31, 2024 · 6 comments

Comments

@Andy3153
Copy link

What the title says. This plugin is absolutely awesome but the only problem it has, for me, is that you must run :COQnow to start it. And, if you want it to start on Neovim's launch, you need to place that somewhere in your configs. This breaks so many things on so many occasions, like back when I used Packer it would get into a loop where it couldn't run that command in my init.lua anymore after updates, and now that I am trying to switch to Lazy.nvim (because Packer is apparently abandoned) I cannot auto-start it at all.

Can you please tell me there's a better way to start coq on Neovim's launch and I just haven't stumbled upon it in the 2-3 years I've been using this plugin? Running a command in your config is just way, way too finicky and has given me countless issues which most of the time make me avoid updating my plugins or modifying my Neovim config at all.

@Al-Ghoul
Copy link

Al-Ghoul commented Apr 5, 2024

You need to set the following settings before you load "coq":
lua vim.g.coq_settings = { auto_start = true }

@Andy3153
Copy link
Author

Before? Oh god, that's purely awful. Why does it have to be before? I believe many people just set it in their respective config file made for coq, loaded by the package manager, like I did, which, of course, loads after coq does. Truly awful. It doesn't affect me anymore because while waiting for an answer I switched to cmp but please hande this differently

@Shougo
Copy link

Shougo commented Apr 10, 2024

It must be before lazy.nvim loading.
Because the auto start works when loading.

@isvicy
Copy link

isvicy commented Apr 13, 2024

if you are using lazy.nvim as your plugin manager, you can put this setting in init block of this plugin to make it autostart.

@Andy3153
Copy link
Author

I think the README should provide a sample quick install example. Seems easy enough, I can do that

@HicaroD
Copy link
Contributor

HicaroD commented May 30, 2024

lazy.nvim works a little bit different than packer.nvim.

You need to tell Lazy that the plugin needs to be loaded at the startup using lazy = false and define a function in the init attribute that will be executed at the startup.

{
  "neovim/nvim-lspconfig",
  lazy = false, -- IMPORTANT: Tell lazy.nvim to start this plugin on startup
  dependencies = {
    { "ms-jpq/coq_nvim", branch = "coq" },
    { "ms-jpq/coq.artifacts", branch = "artifacts" },
  },
  init = function() -- IMPORTANT: Function that will be executed on startup for configuring this plugin
    vim.g.coq_settings = {
      auto_start = true,
      -- If you don't want coq_nvim to notify you when it starts, use the line below instead
      -- auto_start = "shut-up",
    }
  end,
  config = function()
    -- Your LSP config here
  end,
}

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