mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
plugins/otter: add autoActivate
This commit is contained in:
parent
3211ce356b
commit
2f09998b65
1 changed files with 12 additions and 0 deletions
|
@ -83,6 +83,14 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraOptions = {
|
||||||
|
autoActivate = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "When enabled, activate otter automatically when lsp is attached.";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
extraConfig = cfg: {
|
extraConfig = cfg: {
|
||||||
warnings =
|
warnings =
|
||||||
lib.optional (cfg.enable && config.plugins.treesitter.settings.highlight.enable == null)
|
lib.optional (cfg.enable && config.plugins.treesitter.settings.highlight.enable == null)
|
||||||
|
@ -90,6 +98,10 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
||||||
NixVim(plugins.otter): you have enabled otter, but `plugins.treesitter.settings.highlight.enable` is not enabled.
|
NixVim(plugins.otter): you have enabled otter, but `plugins.treesitter.settings.highlight.enable` is not enabled.
|
||||||
Otter functionality might not work as expected without it and `plugins.treesitter.enable` enabled.
|
Otter functionality might not work as expected without it and `plugins.treesitter.enable` enabled.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
plugins.lsp.onAttach = lib.mkIf cfg.autoActivate ''
|
||||||
|
require('otter').activate()
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue