summaryrefslogtreecommitdiff
path: root/home/neovim/default.nix
blob: 4d4985451a4dc3b7c0efbe430f7fb6f09e5f110c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This file contains the HM configuration options for Neovim.
{
  pkgs,
  lib,
  ...
}: {
  imports = [
    ./lsp.nix
    ./filetype.nix
    ./completion.nix
    ./plugins.nix
  ];

  programs.neovim = {
    enable = true;

    # Import my existing config. I've been working on this for years and when
    # my enthusiasm for Nix eventually dies off, I want to take it with me.
    extraConfig = builtins.readFile ./init.vim;

    # Typing `vi`, `vim`, or `vimdiff` will also run neovim.
    viAlias = true;
    vimAlias = true;
    vimdiffAlias = true;
  };

  # Set Neovim as the default editor.
  home.sessionVariables.EDITOR = "nvim";
  home.sessionVariables.VISUAL = "nvim";

  # Use neovim as man pager.
  home.sessionVariables.MANPAGER = "nvim +Man!";
}