mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/yaml-companion: init
This commit is contained in:
parent
764a9b8dda
commit
269f2245f4
2 changed files with 146 additions and 0 deletions
53
plugins/by-name/yaml-companion/default.nix
Normal file
53
plugins/by-name/yaml-companion/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
name = "yaml-companion";
|
||||||
|
packPathName = "yaml-companion.nvim";
|
||||||
|
package = "yaml-companion-nvim";
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
schemas = [
|
||||||
|
{
|
||||||
|
name = "Argo CD Application";
|
||||||
|
uri = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "SealedSecret";
|
||||||
|
uri = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/bitnami.com/sealedsecret_v1alpha1.json";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
lspconfig = {
|
||||||
|
settings = {
|
||||||
|
yaml = {
|
||||||
|
format.enable = false;
|
||||||
|
schemaStore = {
|
||||||
|
enable = false;
|
||||||
|
url = "";
|
||||||
|
};
|
||||||
|
schemas = lib.nixvim.nestedLiteralLua "require('schemastore').yaml.schemas()";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
callSetup = false;
|
||||||
|
extraConfig = cfg: {
|
||||||
|
warnings = lib.nixvim.mkWarnings "plugins.yaml-companion" [
|
||||||
|
{
|
||||||
|
when = !config.plugins.lsp.enable;
|
||||||
|
message = "This plugin requires the `plugins.lsp.servers.yamlls` module to be enabled.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
plugins = {
|
||||||
|
lsp.servers.yamlls.extraOptions = lib.nixvim.mkRaw "require('yaml-companion').setup(${lib.nixvim.toLuaObject cfg.settings})";
|
||||||
|
|
||||||
|
telescope.enabledExtensions = [ "yaml_schema" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins = {
|
||||||
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers.yamlls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
yaml-companion.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins = {
|
||||||
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers.yamlls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
yaml-companion = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
builtin_matchers = {
|
||||||
|
kubernetes.enabled = true;
|
||||||
|
cloud_init.enabled = true;
|
||||||
|
};
|
||||||
|
schemas = [ ];
|
||||||
|
lspconfig = {
|
||||||
|
flags = {
|
||||||
|
debounce_text_changes = 150;
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
redhat.telemetry.enabled = false;
|
||||||
|
yaml = {
|
||||||
|
validate = true;
|
||||||
|
format.enable = true;
|
||||||
|
hover = true;
|
||||||
|
schemaStore = {
|
||||||
|
enable = true;
|
||||||
|
url = "https://www.schemastore.org/api/json/catalog.json";
|
||||||
|
};
|
||||||
|
schemaDownload.enable = true;
|
||||||
|
schemas = [ ];
|
||||||
|
trace.server = "debug";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
extraPlugins = [ pkgs.vimPlugins.SchemaStore-nvim ];
|
||||||
|
plugins = {
|
||||||
|
lsp = {
|
||||||
|
enable = true;
|
||||||
|
servers.yamlls.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
yaml-companion = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
schemas = [
|
||||||
|
{
|
||||||
|
name = "Argo CD Application";
|
||||||
|
uri = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "SealedSecret";
|
||||||
|
uri = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/bitnami.com/sealedsecret_v1alpha1.json";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
lspconfig = {
|
||||||
|
settings = {
|
||||||
|
yaml = {
|
||||||
|
format.enable = false;
|
||||||
|
schemaStore = {
|
||||||
|
enable = false;
|
||||||
|
url = "";
|
||||||
|
};
|
||||||
|
schemas = lib.nixvim.mkRaw "require('schemastore').yaml.schemas()";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue