nix-community.nixvim/plugins/by-name/emmet/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2 KiB
Nix
Raw Normal View History

{
lib,
...
}:
2025-01-22 07:57:18 +01:00
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in
lib.nixvim.plugins.mkVimPlugin {
name = "emmet";
packPathName = "emmet-vim";
package = "emmet-vim";
globalPrefix = "user_emmet_";
2025-01-22 07:57:18 +01:00
maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-03-01: remove 2024-05-01
deprecateExtraConfig = true;
optionsRenamedToSettings = [
"mode"
{
old = "leader";
new = "leader_key";
}
];
settingsOptions = {
2025-01-22 07:57:18 +01:00
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`
'';
2025-01-22 07:57:18 +01:00
leader_key = defaultNullOpts.mkStr "<C-y>" ''
Leading keys to run Emmet functions.
'';
2025-01-22 07:57:18 +01:00
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 = null;
};
textarea = {
id = null;
name = null;
cols = 10;
rows = 10;
};
};
2024-05-05 19:39:35 +02:00
snippets = {
"html:5" = ''
<!DOCTYPE html>
<html lang=\"$\{lang}\">
2024-05-05 19:39:35 +02:00
<head>
\t<meta charset=\"$\{charset}\">
\t<title></title>
\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
2024-05-05 19:39:35 +02:00
</head>
<body>\n\t$\{child}|\n</body>
2024-05-05 19:39:35 +02:00
</html>
'';
};
};
};
2024-05-05 19:39:35 +02:00
};
}