mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 13:19:48 +01: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
|
@ -159,6 +159,11 @@ inputs: let
|
||||||
vim.gestures = {
|
vim.gestures = {
|
||||||
gesture-nvim.enable = false;
|
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 {
|
in {
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -208,6 +208,22 @@
|
||||||
"type": "github"
|
"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": {
|
"copilot-lua": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1045,6 +1061,7 @@
|
||||||
"cmp-vsnip": "cmp-vsnip",
|
"cmp-vsnip": "cmp-vsnip",
|
||||||
"codewindow-nvim": "codewindow-nvim",
|
"codewindow-nvim": "codewindow-nvim",
|
||||||
"colorizer": "colorizer",
|
"colorizer": "colorizer",
|
||||||
|
"comment-nvim": "comment-nvim",
|
||||||
"copilot-lua": "copilot-lua",
|
"copilot-lua": "copilot-lua",
|
||||||
"crates-nvim": "crates-nvim",
|
"crates-nvim": "crates-nvim",
|
||||||
"dashboard-nvim": "dashboard-nvim",
|
"dashboard-nvim": "dashboard-nvim",
|
||||||
|
|
|
@ -201,6 +201,11 @@
|
||||||
url = "github:b3nj5m1n/kommentary";
|
url = "github:b3nj5m1n/kommentary";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
comment-nvim = {
|
||||||
|
url = "github:numToStr/Comment.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
todo-comments = {
|
todo-comments = {
|
||||||
url = "github:folke/todo-comments.nvim";
|
url = "github:folke/todo-comments.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -66,6 +66,8 @@ with lib; let
|
||||||
"tabnine-nvim"
|
"tabnine-nvim"
|
||||||
"nvim-session-manager"
|
"nvim-session-manager"
|
||||||
"gesture-nvim"
|
"gesture-nvim"
|
||||||
|
"comment-nvim"
|
||||||
|
"kommentary"
|
||||||
];
|
];
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package));
|
pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package));
|
||||||
|
|
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
|
./ui
|
||||||
./assistant
|
./assistant
|
||||||
./session
|
./session
|
||||||
|
./comments
|
||||||
];
|
];
|
||||||
|
|
||||||
pkgsModule = {config, ...}: {
|
pkgsModule = {config, ...}: {
|
||||||
|
|
Loading…
Reference in a new issue