diff --git a/home/vim/default.nix b/home/vim/default.nix index e0f0cfc..164ac70 100644 --- a/home/vim/default.nix +++ b/home/vim/default.nix @@ -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" + ]; } diff --git a/home/vim/plugin/settings/betterwhitespace.vim b/home/vim/plugin/settings/betterwhitespace.vim deleted file mode 100644 index 71ac74c..0000000 --- a/home/vim/plugin/settings/betterwhitespace.vim +++ /dev/null @@ -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