zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
503 stars 40 forks source link

attach current buffer once before creating autocmd for lazy loading #145

Closed ldwgchen closed 11 months ago

ldwgchen commented 12 months ago

Using Lazy for packaging management, if zk-nvim is configured to be lazy loaded at some point after the current buffer's filetype is set, the current buffer wouldn't be attached to the lsp server.

For example, if I configure zk-nvim this way:

{
  "mickael-menu/zk-nvim",
  cmd = "ZkInsertLink",
  config = function()
    require("zk").setup {
      picker = "telescope"
    }
  end
}

Therefore using the execution of :ZkInsertLink as a trigger for lazy loading of zk-nvim, the current buffer, should it be a markdown file of interest, is not attached. I'd need to manually attach it.