mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/glow: init
This commit is contained in:
parent
1a644b8c2b
commit
0f76a8cdfc
3 changed files with 114 additions and 0 deletions
|
@ -68,6 +68,7 @@
|
||||||
./languages/ledger.nix
|
./languages/ledger.nix
|
||||||
./languages/lint.nix
|
./languages/lint.nix
|
||||||
./languages/ltex-extra.nix
|
./languages/ltex-extra.nix
|
||||||
|
./languages/markdown/glow.nix
|
||||||
./languages/markdown/markdown-preview.nix
|
./languages/markdown/markdown-preview.nix
|
||||||
./languages/markdown/preview.nix
|
./languages/markdown/preview.nix
|
||||||
./languages/nix.nix
|
./languages/nix.nix
|
||||||
|
|
87
plugins/languages/markdown/glow.nix
Normal file
87
plugins/languages/markdown/glow.nix
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
helpers,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
|
name = "glow";
|
||||||
|
originalName = "glow.nvim";
|
||||||
|
defaultPackage = pkgs.vimPlugins.glow-nvim;
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.getchoo ];
|
||||||
|
|
||||||
|
settingsOptions = {
|
||||||
|
glow_path = helpers.defaultNullOpts.mkStr (helpers.mkRaw "vim.fn.exepath('glow')") ''
|
||||||
|
Path to `glow` binary.
|
||||||
|
|
||||||
|
If null or `""`, `glow` in your `$PATH` with be used if available.
|
||||||
|
|
||||||
|
Using `glowPackage` is the recommended way to make `glow` available in your `$PATH`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
install_path = helpers.defaultNullOpts.mkStr "~/.local/bin" ''
|
||||||
|
Path for installing `glow` binary if one is not found at `glow_path` or in your `$PATH`.
|
||||||
|
|
||||||
|
Consider using `glowPackage` instead.
|
||||||
|
'';
|
||||||
|
|
||||||
|
border = helpers.defaultNullOpts.mkEnumFirstDefault [
|
||||||
|
"shadow"
|
||||||
|
"none"
|
||||||
|
"double"
|
||||||
|
"rounded"
|
||||||
|
"solid"
|
||||||
|
"single"
|
||||||
|
] "Style of the floating window's border.";
|
||||||
|
|
||||||
|
style = helpers.defaultNullOpts.mkEnum [
|
||||||
|
"dark"
|
||||||
|
"light"
|
||||||
|
] (helpers.mkRaw "vim.opt.background") "Glow style.";
|
||||||
|
|
||||||
|
pager = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Display output in a pager style.
|
||||||
|
'';
|
||||||
|
|
||||||
|
width = helpers.defaultNullOpts.mkInt 100 ''
|
||||||
|
Width of the floating window.
|
||||||
|
'';
|
||||||
|
|
||||||
|
height = helpers.defaultNullOpts.mkInt 100 ''
|
||||||
|
Height of the floating window.
|
||||||
|
'';
|
||||||
|
|
||||||
|
width_ratio = helpers.defaultNullOpts.mkNum 0.7 ''
|
||||||
|
Maximum width of the floating window relative to the window size.
|
||||||
|
'';
|
||||||
|
|
||||||
|
height_ratio = helpers.defaultNullOpts.mkNum 0.7 ''
|
||||||
|
Maximum height of the floating window relative to the window size.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
border = "shadow";
|
||||||
|
style = "dark";
|
||||||
|
pager = false;
|
||||||
|
width = 80;
|
||||||
|
height = 100;
|
||||||
|
width_ratio = 0.7;
|
||||||
|
height_ratio = 0.7;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = {
|
||||||
|
glowPackage = helpers.mkPackageOption {
|
||||||
|
description = ''
|
||||||
|
Which package to use for `glow` in your `$PATH`.
|
||||||
|
Set to `null` to disable its automatic installation.
|
||||||
|
'';
|
||||||
|
default = pkgs.glow;
|
||||||
|
defaultText = lib.literalExpression "pkgs.glow";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = cfg: { extraPackages = [ cfg.glowPackage ]; };
|
||||||
|
}
|
26
tests/test-sources/plugins/languages/markdown/glow.nix
Normal file
26
tests/test-sources/plugins/languages/markdown/glow.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.glow.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins.glow = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
glowPackage = pkgs.glow;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
glow_path.__raw = "vim.fn.exepath('glow')";
|
||||||
|
install_path = "~/.local/bin";
|
||||||
|
border = "shadow";
|
||||||
|
style = "dark";
|
||||||
|
pager = false;
|
||||||
|
width = 80;
|
||||||
|
height = 100;
|
||||||
|
width_ratio = 0.7;
|
||||||
|
height_ratio = 0.7;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue