diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 1fd5da45..8154f192 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -20,6 +20,12 @@ name = "Daniel Laing"; keys = [ { fingerprint = "0821 8B96 DC73 85E5 BB7C A535 D264 3BD2 13BC 0FA8"; } ]; }; + elythh = { + email = "gwen@omg.lol"; + github = "elythh"; + githubId = 50964650; + name = "gwen"; + }; GGORG = { email = "GGORG0@protonmail.com"; matrix = "@ggorg:matrix.org"; diff --git a/plugins/default.nix b/plugins/default.nix index f45da1f1..55fa2d2b 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -159,6 +159,7 @@ ./utils/cloak.nix ./utils/codesnap.nix ./utils/comment.nix + ./utils/comment-box.nix ./utils/commentary.nix ./utils/competitest.nix ./utils/conjure.nix diff --git a/plugins/utils/comment-box.nix b/plugins/utils/comment-box.nix new file mode 100644 index 00000000..bfa6c27f --- /dev/null +++ b/plugins/utils/comment-box.nix @@ -0,0 +1,139 @@ +{ + lib, + config, + pkgs, + ... +}: +let + inherit (lib.nixvim) defaultNullOpts; +in +lib.nixvim.neovim-plugin.mkNeovimPlugin config { + name = "comment-box"; + originalName = "comment-box.nvim"; + defaultPackage = pkgs.vimPlugins.comment-box-nvim; + description = '' + Clarify and beautify your comments and plain text files using boxes and lines. + ''; + + maintainers = [ lib.maintainers.elythh ]; + + settingsOptions = { + comment_style = + defaultNullOpts.mkEnum + [ + "line" + "block" + "auto" + ] + "line" + '' + Select the type of comments. + ''; + + doc_width = defaultNullOpts.mkInt 80 '' + Width of the document. + ''; + box_width = defaultNullOpts.mkInt 60 '' + Width of the boxes. + ''; + + borders = { + top = defaultNullOpts.mkStr "─" '' + Symbol used to draw the top border of a box. + ''; + + bottom = defaultNullOpts.mkStr "─" '' + Symbol used to draw the bottom border of a box. + ''; + + left = defaultNullOpts.mkStr "│" '' + Symbol used to draw the left border of a box. + ''; + + right = defaultNullOpts.mkStr "│" '' + Symbol used to draw the right border of a box. + ''; + + top_left = defaultNullOpts.mkStr "╭" '' + Symbol used to draw the top left corner of a box. + ''; + + top_right = defaultNullOpts.mkStr "╮" '' + Symbol used to draw the top right corner of a box. + ''; + + bottom_left = defaultNullOpts.mkStr "╰" '' + Symbol used to draw the bottom left corner of a box. + ''; + + bottom_right = defaultNullOpts.mkStr "╯" '' + Symbol used to draw the bottom right corner of a box. + ''; + + }; + + line_width = defaultNullOpts.mkInt 70 '' + Width of the lines. + ''; + + lines = { + line = defaultNullOpts.mkStr "─" '' + Symbol used to draw a line. + ''; + + line_start = defaultNullOpts.mkStr "─" '' + Symbol used to draw the start of a line. + ''; + + line_end = defaultNullOpts.mkStr "─" '' + Symbol used to draw the end of a line. + ''; + + title_left = defaultNullOpts.mkStr "─" '' + Symbol used to draw the left border of the title. + ''; + + title_right = defaultNullOpts.mkStr "─" '' + Symbol used to draw the right border of the title. + ''; + + outer_blank_lines_above = defaultNullOpts.mkBool false '' + Insert a blank line above the box. + ''; + + outer_blank_lines_below = defaultNullOpts.mkBool false '' + Insert a blank line below the box. + ''; + + inner_blank_lines = defaultNullOpts.mkBool false '' + Insert a blank line above and below the text. + ''; + + line_blank_line_above = defaultNullOpts.mkBool false '' + Insert a blank line above the line. + ''; + + line_blank_line_below = defaultNullOpts.mkBool false '' + Insert a blank line below the line. + ''; + }; + }; + + settingsExample = { + comment_style = "block"; + doc_width = 100; + box_width = 120; + borders = { + top_left = "X"; + top_right = "X"; + bottom_left = "X"; + bottom_right = "X"; + }; + line_width = 40; + lines = { + line = "*"; + }; + outer_blank_lines_below = true; + inner_blank_lines = true; + }; +} diff --git a/tests/test-sources/plugins/utils/comment-box.nix b/tests/test-sources/plugins/utils/comment-box.nix new file mode 100644 index 00000000..fb35d919 --- /dev/null +++ b/tests/test-sources/plugins/utils/comment-box.nix @@ -0,0 +1,40 @@ +_: { + empty = { + plugins.comment-box.enable = true; + }; + + defaults = { + plugins.comment-box = { + enable = true; + + settings = { + comment_style = "line"; + doc_width = 80; + box_width = 60; + borders = { + top = "─"; + bottom = "─"; + left = "│"; + right = "│"; + top_left = "╭"; + top_right = "╮"; + bottom_left = "╰"; + bottom_right = "╯"; + }; + line_width = 70; + lines = { + line = "─"; + line_start = "─"; + line_end = "─"; + title_left = "─"; + title_right = "─"; + }; + outer_blank_lines_above = false; + outer_blank_lines_below = false; + inner_blank_lines = false; + line_blank_line_above = false; + line_blank_line_below = false; + }; + }; + }; +}