about summary refs log tree commit diff
path: root/modules/common/vim/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/common/vim/default.nix')
-rw-r--r--modules/common/vim/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/common/vim/default.nix b/modules/common/vim/default.nix
new file mode 100644
index 0000000..0328e10
--- /dev/null
+++ b/modules/common/vim/default.nix
@@ -0,0 +1,50 @@
+{
+  config,
+  lib,
+  pkgs,
+  this,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.vim;
+in {
+  options.nixfiles.modules.vim.enable = mkEnableOption "Vim";
+
+  config = mkIf cfg.enable {
+    programs.vim.package = with pkgs;
+      (vim_configurable.override {
+        features = "normal";
+        cscopeSupport = false;
+        darwinSupport = pkgs.stdenv.isDarwin;
+        guiSupport = false;
+        luaSupport = false;
+        multibyteSupport = false;
+        netbeansSupport = false;
+        nlsSupport = false;
+        perlSupport = false;
+        pythonSupport = false;
+        rubySupport = false;
+        tclSupport = false;
+        ximSupport = false;
+      })
+      .customize {
+        name = "vim";
+        vimrcConfig = {
+          customRC = readFile ./rc.vim;
+          packages.myVimPackage.start = with vimPlugins; [
+            editorconfig-vim
+            vim-eunuch
+            vim-nix
+            vim-sleuth
+            vim-surround
+            vim-unimpaired
+          ];
+        };
+      };
+
+    environment = {
+      systemPackages = [config.programs.vim.package];
+      variables.EDITOR = mkOverride 100 "vim";
+    };
+  };
+}

Consider giving Nix/NixOS a try! <3