Skip to content

Commit

Permalink
docs(README.md) clarify lazy load in lazy.nvim snippet (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangkhoipro authored Feb 15, 2024
1 parent 0d723fd commit 0986d72
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ You can install it through your favorite plugin manager:
{
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
lazy = false, -- specify lazy = false because some lazy.nvim distributions set lazy = true by default
-- tag = "*",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
Expand All @@ -273,6 +274,34 @@ You can install it through your favorite plugin manager:
})
```

If you want to lazy load the plugin and split it into a separate file, here is the snippet. (be careful, you'll not get command completion the first time)
```lua
return {
"nvim-neorg/neorg",
dependencies = { "nvim-lua/plenary.nvim" },
build = ":Neorg sync-parsers",
-- tag = "*",
lazy = true, -- enable lazy load
ft = "norg", -- lazy load on file type
cmd = "Neorg", -- lazy load on command
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/notes",
},
},
},
},
}
end,
}
```

</details>

### Treesitter
Expand Down

0 comments on commit 0986d72

Please sign in to comment.