Skip to content

Instantly share code, notes, and snippets.

@antislava
Last active January 25, 2023 18:16
Show Gist options
  • Save antislava/d676e39cdc96f286e26f973ac21fb98f to your computer and use it in GitHub Desktop.
Save antislava/d676e39cdc96f286e26f973ac21fb98f to your computer and use it in GitHub Desktop.
Adding custom vim plugin with Nix Home Manager example
{ pkgs, ... }:
rec {
nixpkgs = {
overlays = [
(self: super:
let
vim-better-whitespace = super.vimUtils.buildVimPlugin {
name = "vim-better-whitespace";
src = pkgs.fetchFromGitHub {
owner = "ntpeters";
repo = "vim-better-whitespace";
rev = "984c8da518799a6bfb8214e1acdcfd10f5f1eed7";
sha256 = "10l01a8xaivz6n01x6hzfx7gd0igd0wcf9ril0sllqzbq7yx2bbk";
};
};
in {
vimPlugins =
super.vimPlugins // { inherit vim-better-whitespace; };
}
)
];
};
programs.home-manager = {
enable = true;
path = https://github.com/rycee/home-manager/archive/master.tar.gz;
};
programs.vim = {
enable = true;
extraConfig = builtins.readFile vim/vimrc.vim;
settings = { number = true; };
plugins = [ # Defined here: pkgs/misc/vim-plugins/default.nix
# Standard plugins
"nerdtree"
"vim-airline"
# New plugins
"vim-better-whitespace"
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment