From 1829e321b5f56038b17479cfaecca74c28b112ae Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 18 Apr 2023 00:59:23 +0300 Subject: [PATCH] feat: yoink asciidoc from nmd --- lib/default.nix | 1 + lib/nmd.nix | 17 +++++++++++++++++ .../autopairs/nvim-autopairs/nvim-autopairs.nix | 2 +- modules/treesitter/treesitter.nix | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 lib/nmd.nix diff --git a/lib/default.nix b/lib/default.nix index e7b721b..37840c1 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -3,4 +3,5 @@ booleans = import ./booleans.nix {inherit lib;}; types = import ./types {inherit lib;}; languages = import ./languages.nix {inherit lib;}; + nmd = import ./nmd.nix; } diff --git a/lib/nmd.nix b/lib/nmd.nix new file mode 100644 index 0000000..fd945f1 --- /dev/null +++ b/lib/nmd.nix @@ -0,0 +1,17 @@ +# Copied from nmd master: https://gitlab.com/rycee/nmd/-/blob/master/default.nix?ref_type=heads +# Allows asciiDoc in options. It is easier to copy & keep updated then figure out how to pass the nmd input +# along to user modules +{ + # Indicates that the given text should be interpreted as AsciiDoc markup. + asciiDoc = text: { + _type = "asciiDoc"; + inherit text; + }; + + # Indicates that the given text should be interpreted as AsciiDoc markup and + # used in a literal context. + literalAsciiDoc = text: { + _type = "literalAsciiDoc"; + inherit text; + }; +} diff --git a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix index ecfda6f..1b3f8b7 100644 --- a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix +++ b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix @@ -23,7 +23,7 @@ with builtins; { map_cr = mkOption { type = types.bool; default = true; - description = "map on insert mode"; + description = nvim.nmd.asciiDoc ''map on insert mode''; }; map_complete = mkOption { diff --git a/modules/treesitter/treesitter.nix b/modules/treesitter/treesitter.nix index a1928a5..84a09ea 100644 --- a/modules/treesitter/treesitter.nix +++ b/modules/treesitter/treesitter.nix @@ -19,7 +19,7 @@ in { grammars = mkOption { type = with types; listOf package; default = []; - description = '' + description = nvim.nmd.asciiDoc '' List of treesitter grammars to install. For supported languages use the `vim.language..treesitter` option '';