mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +00:00
feat: add comment.nvim
and deprecate kommentary
This commit is contained in:
parent
963ec7ca1e
commit
79587828f4
8 changed files with 84 additions and 0 deletions
24
modules/comments/comment-nvim.nix
Normal file
24
modules/comments/comment-nvim.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.comments.comment-nvim;
|
||||
in {
|
||||
options.vim.comments.comment-nvim = {
|
||||
enable = mkEnableOption "comment-nvim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"comment-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.comment-nvim = nvim.dag.entryAnywhere ''
|
||||
require('Comment').setup()
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/comments/default.nix
Normal file
6
modules/comments/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./comment-nvim.nix
|
||||
./kommentary.nix
|
||||
];
|
||||
}
|
24
modules/comments/kommentary.nix
Normal file
24
modules/comments/kommentary.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.comments.kommentary;
|
||||
in {
|
||||
options.vim.comments.kommentary = {
|
||||
enable = mkEnableOption "kommentary";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"kommentary"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.kommentary = nvim.dag.entryAnywhere ''
|
||||
require('kommentary.config').use_extended_mappings()
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -29,6 +29,7 @@
|
|||
./ui
|
||||
./assistant
|
||||
./session
|
||||
./comments
|
||||
];
|
||||
|
||||
pkgsModule = {config, ...}: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue