Skip to content

How to lazy load neotest #455

Discussion options

You must be logged in to vote

There are a few different ways to do that. I just add keys and assign my desired keymaps. This will resulting in not loading the plugin until I hit one of those keymaps.

{
  "nvim-neotest/neotest",
  dependencies = {
    "nvim-neotest/nvim-nio",
    "nvim-lua/plenary.nvim",
    "antoinemadec/FixCursorHold.nvim",
    "nvim-treesitter/nvim-treesitter",
  },
  config = function()
    require("neotest").setup({
      adapters = {
        require("rustaceanvim.neotest"),
      },
    })
  end,
+ keys = {...},
}

EDIT: I've defined my keys in a separate function: https://github.com/fredrikaverpil/dotfiles/blob/fc670a75c7bd5a0349052fba3fd0183bb86a0fe1/nvim-fredrik/lua/config/keymaps.lua#L444-L535

N…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rajneesh2k10
Comment options

@fredrikaverpil
Comment options

Answer selected by rajneesh2k10
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