mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
dev: rebase on a less personalized neovim flake
This commit is contained in:
commit
9c00808863
70 changed files with 4910 additions and 0 deletions
14
modules/markdown/config.nix
Normal file
14
modules/markdown/config.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
config = {
|
||||
vim.markdown = {
|
||||
enable = mkDefault false;
|
||||
glow.enable = mkDefault false;
|
||||
};
|
||||
};
|
||||
}
|
11
modules/markdown/default.nix
Normal file
11
modules/markdown/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./glow.nix
|
||||
];
|
||||
}
|
38
modules/markdown/glow.nix
Normal file
38
modules/markdown/glow.nix
Normal 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>
|
||||
'');
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue