summaryrefslogtreecommitdiffstats
path: root/pkgs/vim/vim.nix
blob: b5f7d4e45bc9170194f57452b833dfb28268f2c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ lib, mylib, pkgs }:

pkgs.tv.vim.makePlugin (pkgs.writeTextFile (let
  name = "vim";
in {
  name = "vim-syntax-${name}-1.0.0";
  destination = "/syntax/${name}.vim";
  text = /* vim */ ''
    ${lib.concatMapStringsSep "\n" (s: /* vim */ ''
      syn keyword vimColor${s} ${s}
        \ containedin=ALLBUT,vimComment,vimLineComment
      hi vimColor${s} ctermfg=${s}
    '') (map (i: mylib.lpad 3 "0" (toString i)) (lib.range 0 255))}
  '';
}))