dev: rebase on a less personalized neovim flake

This commit is contained in:
NotAShelf 2023-02-01 22:11:37 +03:00
commit 9c00808863
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
70 changed files with 4910 additions and 0 deletions

View file

@ -0,0 +1,14 @@
{
pkgs,
config,
lib,
...
}:
with lib; {
config = {
vim.markdown = {
enable = mkDefault false;
glow.enable = mkDefault false;
};
};
}

View file

@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
...
}: {
imports = [
./config.nix
./glow.nix
];
}

38
modules/markdown/glow.nix Normal file
View file

@ -0,0 +1,38 @@
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.markdown;
in {
options.vim.markdown = {
enable = mkEnableOption "markdown tools and plugins";
glow.enable = mkOption {
type = types.bool;
default = true;
description = "Enable markdown preview in neovim with glow";
};
};
config = mkIf (cfg.enable) {
vim.startPlugins = [
(
if cfg.glow.enable
then "glow-nvim"
else null
)
];
vim.globals = mkIf (cfg.glow.enable) {
"glow_binary_path" = "${pkgs.glow}/bin";
};
vim.configRC.glow = mkIf (cfg.glow.enable) (nvim.dag.entryAnywhere ''
autocmd FileType markdown noremap <leader>p :Glow<CR>
'');
};
}