summary refs log tree commit diff
path: root/modules/vim.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/vim.nix')
-rw-r--r--modules/vim.nix21
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/vim.nix b/modules/vim.nix
index ceceac5..1913197 100644
--- a/modules/vim.nix
+++ b/modules/vim.nix
@@ -1,4 +1,9 @@
-{ pkgs, auxiliaryPkgs, ... }:
+{
+  lib,
+  pkgs,
+  auxiliaryPkgs,
+  ...
+}:
 
 let
   configs = [
@@ -6,7 +11,19 @@ let
     ../configs/plugins.vimrc
   ];
 
-  customRC = with builtins; foldl' (r: f: r + (readFile f)) "" configs;
+  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;