mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
docs/lazy-loading: add extra examples
This commit is contained in:
parent
a879adb208
commit
af4483c025
1 changed files with 35 additions and 0 deletions
|
@ -42,6 +42,8 @@ a trigger condition is met.
|
|||
You need to define the trigger conditions in which a plugin will be loaded. This
|
||||
is done through the `lazyLoad.settings` option.
|
||||
|
||||
Load on command:
|
||||
|
||||
```nix
|
||||
plugins = {
|
||||
grug-far = {
|
||||
|
@ -55,6 +57,8 @@ plugins = {
|
|||
};
|
||||
```
|
||||
|
||||
Load on file type:
|
||||
|
||||
```nix
|
||||
plugins = {
|
||||
glow = {
|
||||
|
@ -63,6 +67,8 @@ plugins = {
|
|||
};
|
||||
```
|
||||
|
||||
Different load conditions:
|
||||
|
||||
```nix
|
||||
plugins.toggleterm = {
|
||||
enable = true;
|
||||
|
@ -78,6 +84,35 @@ plugins.toggleterm = {
|
|||
};
|
||||
```
|
||||
|
||||
Load on keymap with dependency:
|
||||
|
||||
```nix
|
||||
plugins.dap-ui = {
|
||||
enable = true;
|
||||
|
||||
lazyLoad.settings = {
|
||||
# We need to access nvim-dap in the after function.
|
||||
before.__raw = ''
|
||||
function()
|
||||
require('lz.n').trigger_load('nvim-dap')
|
||||
end
|
||||
'';
|
||||
keys = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>du";
|
||||
__unkeyed-2.__raw = ''
|
||||
function()
|
||||
require('dap.ext.vscode').load_launchjs(nil, {})
|
||||
require("dapui").toggle()
|
||||
end
|
||||
'';
|
||||
desc = "Toggle Debugger UI";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### Colorschemes
|
||||
|
||||
Colorschemes do not require explicit settings configuration. In `lz-n`, we will
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue