Enable neovim through home-manager
- We need to set the default editor to just "nvim" not a particular path, as
this allows us to override nvim in our home
- Add the mapleader bind to the start of init.vim
- As the leader is interpreted whenever we make a keybind, we must have it at
the start or it won't be respected for some of our keybinds (but will be for
others)
- Package the scrollbar plugin and install it
- Setup configs for stuff like treesitter, theme, COC, scrollbar etc.
- Add git capabilities to neovim
- Install fugitive, gitgutter and git-conflict, along with some other basic git
stuff
- Allow mouse control in neovim
diff --git a/modules/neovim.nix b/modules/neovim.nix
index 949fbd4..4812584 100644
--- a/modules/neovim.nix
+++ b/modules/neovim.nix
@@ -1,13 +1,37 @@
-{pkgs, ...}: {
+args @ {
+ pkgs,
+ lib,
+ home,
+ ...
+}: let
+ utils = import ../utils lib;
+in {
config = {
environment.variables = {
- EDITOR = "${pkgs.neovim}/bin/nvim";
+ EDITOR = "nvim";
};
environment.defaultPackages = [
pkgs.perl
pkgs.rsync
pkgs.strace
- pkgs.neovim # I'm installing vim here even though it isn't normally a default package, as I've removed nano
- ]; # The basic default packages, although without nano
+ pkgs.neovim
+ ]; # The basic default packages, although with nvim replacing nano
+ };
+
+ home = {
+ imports = lib.pipe ./neovim [
+ utils.dirsIn
+ utils.importAll
+ (map (f:
+ if builtins.typeOf f == "lambda"
+ then f args
+ else f))
+ ];
+ programs.neovim = {
+ enable = true;
+ viAlias = true;
+ vimAlias = true;
+ vimdiffAlias = true;
+ };
};
}