ms-jpq / coq_nvim

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Start coq on Neovim launch

Andy3153 opened this issue · comments

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.

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

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

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

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.

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

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