summary refs log tree commit diff
path: root/modules/vim.nix
blob: 4fe62fe0a98adcce6671c65137c8fed9abb1e175 (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
34
35
36
37
38
39
40
41
{ pkgs, ... }:

let
  configs = [
    ../configs/.vimrc
    ../configs/plugins.vimrc
  ];

  customRC = with builtins; foldl' (r: f: r + (readFile f)) "" configs;

  vim-configured =
    with pkgs;
    vim-full.customize {
      name = "vim"; # explicitly replace vim

      vimrcConfig = {
        inherit customRC;

        packages.collection = with vimPlugins; {
          start = [
            YouCompleteMe
            fzf-vim
            vim-easymotion
            vim-sleuth
            vim-better-whitespace
            vim-tmux-navigator
          ];

          opt = [ ];
        };
      };
    };

in
{
  programs.vim = {
    defaultEditor = true;

    package = vim-configured;
  };
}