Skip to content

Commit

Permalink
feat(neovim): added new plugin: nvim-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Dec 30, 2023
1 parent fdc6952 commit 32531fc
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions modules/editors/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ in

programs.nixvim =
let
templateNvimPlugin = pkgs.callPackage ./plugins/template.nvim.nix { };
plugins = builtins.map (x: pkgs.callPackage (./plugins + "/${x}.nix") { }) [ "template.nvim" "nvim-comment" ];
pkgPlugins = (builtins.map (x: x.plugin) plugins);
luaConfigs = builtins.concatStringsSep "\n\n" (builtins.map (x: x.luaConfig) plugins);
in
{
enable = true;
enableMan = true;

extraPlugins = with pkgs.vimPlugins; [
templateNvimPlugin.plugin
vim-wakatime
vimsence
];
] ++ pkgPlugins;

extraConfigLua = ''
-- nvim-autopairs
require("nvim-autopairs").setup {}
require("nvim-autopairs").setup()
-- template.nvim
${templateNvimPlugin.luaConfig}
${luaConfigs}
'';

globals.mapleader = " ";
Expand Down
18 changes: 18 additions & 0 deletions modules/editors/plugins/nvim-comment.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ srcOnly, vimUtils, lib, fetchFromGitHub, ... }:
{
luaConfig = ''
require('nvim_comment').setup()
'';

plugin = vimUtils.buildVimPlugin {
pname = "nvim-comment";
version = "30-12-2023";
src = fetchFromGitHub {
owner = "terrortylor";
repo = "nvim-comment";
rev = "e9ac16ab056695cad6461173693069ec070d2b23";
sha256 = "sha256-O2jhrjXxKaWHMfm3YJ9+92Onm0niEHfUp5kOh2gETuc=";
};
meta.homepage = "https://github.com/terrortylor/nvim-comment";
};
}
17 changes: 17 additions & 0 deletions modules/editors/plugins/templates/vimPlugin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ vimUtils, lib, fetchFromGitHub, ... }: {
luaConfig = ''
require('{{_file_name_}').setup()
'';

plugin = vimUtils.buildVimPlugin {
pname = "{{_file_name_}}";
version = "{{_date_}}";
src = fetchFromGitHub {
owner = "";
repo = "{{_file_name_}}.nvim";
rev = "41a41541f6af19be5403c0a5bf371d8ccb86c9c4";
sha256 = lib.fakeSha256;
};
meta.homepage = "https://github.com/";
};
}

0 comments on commit 32531fc

Please sign in to comment.