-
-
Notifications
You must be signed in to change notification settings - Fork 203
/
trim.nix
68 lines (56 loc) · 1.67 KB
/
trim.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
lib,
helpers,
config,
pkgs,
...
}:
with lib;
helpers.neovim-plugin.mkNeovimPlugin config {
name = "trim";
originalName = "trim.nvim";
defaultPackage = pkgs.vimPlugins.trim-nvim;
maintainers = [ maintainers.GaetanLepage ];
settingsOptions = {
ft_blocklist = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Filetypes to exclude.
'';
patterns = mkOption {
type = with helpers.nixvimTypes; listOf strLua;
apply = map helpers.mkRaw;
default = [ ];
example = [ "[[%s/\(\n\n\)\n\+/\1/]]" ];
description = ''
Extra patterns to use for removing white spaces.
Plugin default: `[]`
'';
};
trim_on_write = helpers.defaultNullOpts.mkBool true ''
Whether to automatically trim on write.
'';
trim_trailing = helpers.defaultNullOpts.mkBool true ''
Whether to trim trailing whitespaces.
'';
trim_last_line = helpers.defaultNullOpts.mkBool true ''
Whether to trim trailing blank lines at the end of the file.
'';
trim_first_line = helpers.defaultNullOpts.mkBool true ''
Whether to trim blank lines at the beginning of the file.
'';
highlight = helpers.defaultNullOpts.mkBool false ''
Whether to highlight trailing whitespaces.
'';
highlight_bg = helpers.defaultNullOpts.mkStr "#ff0000" ''
Which color to use for coloring whitespaces.
'';
highlight_ctermbg = helpers.defaultNullOpts.mkStr "red" ''
Which color to use for coloring whitespaces (cterm).
'';
};
settingsExample = {
ft_blocklist = [ "markdown" ];
patterns = [ "[[%s/\(\n\n\)\n\+/\1/]]" ];
trim_on_write = false;
highlight = true;
};
}