mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat(languages: move markdown and tidal to languages module)
This commit is contained in:
parent
ba463a3bdf
commit
fdca3b1e7e
17 changed files with 56 additions and 111 deletions
|
@ -8,6 +8,9 @@ with lib; let
|
|||
};
|
||||
in {
|
||||
imports = [
|
||||
./markdown
|
||||
./tidal
|
||||
|
||||
./clang.nix
|
||||
./go.nix
|
||||
./nix.nix
|
||||
|
|
24
modules/languages/markdown/config.nix
Normal file
24
modules/languages/markdown/config.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.languages.markdown;
|
||||
in {
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.glow.enable {
|
||||
vim.startPlugins = ["glow-nvim"];
|
||||
|
||||
vim.globals = {
|
||||
"glow_binary_path" = "${pkgs.glow}/bin";
|
||||
};
|
||||
|
||||
vim.configRC.glow = nvim.dag.entryAnywhere ''
|
||||
autocmd FileType markdown noremap <leader>p :Glow<CR>
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
6
modules/languages/markdown/default.nix
Normal file
6
modules/languages/markdown/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./markdown.nix
|
||||
];
|
||||
}
|
20
modules/languages/markdown/markdown.nix
Normal file
20
modules/languages/markdown/markdown.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.languages.markdown;
|
||||
in {
|
||||
options.vim.languages.markdown = {
|
||||
enable = mkEnableOption "Markdown language support";
|
||||
|
||||
glow.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable markdown preview in neovim with glow";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -8,7 +8,7 @@ with lib;
|
|||
with builtins; let
|
||||
cfg = config.vim.languages.nix;
|
||||
|
||||
useFormat = "on_attach = default_on_attatch";
|
||||
useFormat = "on_attach = default_on_attach";
|
||||
noFormat = "on_attach = attach_keymaps";
|
||||
|
||||
defaultServer = "nil";
|
||||
|
|
23
modules/languages/tidal/config.nix
Normal file
23
modules/languages/tidal/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.tidal;
|
||||
in {
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = [
|
||||
# From tidalcycles flake
|
||||
pkgs.vimPlugins.vim-tidal
|
||||
];
|
||||
|
||||
vim.globals = {
|
||||
"tidal_target" = "terminal";
|
||||
"tidal_flash_duration" = 150;
|
||||
"tidal_sc_enable" = cfg.openSC;
|
||||
};
|
||||
};
|
||||
}
|
6
modules/languages/tidal/default.nix
Normal file
6
modules/languages/tidal/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./tidal.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
23
modules/languages/tidal/tidal.nix
Normal file
23
modules/languages/tidal/tidal.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; {
|
||||
options.vim.tidal = {
|
||||
enable = mkEnableOption "Enable tidalcycles tools and plugins";
|
||||
|
||||
flash = mkOption {
|
||||
description = ''When sending a paragraph or a single line, vim-tidal will "flash" the selection for some milliseconds'';
|
||||
type = types.int;
|
||||
default = 150;
|
||||
};
|
||||
|
||||
openSC = mkOption {
|
||||
description = "Automatically run the supercollider CLI, sclang, alongside the Tidal GHCI terminal.";
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue