Skip to content

Lazy load plugin after other plugin load #1041

Answered by abeldekat
Trildar asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Trildar,

Here are some examples I can think of:

local variation = 1

-- using neotree's filetype
if variation == 1 then
  return {
    {
      "antosha417/nvim-lsp-file-operations",
      ft = "neo-tree",
      dependencies = {
        "nvim-lua/plenary.nvim",
        "nvim-neo-tree/neo-tree.nvim",
      },
      config = true,
    },
  }
end

-- using LazyLoad
if variation == 2 then
  return {
    {
      "antosha417/nvim-lsp-file-operations",
      lazy = true,
      init = function()
        vim.api.nvim_create_autocmd("User", {
          pattern = "LazyLoad",
          callback = function(event)
            if event.data == "neo-tree.nvim" then
              require("lsp-file-oper…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Trildar
Comment options

@abeldekat
Comment options

@Trildar
Comment options

Answer selected by Trildar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants