1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 11:36:07 +01:00
nixvim/plugins/by-name/emmet/default.nix
saygo-png dfdc4aebfb plugins/emmet: use nestedLiteralLua
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-11-05 21:26:13 +00:00

77 lines
1.9 KiB
Nix

{
lib,
...
}:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrOption nestedLiteralLua;
in
lib.nixvim.plugins.mkVimPlugin {
name = "emmet";
package = "emmet-vim";
globalPrefix = "user_emmet_";
description = "Provides support for Emmet abbreviations and snippets.";
maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = {
mode = defaultNullOpts.mkStr "a" ''
Choose modes, in which Emmet mappings will be created.
Default value: 'a' - all modes.
- 'n' - normal mode.
- 'i' - insert mode.
- 'v' - visual mode.
Examples:
- create Emmet mappings only for normal mode: `n`
- create Emmet mappings for insert, normal and visual modes: `inv`
- create Emmet mappings for all modes: `a`
'';
leader_key = defaultNullOpts.mkStr "<C-y>" ''
Leading keys to run Emmet functions.
'';
settings = mkNullOrOption (with types; attrsOf anything) ''
Emmet settings.
Defaults: see https://github.com/mattn/emmet-vim/blob/master/autoload/emmet.vim
'';
};
settingsExample = {
mode = "inv";
leader = "<C-Z>";
settings = {
variables = {
lang = "ja";
};
html = {
default_attributes = {
option = {
value = nestedLiteralLua "nil";
};
textarea = {
id = nestedLiteralLua "nil";
name = nestedLiteralLua "nil";
cols = 10;
rows = 10;
};
};
snippets = {
"html:5" = ''
<!DOCTYPE html>
<html lang=\"$\{lang}\">
<head>
\t<meta charset=\"$\{charset}\">
\t<title></title>
\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
</head>
<body>\n\t$\{child}|\n</body>
</html>
'';
};
};
};
};
}