~kaction/config

ref: 62166a2b2bdd71798975848a039fc358998d73d2 config/nixpkgs/overlays.d/config.d/vim/default.nix -rw-r--r-- 1.7 KiB
62166a2b — Dmitry Bogatov vim: enable plugin for Adga language 7 months ago
                                                                                
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ buildEnv, makeWrapper, vim, vimPlugins, vimUtils, fetchFromGitHub }:
let
  vim-nginx = vimUtils.buildVimPluginFrom2Nix {
    pname = "vim-nginx";
    version = "2020.01.04";
    src = fetchFromGitHub {
      owner = "chr4";
      repo = "nginx.vim";
      rev = "0b67dd4db92207fb3295a49832d60413b5658065";
      sha256 = "11vz5l99qh08fz6gxsk7swam38g5iw3k889gs25b8009lf5cx96r";
    };
  };
  vim-pgsql = vimUtils.buildVimPluginFrom2Nix {
    pname = "vim-pgsql";
    version = "2020.02.29";
    src = fetchFromGitHub {
      owner = "lifepillar";
      repo = "pgsql.vim";
      rev = "38b14b2ec7129cceb87519c17e283419d84adc3e";
      sha256 = "0krmwmzkvld3sbzkvxds578i80b8f8j0sy803zwgnpdx3ak5p9cl";
    };
  };
  vim-gemini = vimUtils.buildVimPluginFrom2Nix {
    pname = "vim-gemini";
    version = "2020.06.08";
    src = builtins.fetchGit {
      url = "https://tildegit.org/sloum/gemini-vim-syntax";
      rev = "5c206be6d5635500dd2276681050a40ddb0ba5e3";
    };
  };
in buildEnv {
  inherit (vim) name;
  ignoreCollisions = true;
  paths = let
    plugins = with vimPlugins; [
      vim-nix
      vim-pgsql
      dhall-vim
      agda-vim
      vim-nginx
      vim-gemini
      purescript-vim
      vim-snipmate
      vim-snippets
      vim-addon-mw-utils  # hidden dependency of vim-snipmate
      tlib
    ];
  in [ ./vim vim ] ++ plugins;
  meta = { priority = 3; };
  buildInputs = [ makeWrapper ];
  postBuild = ''
    for path in $out/share/vim-plugins/* ; do
        echo "set rtp+=$path" >> $out/share/vim/vim82/vimrc.prefix
    done
    cat $out/share/vim/vim82/vimrc{.prefix,} > $out/share/vim/vim82/vimrc.new
    mv $out/share/vim/vim82/vimrc{.new,}
    wrapProgram $out/bin/vim --set VIM $out/share/vim/vim82
    rm $out/bin/.keepit
  '';
}