zk-org / zk-nvim

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

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

Closed ldwgchen closed 1 year ago

ldwgchen commented 1 year 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.