home: vim: refactor linked directories
This is more DRY.
This commit is contained in:
parent
f1e4a4d914
commit
fdc150bea2
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
@ -46,21 +46,18 @@
|
|||
extraConfig = builtins.readFile ./init.vim;
|
||||
};
|
||||
|
||||
xdg.configFile = {
|
||||
"nvim/after" = {
|
||||
source = ./after;
|
||||
};
|
||||
|
||||
"nvim/autoload" = {
|
||||
source = ./autoload;
|
||||
};
|
||||
|
||||
"nvim/ftdetect" = {
|
||||
source = ./ftdetect;
|
||||
};
|
||||
|
||||
"nvim/plugin" = {
|
||||
source = ./plugin;
|
||||
};
|
||||
};
|
||||
xdg.configFile =
|
||||
let
|
||||
toSource = directory: { source = ./. + "/${directory}"; };
|
||||
configureDirectory =
|
||||
name: lib.nameValuePair "nvim/${name}" (toSource name);
|
||||
linkDirectories =
|
||||
dirs: builtins.listToAttrs (map configureDirectory dirs);
|
||||
in
|
||||
linkDirectories [
|
||||
"after"
|
||||
"autoload"
|
||||
"ftdetect"
|
||||
"plugin"
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue