feat: add comment.nvim and deprecate kommentary

This commit is contained in:
NotAShelf 2023-02-16 23:32:46 +03:00
parent 963ec7ca1e
commit 79587828f4
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
8 changed files with 84 additions and 0 deletions

View file

@ -159,6 +159,11 @@ inputs: let
vim.gestures = {
gesture-nvim.enable = false;
};
vim.comments = {
comment-nvim.enable = true;
kommentary = builtins.trace "WARNING: kommentary is deprecated and will be removed in the future, use comment-nvim instead" {enable = true;};
};
};
};
in {

View file

@ -208,6 +208,22 @@
"type": "github"
}
},
"comment-nvim": {
"flake": false,
"locked": {
"lastModified": 1676528587,
"narHash": "sha256-SwN67ILsNJk0bNkcfQFiipAULaDxTfnCDHSC/+XKeLA=",
"owner": "numToStr",
"repo": "Comment.nvim",
"rev": "6821b3ae27a57f1f3cf8ed030e4a55d70d0c4e43",
"type": "github"
},
"original": {
"owner": "numToStr",
"repo": "Comment.nvim",
"type": "github"
}
},
"copilot-lua": {
"flake": false,
"locked": {
@ -1045,6 +1061,7 @@
"cmp-vsnip": "cmp-vsnip",
"codewindow-nvim": "codewindow-nvim",
"colorizer": "colorizer",
"comment-nvim": "comment-nvim",
"copilot-lua": "copilot-lua",
"crates-nvim": "crates-nvim",
"dashboard-nvim": "dashboard-nvim",

View file

@ -201,6 +201,11 @@
url = "github:b3nj5m1n/kommentary";
flake = false;
};
comment-nvim = {
url = "github:numToStr/Comment.nvim";
flake = false;
};
todo-comments = {
url = "github:folke/todo-comments.nvim";
flake = false;

View file

@ -66,6 +66,8 @@ with lib; let
"tabnine-nvim"
"nvim-session-manager"
"gesture-nvim"
"comment-nvim"
"kommentary"
];
# You can either use the name of the plugin or a package.
pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package));

View 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()
'';
};
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./comment-nvim.nix
./kommentary.nix
];
}

View 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()
'';
};
}

View file

@ -29,6 +29,7 @@
./ui
./assistant
./session
./comments
];
pkgsModule = {config, ...}: {