summary refs log tree commit diff
path: root/pkgs/applications/editors/vim
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/vim')
-rw-r--r--pkgs/applications/editors/vim/configurable.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index bf53b4972c17..511a48a0eed9 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -4,7 +4,7 @@ args@{pkgs, source ? "default", ...}: with args;
 
 
 let inherit (args.composableDerivation) composableDerivation edf;
-  nixosRuntimepath = pkgs.writeText "runtimepath.vim" ''
+  nixosRuntimepath = pkgs.writeText "nixos-vimrc" ''
     function! NixosPluginPath()
       let seen = {}
       for p in reverse(split($NIX_PROFILES))
@@ -19,6 +19,12 @@ let inherit (args.composableDerivation) composableDerivation edf;
     endfunction
 
     execute NixosPluginPath()
+
+    if filereadable("/etc/vimrc")
+      source /etc/vimrc
+    elseif filereadable("/etc/vim/vimrc")
+      source /etc/vim/vimrc
+    endif
   '';
 in
 composableDerivation {