home: vim: refactor linked directories

This is more DRY.
This commit is contained in:
Bruno BELANYI 2021-02-23 15:31:23 +00:00
parent f1e4a4d914
commit fdc150bea2
2 changed files with 15 additions and 23 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
programs.neovim = { programs.neovim = {
enable = true; enable = true;
@ -46,21 +46,18 @@
extraConfig = builtins.readFile ./init.vim; extraConfig = builtins.readFile ./init.vim;
}; };
xdg.configFile = { xdg.configFile =
"nvim/after" = { let
source = ./after; toSource = directory: { source = ./. + "/${directory}"; };
}; configureDirectory =
name: lib.nameValuePair "nvim/${name}" (toSource name);
"nvim/autoload" = { linkDirectories =
source = ./autoload; dirs: builtins.listToAttrs (map configureDirectory dirs);
}; in
linkDirectories [
"nvim/ftdetect" = { "after"
source = ./ftdetect; "autoload"
}; "ftdetect"
"plugin"
"nvim/plugin" = { ];
source = ./plugin;
};
};
} }

View file

@ -1,5 +0,0 @@
" Enable trailing whitespace high-lighting
let g:better_whitespace_enabled=1
" Strip trailing whitespace on file-save
let g:strip_whitespace_on_save=1