summary refs log tree commit diff
path: root/pkgs/default.nix
blob: 07ca87c4c4a4b77de9205a545eb0c2d406ba35ff (plain)
1
2
3
4
5
6
7
{ pkgs, ... }:

{
  common = with pkgs; lib.recurseIntoAttrs (callPackage ./common.nix { });

  youcompleteme = pkgs.callPackage ./youcompleteme.nix { };
}
ighlight .sx { color: #87CEEB } /* Literal.String.Other */ .highlight .sr { color: #87CEEB } /* Literal.String.Regex */ .highlight .s1 { color: #87CEEB } /* Literal.String.Single */ .highlight .ss { color: #87CEEB } /* Literal.String.Symbol */ .highlight .bp { color: #DDD } /* Name.Builtin.Pseudo */ .highlight .fm { color: #FF0 } /* Name.Function.Magic */ .highlight .vc { color: #EEDD82 } /* Name.Variable.Class */ .highlight .vg { color: #EEDD82 } /* Name.Variable.Global */ .highlight .vi { color: #EEDD82 } /* Name.Variable.Instance */ .highlight .vm { color: #EEDD82 } /* Name.Variable.Magic */ .highlight .il { color: #F0F } /* Literal.Number.Integer.Long */
{
  lib,
  pkgs,
  auxiliaryPkgs,
  ...
}:

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

  configVars = {
    "@ycm_extra_conf@" = ../configs/.ycm_extra_conf.py;
  };

  processRCFile =
    f:
    with builtins;
    (replaceStrings
      (lib.attrNames configVars)
      (map toString (lib.attrValues configVars))
      (readFile f));

  customRC = builtins.foldl' (r: f: r + (processRCFile f)) "" configs;

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

      vimrcConfig = {
        inherit customRC;

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

          opt = [ ];
        };
      };
    };

in
{
  programs.vim = {
    enable = true;
    defaultEditor = true;

    package = vim-configured;
  };
}