about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2014-12-04 15:32:29 +0100
committerMarc Weber <marco-oweber@gmx.de>2014-12-04 15:32:38 +0100
commitabd016cea870c3b7bc1257dc093d90bc915c3f61 (patch)
treee37012928c6fbcc7804fbb595e2a94993b1d1660 /pkgs/misc
parent053d46f41561f69c10e1583f57655cfd860028ad (diff)
downloadnixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar.gz
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar.bz2
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar.lz
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar.xz
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.tar.zst
nixlib-abd016cea870c3b7bc1257dc093d90bc915c3f61.zip
Refactoring vim plugins again:
- sort automatcially generated vim derivations
- move the plugins to be derived by VAM into its own file: vim-plugin-names
- rename vimrc into vimUtils moving all common code into it
  so that it is possible to use it within ~/.nixpkgs/config.nix
- Moving all important documentation into vimUtils
- provide vimPlugins.pluginnames2Nix to provide a bin/vim-* command
  writing updated derivations into its buffer

VAM's repository's nix.vim got some improvements @ VAM repository, eg hg
fetchout out got fixed and shell failures are noticed now (Thanks to Arseniy
Seroka)
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/vim-plugins/default.nix1261
-rw-r--r--pkgs/misc/vim-plugins/vim-plugin-names55
-rw-r--r--pkgs/misc/vim-plugins/vim-utils.nix384
-rw-r--r--pkgs/misc/vim-plugins/vimrc.nix203
4 files changed, 979 insertions, 924 deletions
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index af75adf2976d..21d289b8f5ab 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -1,153 +1,24 @@
 # TODO check that no license information gets lost
-{ fetchurl, bash, stdenv, python, cmake, vim, perl, ruby, unzip, which, fetchgit, fetchzip, llvmPackages, zip }:
+{ fetchurl, bash, stdenv, python, cmake, vim, vimUtils, perl, ruby, unzip,
+  which, fetchgit, fetchhg, fetchzip, llvmPackages, zip, vim_configurable,
+  vimPlugins
+}:
 
-/*
-Typical plugin files:
-
-  plugin/P1.vim
-  autoload/P1.vim
-  ftplugin/xyz.vim
-  doc/plugin-documentation.txt (traditional documentation)
-  README(.md) (nowadays thanks to github)
-
-Traditionally plugins were installed into ~/.vim/* so it was your task to keep track
-of which files belong to what plugin. Now this problem is "fixed" by nix which
-assembles your profile for you.
-
-Vim offers the :h rtp setting which works for most plugins. Thus adding adding
-this to your .vimrc should make most plugins work:
-
-  set rtp+=~/.nix-profile/share/vim-plugins/youcompleteme
-  " or for p in ["youcompleteme"] | exec 'set rtp+=~/.nix-profile/share/vim-plugins/'.p | endfor
-
-Its what pathogen, vundle, vim-addon-manager (VAM) and others use.
-Learn about some differences by visiting http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html.
-
-If you want Nix to create a .vimrc for you have a look at vimrc in all-packages.nix.
-It also contains VAM code illustrating how to make VAM find plugins in arbitrary locations
-*/
-
-# provide a function creating tag files for vim help documentation (doc/*.txt)
-
-let rtpPath = "share/vim-plugins";
-
-    vimHelpTags = ''
-    vimHelpTags(){
-      if [ -d "$1/doc" ]; then
-        ${vim}/bin/vim -N -u NONE -i NONE -n -e -s -c "helptags $1/doc" +quit!
-      fi
-    }
-  '';
-
-  addRtp = path: derivation:
-    derivation // { rtp = "${derivation}/${path}"; };
-
-  buildVimPlugin = a@{
-    name,
-    namePrefix ? "vimplugin-",
-    src,
-    buildPhase ? "",
-    path ? (builtins.parseDrvName name).name,
-    ...
-  }:
-    addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
-      name = namePrefix + name;
-
-      inherit buildPhase;
-
-      installPhase = ''
-        target=$out/${rtpPath}/${path}
-        mkdir -p $out/${rtpPath}
-        cp -r . $target
-        ${vimHelpTags}
-        vimHelpTags $target
-      '';
-    }));
+let
 
+inherit (vimUtils.override {inherit vim;}) rtpPath addRtp buildVimPlugin
+  buildVimPluginFrom2Nix vimHelpTags;
 in
 
-# The attr names in this set should be equal to names used in the vim-pi project [1] so that
-# VAM's dependencies work. How to find the name?
-#  * http://vam.mawercer.de/ or VAM's
-#  * grep vim-pi
-#  * use VAM's completion or :AddonsInfo command
-#
-# How to create derivations? Experimental derivation creation is provided by VAM, example usage:
-# call nix#ExportPluginsForNix({'path_to_nixpkgs': '/etc/nixos/nixpkgs', 'names': ["vim-addon-manager", "vim-addon-nix"], 'cache_file': 'cache'})
-#
-# [1] https://bitbucket.org/vimcommunity/vim-pi
-/*
-    Some of the plugin definitions below are generated the following VimL command
-    provided by vim-addon-manager.
-
-    " Copy /tmp/tmp.vim file and run: :source /tmp/tmp.vim
-    call nix#ExportPluginsForNix({
-    \  'path_to_nixpkgs': '/etc/nixos/nixpkgs',
-    \  'cache_file': '/tmp/vim2nix-cache',
-    \  'names': [
-    \    "vim-addon-syntax-checker",
-    \    "vim-addon-other",
-    \    "vim-addon-local-vimrc",
-    \    "snipmate",
-    \    "vim-snippets",
-    \    "vim-addon-mru",
-    \    "vim-addon-commenting",
-    \    "vim-addon-sql",
-    \    "vim-addon-async",
-    \    "vim-addon-toggle-buffer",
-    \    "vim-addon-mw-utils",
-    \    "matchit.zip",
-    \    "vim-addon-xdebug",
-    \    "vim-addon-php-manual",
-    \    "sourcemap.vim",
-    \    "vim-iced-coffee-script",
-    \    "ctrlp",
-    \    "commentary",
-    \    "Colour_Sampler_Pack",
-    \    "Solarized",
-    \    "vim-coffee-script",
-    \    "vim-easy-align",
-    \    "Tagbar",
-    \    "Tabular",
-    \    "table-mode",
-    \    "Syntastic",
-    \    "vim-signature",
-    \    "surround",
-    \    "Supertab",
-    \    "rust",
-    \    "rainbow_parentheses",
-    \    "pathogen",
-    \    "quickfixstatus",
-    \    "The_NERD_Commenter",
-    \    "The_NERD_tree",
-    \    "vim-latex-live-preview",
-    \    "Hoogle",
-    \    "Gundo",
-    \    "vim-gitgutter",
-    \    "Gist",
-    \    "ghcmod",
-    \    "fugitive",
-    \    "extradite",
-    \    "vim-airline",
-    \    "VimOutliner",
-    \    "vim2hs",
-    \    "undotree",
-    \    "UltiSnips",
-    \    "wombat256",
-    \    "vundle",
-    \    "WebAPI",
-    \    "YankRing",
-    \    "vim-addon-manager",
-    \    "vim-addon-nix",
-    \    "YUNOcommit"
-    \ ],
-    \ })
-
-# TODO: think about how to add license information?
-*/
-
+# This attrs contains two sections:
+# The first contains plugins added manually, the second contains plugins
+# generated by call nix#ExportPluginsForNix.
+# Documentation & usage see vim-utils.nix.
+# attribute names should be the same as used by vim-pi to make dependency
+# resolution work
 rec {
-  inherit rtpPath;
+
+  ### section I: manually mantained plugins
 
   a = buildVimPlugin {
     name = "a-git-2010-11-06";
@@ -192,28 +63,6 @@ rec {
     };
   };
 
-  coffee-script = vim-coffee-script;
-
-  coffeeScript = coffee-script; # backwards compat, added 2014-10-18
-
-  colors-solarized = Solarized;
-
-  colorsamplerpack = Colour_Sampler_Pack;
-
-  Colour_Sampler_Pack = buildVimPlugin {
-    name = "Colour_Sampler_Pack";
-    src = fetchurl {
-      url = "http://www.vim.org/scripts/download_script.php?src_id=18915";
-      name = "ColorSamplerPack.zip";
-      sha256 = "1wsrb3vpqn9fncnalfpvc8r92wk1mcskm4shb3s2h9x5dyihf2rd";
-    };
-    buildInputs = [ unzip ];
-    dependencies = [];
-    meta = {
-       url = "http://www.vim.org/scripts/script.php?script_id=625";
-    };
-  };
-
   command-t = buildVimPlugin rec {
     version = "1.8";
     name = "command-t-${version}";
@@ -233,28 +82,6 @@ rec {
 
   command_T = command-t; # backwards compat, added 2014-10-18
 
-  commentary = buildVimPlugin {
-    name = "commentary";
-    src = fetchgit {
-      url = "git://github.com/tpope/vim-commentary";
-      rev = "401dbd8abee69defe66acf5e9ccc85e2746c27e2";
-      sha256 = "3deec79d6c40a6c91fa504423f38c9f6a9e3495804f1996e2420d0ad34fe2da8";
-    };
-    dependencies = [];
-  };
-
-  ctrlp = buildVimPlugin {
-    name = "ctrlp";
-    src = fetchgit {
-      url = "git://github.com/kien/ctrlp.vim";
-      rev = "b5d3fe66a58a13d2ff8b6391f4387608496a030f";
-      sha256 = "41f7884973770552395b96f8693da70999dc815462d4018c560d3ff6be462e76";
-    };
-    dependencies = [];
-  };
-
-  easy-align = vim-easy-align;
-
   easymotion = buildVimPlugin {
     name = "easymotion-git-2014-09-29";
     src = fetchgit {
@@ -284,51 +111,6 @@ rec {
     };
   };
 
-  extradite = buildVimPlugin {
-    name = "extradite";
-    src = fetchgit {
-      url = "git://github.com/int3/vim-extradite";
-      rev = "af4f3a51b6b654d655121b93c0cd9d8fe9a0c85d";
-      sha256 = "d1d29cfbc654134be383747f2cd6b14b7a87de75f997af6a041f14d7ef61ade6";
-    };
-    dependencies = [];
-  };
-
-  fugitive = buildVimPlugin {
-    name = "fugitive";
-    src = fetchgit {
-      url = "git://github.com/tpope/vim-fugitive";
-      rev = "0374322ba5d85ae44dd9dc44ef31ca015a59097e";
-      sha256 = "3bb09693726c4f9fc1695bc8b40c45d64a6a0f1d9a4243b4a79add841013ad6c";
-    };
-    dependencies = [];
-  };
-
-  ghc-mod-vim = ghcmod;
-
-  ghcmod = buildVimPlugin {
-    name = "ghcmod";
-    src = fetchgit {
-      url = "git://github.com/eagletmt/ghcmod-vim";
-      rev = "d5c6c7f3c85608b5b76dc3e7e001f60b86c32cb9";
-      sha256 = "ab56d470ea18da3fae021e22bba14460505e61a94f8bf707778dff5eec51cd6d";
-    };
-    dependencies = [];
-  };
-
-  Gist = buildVimPlugin {
-    name = "Gist";
-    src = fetchgit {
-      url = "git://github.com/mattn/gist-vim";
-      rev = "d609d93472db9cf45bd701bebe51adc356631547";
-      sha256 = "e5cabc03d5015c589a32f11c654ab9fbd1e91d26ba01f4b737685be81852c511";
-    };
-    buildInputs = [ zip ];
-    dependencies = [];
-  };
-
-  gist-vim = Gist;
-
   gitgutter = vim-gitgutter;
 
   golang = buildVimPlugin {
@@ -344,18 +126,6 @@ rec {
     };
   };
 
-  Gundo = buildVimPlugin {
-    name = "Gundo";
-    src = fetchgit {
-      url = "https://bitbucket.org/sjl/gundo.vim";
-      rev = "";
-      sha256 = "";
-    };
-    dependencies = [];
-  };
-
-  gundo = Gundo;
-
   hardtime = buildVimPlugin {
     name = "hardtime-git-2014-10-21";
     src = fetchgit {
@@ -424,18 +194,6 @@ rec {
     };
   };
 
-  Hoogle = buildVimPlugin {
-    name = "Hoogle";
-    src = fetchgit {
-      url = "git://github.com/Twinside/vim-hoogle";
-      rev = "81f28318b0d4174984c33df99db7752891c5c4e9";
-      sha256 = "0f96f3badb6218cac87d0f7027ff032ecc74f08ad3ada542898278ce11cbd5a0";
-    };
-    dependencies = [];
-  };
-
-  hoogle = Hoogle;
-
   idris-vim = buildVimPlugin {
     name = "idris-vim-git-2014-10-14";
     src = fetchgit {
@@ -475,8 +233,6 @@ rec {
     };
   };
 
-  latex-live-preview = vim-latex-live-preview;
-
   lushtags = buildVimPlugin {
     name = "lushtags-git-2013-12-27";
     src = fetchgit {
@@ -490,20 +246,6 @@ rec {
     };
   };
 
-  matchit.zip = buildVimPlugin {
-    name = "matchit.zip";
-    src = fetchurl {
-      url = "http://www.vim.org/scripts/download_script.php?src_id=8196";
-      name = "matchit.zip";
-      sha256 = "1bbm8j1bhb70kagwdimwy9vcvlrz9ax5bk2a7wrmn4cy87f9xj4l";
-    };
-    buildInputs = [ unzip ];
-    dependencies = [];
-    meta = {
-       url = "http://www.vim.org/scripts/script.php?script_id=39";
-    };
-  };
-
   neco-ghc = buildVimPlugin {
     name = "neco-ghc-git-2014-10-17";
     src = fetchgit {
@@ -560,28 +302,6 @@ rec {
 
   nerdcommenter = The_NERD_Commenter;
 
-  nerdtree = The_NERD_tree;
-
-  pathogen = buildVimPlugin {
-    name = "pathogen";
-    src = fetchgit {
-      url = "git://github.com/tpope/vim-pathogen";
-      rev = "91e6378908721d20514bbe5d18d292a0a15faf0c";
-      sha256 = "24c1897d6b58576b2189c90050a7f8ede72a51343c752e9d030e833dbe5cac6f";
-    };
-    dependencies = [];
-  };
-
-  quickfixstatus = buildVimPlugin {
-    name = "quickfixstatus";
-    src = fetchgit {
-      url = "git://github.com/dannyob/quickfixstatus";
-      rev = "fd3875b914fc51bbefefa8c4995588c088163053";
-      sha256 = "7b6831d5da1c23d95f3158c67e4376d32c2f62ab2e30d02d3f3e14dcfd867d9b";
-    };
-    dependencies = [];
-  };
-
   quickrun = buildVimPlugin {
     name = "quickrun-git-2014-10-08";
     src = fetchgit {
@@ -614,26 +334,6 @@ rec {
     };
   };
 
-  rainbow_parentheses = buildVimPlugin {
-    name = "rainbow_parentheses";
-    src = fetchgit {
-      url = "git://github.com/kien/rainbow_parentheses.vim";
-      rev = "eb8baa5428bde10ecc1cb14eed1d6e16f5f24695";
-      sha256 = "47975a426d06f41811882691d8a51f32bc72f590477ed52b298660486b2488e3";
-    };
-    dependencies = [];
-  };
-
-  rust = buildVimPlugin {
-    name = "rust";
-    src = fetchgit {
-      url = "git://github.com/wting/rust.vim";
-      rev = "0cf510adc5a83ad4c256f576fd36b38c74349d43";
-      sha256 = "839f4ea2e045fc41fa2292882576237dc36d714bd78e46728c6696c44d2851d8";
-    };
-    dependencies = [];
-  };
-
   shabadou = buildVimPlugin {
     name = "shabadou-git-2014-07-27";
     src = fetchgit {
@@ -647,38 +347,6 @@ rec {
     };
   };
 
-  signature = vim-signature;
-
-  snipmate = buildVimPlugin {
-    name = "snipmate";
-    src = fetchgit {
-      url = "git://github.com/garbas/vim-snipmate";
-      rev = "e6eb057a58e2fe98137997157d0eff9d1a975888";
-      sha256 = "4d8f9091b92a75f21d96a6f6a862aa4ad5671ab8317ceef4498eeb14a1524190";
-    };
-    dependencies = ["vim-addon-mw-utils" "tlib"];
-  };
-
-  Solarized = buildVimPlugin {
-    name = "Solarized";
-    src = fetchgit {
-      url = "git://github.com/altercation/vim-colors-solarized";
-      rev = "528a59f26d12278698bb946f8fb82a63711eec21";
-      sha256 = "a1b2ef696eee94dafa76431c31ee260acdd13a7cf87939f27eca431d5aa5a315";
-    };
-    dependencies = [];
-  };
-
-  sourcemap.vim = buildVimPlugin {
-    name = "sourcemap.vim";
-    src = fetchgit {
-      url = "git://github.com/chikatoike/sourcemap.vim";
-      rev = "0dd82d40faea2fdb0771067f46c01deb41610ba1";
-      sha256 = "a08c77aea39be4a0a980d62673d1d17fecc518a8aeb9101210e453aaacb78fbd";
-    };
-    dependencies = [];
-  };
-
   stylish-haskell = buildVimPlugin {
     name = "stylish-haskell-git-2014-07-14";
     src = fetchgit {
@@ -694,50 +362,6 @@ rec {
 
   stylishHaskell = stylish-haskell; # backwards compat, added 2014-10-18
 
-  Supertab = buildVimPlugin {
-    name = "Supertab";
-    src = fetchgit {
-      url = "git://github.com/ervandew/supertab";
-      rev = "fd4e0d06c2b1d9bff2eef1d15e7895b3b4da7cd7";
-      sha256 = "5919521b95519d4baa8ed146c340ca739fa7f31dfd305c74ca0ace324ba93d74";
-    };
-    dependencies = [];
-  };
-
-  supertab = Supertab;
-
-  surround = buildVimPlugin {
-    name = "surround";
-    src = fetchgit {
-      url = "git://github.com/tpope/vim-surround";
-      rev = "fa433e0b7330753688f715f3be5d10dc480f20e5";
-      sha256 = "5f01daf72d23fc065f4e4e8eac734275474f32bfa276a9d90ce0d20dfe24058d";
-    };
-    dependencies = [];
-  };
-
-  Syntastic = buildVimPlugin {
-    name = "Syntastic";
-    src = fetchgit {
-      url = "git://github.com/scrooloose/syntastic";
-      rev = "e4c94d67a9ba7f35397b4a2f0daa8f346a84a8b9";
-      sha256 = "366b5568ddf0db0e35a19bbd3ae4d0dc4accaefe5fdd14159540d26a76e3a96e";
-    };
-    dependencies = [];
-  };
-
-  syntastic = Syntastic;
-
-  table-mode = buildVimPlugin {
-    name = "table-mode";
-    src = fetchgit {
-      url = "git://github.com/dhruvasagar/vim-table-mode";
-      rev = "ea78f6256513b4b853ea01b55b18baf0f9d99f8c";
-      sha256 = "570a9660b17489ec6a976d878aec45470bc91c8da41f0e3ab8f09962683b2da7";
-    };
-    dependencies = [];
-  };
-
   tabmerge = buildVimPlugin {
     name = "tabmerge-git-2010-10-17";
     src = fetchgit {
@@ -751,30 +375,6 @@ rec {
     };
   };
 
-  Tabular = buildVimPlugin {
-    name = "Tabular";
-    src = fetchgit {
-      url = "git://github.com/godlygeek/tabular";
-      rev = "60f25648814f0695eeb6c1040d97adca93c4e0bb";
-      sha256 = "28c860ad621587f2c3213fae47d1a3997746527c17d51e9ab94c209eb7bfeb0f";
-    };
-    dependencies = [];
-  };
-
-  tabular = Tabular;
-
-  Tagbar = buildVimPlugin {
-    name = "Tagbar";
-    src = fetchgit {
-      url = "git://github.com/majutsushi/tagbar";
-      rev = "5283bc834a8c39b058d5eef1173e323b23b04fa0";
-      sha256 = "ed2bcbbb9caf476251cbbe650fc685b9e781390f9966f0c75ff02da0677deb1c";
-    };
-    dependencies = [];
-  };
-
-  tagbar = Tagbar;
-
   taglist = buildVimPlugin {
     name = "taglist-4.6";
     meta = with stdenv.lib; {
@@ -798,26 +398,6 @@ rec {
     buildInputs = [ unzip ];
   };
 
-  The_NERD_Commenter = buildVimPlugin {
-    name = "The_NERD_Commenter";
-    src = fetchgit {
-      url = "git://github.com/scrooloose/nerdcommenter";
-      rev = "6549cfde45339bd4f711504196ff3e8b766ef5e6";
-      sha256 = "ef270ae5617237d68b3d618068e758af8ffd8d3ba27a3799149f7a106cfd178e";
-    };
-    dependencies = [];
-  };
-
-  The_NERD_tree = buildVimPlugin {
-    name = "The_NERD_tree";
-    src = fetchgit {
-      url = "git://github.com/scrooloose/nerdtree";
-      rev = "f8fd2ecce20f5005e6313ce57d6d2a209890c946";
-      sha256 = "b86f8923d4068add210101d34c5272b575dcb1c1352992ee878af59db581fd75";
-    };
-    dependencies = [];
-  };
-
   thumbnail = buildVimPlugin {
     name = "thumbnail-git-2014-07-24";
     src = fetchgit {
@@ -831,16 +411,6 @@ rec {
     };
   };
 
-  tlib = buildVimPlugin {
-    name = "tlib";
-    src = fetchgit {
-      url = "git://github.com/tomtom/tlib_vim";
-      rev = "88c5a2427e12397f9b5b1819e3d80c2eebe2c411";
-      sha256 = "6cbbeb7fcda26028f73836ce3bae880db3e250cf8289804e6e28cb914854b7de";
-    };
-    dependencies = [];
-  };
-
   tmux-navigator = buildVimPlugin {
     name = "tmux-navigator-git-2014-09-09";
     src = fetchgit {
@@ -869,97 +439,521 @@ rec {
     };
   };
 
-  UltiSnips = buildVimPlugin {
+  vimproc = buildVimPlugin {
+    name = "vimproc-git-2014-10-03";
+    src = fetchgit {
+      url = "https://github.com/shougo/vimproc.vim.git";
+      rev = "3e055023dfab4f5a4dfa05a834f9d0cb7294a82e";
+      sha256 = "63c2786897e8315eed2473822879b7ceb847e6021695a861892d7b9ab15a69fb";
+     };
+    buildInputs = [ which ];
+
+    buildPhase = ''
+      sed -i 's/vimproc_mac\.so/vimproc_unix\.so/' autoload/vimproc.vim
+      make -f make_unix.mak
+    '';
+
+    meta = {
+      homepage = https://github.com/shougo/vimproc.vim;
+      maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    };
+  };
+
+  vimshell = buildVimPlugin rec {
+    version = "9.2";
+    name = "vimshell-${version}";
+
+    meta = with stdenv.lib; {
+      description = "An extreme shell that doesn't depend on external shells and is written completely in Vim script";
+      homepage    = https://github.com/Shougo/vimshell.vim;
+      repositories.git = https://github.com/Shougo/vimshell.vim.git;
+      license     = licenses.gpl3;
+      maintainers = with maintainers; [ lovek323 ];
+      platforms   = platforms.unix;
+    };
+
+    src = fetchurl {
+      url    = "https://github.com/Shougo/vimshell.vim/archive/ver.${version}.tar.gz";
+      sha256 = "1pbwxdhpv6pr09b6hwkgy7grpmpwlqpsgsawl38r40q6yib8zb4a";
+    };
+
+    buildInputs = [ vimproc ];
+
+    preBuild = ''
+      sed -ie '1 i\
+      set runtimepath+=${vimproc}/${rtpPath}/vimproc\
+      ' autoload/vimshell.vim
+    '';
+  };
+
+  watchdogs = buildVimPlugin {
+    name = "watchdogs-git-2014-10-18";
+    src = fetchgit {
+      url = "https://github.com/osyo-manga/vim-watchdogs.git";
+      rev = "ad222796eb88b44954340c19c39938046af26e05";
+      sha256 = "4c621ac2834864cf0c46f776029837913e1ba0c725a12d7cb24bf92e04ed1279";
+     };
+    meta = {
+      homepage = https://github.com/osyo-manga/vim-watchdogs;
+      maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    };
+  };
+
+  xdebug = buildVimPlugin {
+    name = "xdebug-git-2012-08-15";
+    src = fetchgit {
+      url = "https://github.com/joonty/vim-xdebug.git";
+      rev = "a4980fa65f7f159780593ee37c178281691ba2c4";
+      sha256 = "1ccb0e63eaf68548feb1c37b09c07c84b6bea9b350c4257549f091aa414601e2";
+     };
+    postInstall = false;
+    meta = {
+      homepage = https://github.com/joonty/vim-xdebug;
+      maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    };
+  };
+
+  YouCompleteMe = addRtp "${rtpPath}/youcompleteme" (stdenv.mkDerivation {
+    src = fetchgit {
+      url = "https://github.com/Valloric/YouCompleteMe.git";
+      rev = "87b42c689391b69968950ae99c3aaacf2e14c329";
+      sha256 = "1f3pywv8bsqyyakvyarg7z9m73gmvp1lfbfp2f2jj73jmmlzb2kv";
+     };
+
+    name = "vimplugin-youcompleteme-2014-10-06";
+
+    buildInputs = [ python cmake llvmPackages.clang ];
+
+    configurePhase = ":";
+
+    buildPhase = ''
+      patchShebangs .
+
+      target=$out/${rtpPath}/youcompleteme
+      mkdir -p $target
+      cp -a ./ $target
+
+      mkdir $target/build
+      cd $target/build
+      cmake -G "Unix Makefiles" . $target/third_party/ycmd/cpp -DPYTHON_LIBRARIES:PATH=${python}/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR:PATH=${python}/include/python2.7 -DUSE_CLANG_COMPLETER=ON -DUSE_SYSTEM_LIBCLANG=ON
+      make ycm_support_libs -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
+      ${bash}/bin/bash $target/install.sh --clang-completer --system-libclang
+
+      ${vimHelpTags}
+      vimHelpTags $target
+    '';
+
+    # TODO: implement proper install phase rather than keeping everything in store
+    # TODO: support llvm based C completion, See README of git repository
+    installPhase = ":";
+
+    meta = {
+      description = "fastest non utf-8 aware word and C completion engine for Vim";
+      homepage = http://github.com/Valloric/YouCompleteMe;
+      license = stdenv.lib.licenses.gpl3;
+      maintainers = [stdenv.lib.maintainers.marcweber];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  });
+
+  youcompleteme = YouCompleteMe;
+
+  YUNOcommit = buildVimPlugin {
+    name = "YUNOcommit";
+    src = fetchgit {
+      url = "git://github.com/esneide/YUNOcommit.vim";
+      rev = "10e0d674bfba05e88359dbe0ded4eb1d806b1342";
+      sha256 = "8efe7129ccc1cd13a09ffd4b5f8abe1fca12c434768ff57b865844cf40d49b41";
+    };
+    dependencies = [];
+  };
+
+
+  ### section II: automatically generated plugin derivations
+  # Update with vimUtils.vimPlugins.pluginnames2Nix command
+
+  # This is not a plugin, it provides bin/vim-open-buffer-with-plugins-derivations
+  # which recreates this the following derivations based on ./vim-plugin-names
+  pluginnames2nix = vimUtils.pluginnames2Nix {
+    name = "vim-plugin-names-to-nix";
+    namefiles = [./vim-plugin-names];
+  };
+
+  # aliasess
+  tabular = Tabular;
+  tagbar = Tagbar;
+  coffee-script = vim-coffee-script;
+  coffeeScript = coffee-script; # backwards compat, added 2014-10-18
+  colors-solarized = Solarized;
+  colorsamplerpack = Colour_Sampler_Pack;
+  easy-align = vim-easy-align;
+  ghc-mod-vim = ghcmod;
+  gist-vim = Gist;
+  gundo = Gundo;
+  hoogle = Hoogle;
+  latex-live-preview = vim-latex-live-preview;
+  nerdtree = The_NERD_tree;
+  signature = vim-signature;
+  supertab = Supertab;
+  syntastic = Syntastic;
+  webapi-vim = WebAPI;
+  yankring = YankRing;
+
+
+  ### The following derivations are generated by nix#ExportPluginsForNix
+
+  "Colour_Sampler_Pack" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Colour_Sampler_Pack";
+    src = fetchurl {
+      url = "http://www.vim.org/scripts/download_script.php?src_id=18915";
+      name = "ColorSamplerPack.zip";
+      sha256 = "1wsrb3vpqn9fncnalfpvc8r92wk1mcskm4shb3s2h9x5dyihf2rd";
+    };
+    buildInputs = [ unzip ];
+    dependencies = [];
+    meta = {
+       url = "http://www.vim.org/scripts/script.php?script_id=625";
+    };
+
+
+  };
+  "Gist" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Gist";
+    src = fetchgit {
+      url = "git://github.com/mattn/gist-vim";
+      rev = "d609d93472db9cf45bd701bebe51adc356631547";
+      sha256 = "e5cabc03d5015c589a32f11c654ab9fbd1e91d26ba01f4b737685be81852c511";
+    };
+    dependencies = [];
+
+  };
+  "Gundo" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Gundo";
+    src = fetchhg {
+      url = "https://bitbucket.org/sjl/gundo.vim";
+      rev = "eb9fc8676b89";
+      sha256 = "05lcxrd9ibfi02ja4jvl5y5pp884b8kh9aarw045b0mlldygv6cp";
+    };
+    dependencies = [];
+
+  };
+  "Hoogle" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Hoogle";
+    src = fetchgit {
+      url = "git://github.com/Twinside/vim-hoogle";
+      rev = "81f28318b0d4174984c33df99db7752891c5c4e9";
+      sha256 = "0f96f3badb6218cac87d0f7027ff032ecc74f08ad3ada542898278ce11cbd5a0";
+    };
+    dependencies = [];
+
+  };
+  "Solarized" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Solarized";
+    src = fetchgit {
+      url = "git://github.com/altercation/vim-colors-solarized";
+      rev = "528a59f26d12278698bb946f8fb82a63711eec21";
+      sha256 = "a1b2ef696eee94dafa76431c31ee260acdd13a7cf87939f27eca431d5aa5a315";
+    };
+    dependencies = [];
+
+  };
+  "Supertab" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Supertab";
+    src = fetchgit {
+      url = "git://github.com/ervandew/supertab";
+      rev = "b0ca47f4570385043f270f9278ba6d50d1d2fa00";
+      sha256 = "24e3e63096a6b6f7f00d985ae6f31377154566d6483fb81572a474053fa43082";
+    };
+    dependencies = [];
+
+  };
+  "Syntastic" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Syntastic";
+    src = fetchgit {
+      url = "git://github.com/scrooloose/syntastic";
+      rev = "30b4ce3411f539f695ab8def7fc69c2f835eb8fe";
+      sha256 = "c61e2bcd4455525ec2520d75e7b204e39757731f85f5f72ed179f2068ac33700";
+    };
+    dependencies = [];
+
+  };
+  "Tabular" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Tabular";
+    src = fetchgit {
+      url = "git://github.com/godlygeek/tabular";
+      rev = "60f25648814f0695eeb6c1040d97adca93c4e0bb";
+      sha256 = "28c860ad621587f2c3213fae47d1a3997746527c17d51e9ab94c209eb7bfeb0f";
+    };
+    dependencies = [];
+
+  };
+  "Tagbar" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "Tagbar";
+    src = fetchgit {
+      url = "git://github.com/majutsushi/tagbar";
+      rev = "f9c5f24576e82aae5ab8a5480f1ae48615354e40";
+      sha256 = "e1ff486f27c0980fee959db69da5617c4653910504b20aeabe87037a8b68712a";
+    };
+    dependencies = [];
+
+  };
+  "The_NERD_Commenter" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "The_NERD_Commenter";
+    src = fetchgit {
+      url = "git://github.com/scrooloose/nerdcommenter";
+      rev = "6549cfde45339bd4f711504196ff3e8b766ef5e6";
+      sha256 = "ef270ae5617237d68b3d618068e758af8ffd8d3ba27a3799149f7a106cfd178e";
+    };
+    dependencies = [];
+
+  };
+  "The_NERD_tree" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "The_NERD_tree";
+    src = fetchgit {
+      url = "git://github.com/scrooloose/nerdtree";
+      rev = "3b98a7fcae8f9fff356907171f0406ff8cd28921";
+      sha256 = "deec2ce33249829ae3925478d7d1925ea99e20c37dcc86db7c3bfac4fdc706e0";
+    };
+    dependencies = [];
+
+  };
+  "UltiSnips" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "UltiSnips";
     src = fetchgit {
       url = "git://github.com/sirver/ultisnips";
-      rev = "cb8536d7240f5f458c292f8aa38fc50278222fe8";
-      sha256 = "95bc88fc3dae45896893797cff9bb697f3701572c27442898c661d004b50be16";
+      rev = "b26f2c97b7d9be708eef0b4ba0cdfb53c868d9c3";
+      sha256 = "094055f6255d207c04e26f15ee15019eb9d4b1710c24061c7f8074d23583b9b2";
     };
     dependencies = [];
+
   };
+  "VimOutliner" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "VimOutliner";
+    src = fetchgit {
+      url = "git://github.com/vimoutliner/vimoutliner";
+      rev = "469f49b5f28bc2b838a80568c9413f690cc3ffb6";
+      sha256 = "38f88f9bbc43622809404c0054a7a4e9b2214166f3b2784511e4fda05bcb4713";
+    };
+    dependencies = [];
 
-  undotree = buildVimPlugin {
-    name = "undotree";
+  };
+  "WebAPI" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "WebAPI";
     src = fetchgit {
-      url = "git://github.com/mbbill/undotree";
-      rev = "88e4a9bc2f7916f24441faf884853a01ba11d294";
-      sha256 = "ad55b88db051f57d0c7ddc226a7b7778daab58fa67dc8ac1d78432c0e7d38520";
+      url = "git://github.com/mattn/webapi-vim";
+      rev = "a7789abffe936db56e3152e23733847f94755753";
+      sha256 = "455b84d9fd13200ff5ced5d796075f434a7fb9c00f506769174579266ae2be80";
     };
     dependencies = [];
+
   };
+  "YankRing" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "YankRing";
+    src = fetchurl {
+      url = "http://www.vim.org/scripts/download_script.php?src_id=20842";
+      name = "yankring_180.zip";
+      sha256 = "0bsq4pxagy12jqxzs7gcf25k5ahwif13ayb9k8clyhm0jjdkf0la";
+    };
+    buildInputs = [ unzip ];
+    dependencies = [];
+    meta = {
+       url = "http://www.vim.org/scripts/script.php?script_id=1234";
+    };
 
-  vim-addon-actions = buildVimPlugin {
-    name = "vim-addon-actions";
+
+  };
+  "commentary" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "commentary";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-actions";
-      rev = "a5d20500fb8812958540cf17862bd73e7af64936";
-      sha256 = "d2c3eb7a1f29e7233c6fcf3b02d07efebe8252d404ee593419ad399a5fdf6383";
+      url = "git://github.com/tpope/vim-commentary";
+      rev = "9c685131a5facfa0d643feca3a61b41c007d8170";
+      sha256 = "2a9f394d0669429469c2f1ddaf9a722c2773f35da08ea9496d3b4b4e85b6038d";
     };
-    dependencies = ["vim-addon-mw-utils" "tlib"];
+    dependencies = [];
+
   };
+  "ctrlp" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "ctrlp";
+    src = fetchgit {
+      url = "git://github.com/kien/ctrlp.vim";
+      rev = "b5d3fe66a58a13d2ff8b6391f4387608496a030f";
+      sha256 = "41f7884973770552395b96f8693da70999dc815462d4018c560d3ff6be462e76";
+    };
+    dependencies = [];
 
-  vim-addon-async = buildVimPlugin {
-    name = "vim-addon-async";
+  };
+  "extradite" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "extradite";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-async";
-      rev = "dadc96e188f1cdacbac62129eb29a1eacfed792c";
-      sha256 = "27f941e21a8ca5940bd20914e2a9e3809e554f3ef2c27b3bafb9a153107a5d07";
+      url = "git://github.com/int3/vim-extradite";
+      rev = "af4f3a51b6b654d655121b93c0cd9d8fe9a0c85d";
+      sha256 = "d1d29cfbc654134be383747f2cd6b14b7a87de75f997af6a041f14d7ef61ade6";
     };
-    dependencies = ["vim-addon-signs"];
+    dependencies = [];
+
   };
+  "fugitive" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "fugitive";
+    src = fetchgit {
+      url = "git://github.com/tpope/vim-fugitive";
+      rev = "2c8461db084d205903a792a23163faa546f143c9";
+      sha256 = "c2569877958fcc5d181cc5b9e26d6b0b022c30aa9ce0908dd96131b44eb90729";
+    };
+    dependencies = [];
+
+  };
+  "ghcmod" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "ghcmod";
+    src = fetchgit {
+      url = "git://github.com/eagletmt/ghcmod-vim";
+      rev = "d5c6c7f3c85608b5b76dc3e7e001f60b86c32cb9";
+      sha256 = "ab56d470ea18da3fae021e22bba14460505e61a94f8bf707778dff5eec51cd6d";
+    };
+    dependencies = [];
 
-  vim-addon-background-cmd = buildVimPlugin {
-    name = "vim-addon-background-cmd";
+  };
+  "github:MarcWeber/vim-addon-vim2nix" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "github-MarcWeber-vim-addon-vim2nix";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-background-cmd";
-      rev = "14df72660a95804a57c02b9ff0ae3198608e2491";
-      sha256 = "5c2ece1f3ff7653eb7c1b40180554e8e89e5ae43d67e7cc159d95c0156135687";
+      url = "git://github.com/MarcWeber/vim-addon-vim2nix";
+      rev = "1aef89c05ef199fccff34be807ed7eefd914ca41";
+      sha256 = "b078fd91cf978ee4cf7002630a83d3381ad781fa99e3ce118185b7f0f417ba2a";
     };
-    dependencies = ["vim-addon-mw-utils"];
+    dependencies = [];
+
   };
+  "matchit.zip" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "matchit.zip";
+    src = fetchurl {
+      url = "http://www.vim.org/scripts/download_script.php?src_id=8196";
+      name = "matchit.zip";
+      sha256 = "1bbm8j1bhb70kagwdimwy9vcvlrz9ax5bk2a7wrmn4cy87f9xj4l";
+    };
+    buildInputs = [ unzip ];
+    dependencies = [];
+    meta = {
+       url = "http://www.vim.org/scripts/script.php?script_id=39";
+    };
 
-  vim-addon-commenting = buildVimPlugin {
-    name = "vim-addon-commenting";
+  unpackPhase = ''
+    (
+     sourceRoot=d
+     mkdir $sourceRoot; cd $sourceRoot;
+     unzip $src
+    )
+  '';
+  };
+  "pathogen" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "pathogen";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-commenting";
-      rev = "b7cf748ac1c9bf555cbd347589e3b7196030d20b";
-      sha256 = "4ad7d5f6669f0a1b4a24c9ce3649c030d7d3fc8588de4d4d6c3269140fbe9b3e";
+      url = "git://github.com/tpope/vim-pathogen";
+      rev = "b9fb0dfd811004010f5f6903edef42d6004ebea2";
+      sha256 = "62ec7e9721651aa86aa716d47c2057771f7d093f414c3b98f50a759d210db4c7";
+    };
+    dependencies = [];
+
+  };
+  "quickfixstatus" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "quickfixstatus";
+    src = fetchgit {
+      url = "git://github.com/dannyob/quickfixstatus";
+      rev = "fd3875b914fc51bbefefa8c4995588c088163053";
+      sha256 = "7b6831d5da1c23d95f3158c67e4376d32c2f62ab2e30d02d3f3e14dcfd867d9b";
     };
     dependencies = [];
+
   };
+  "rainbow_parentheses" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "rainbow_parentheses";
+    src = fetchgit {
+      url = "git://github.com/kien/rainbow_parentheses.vim";
+      rev = "eb8baa5428bde10ecc1cb14eed1d6e16f5f24695";
+      sha256 = "47975a426d06f41811882691d8a51f32bc72f590477ed52b298660486b2488e3";
+    };
+    dependencies = [];
+
+  };
+  "rust" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "rust";
+    src = fetchgit {
+      url = "git://github.com/wting/rust.vim";
+      rev = "0fd423990cfa69336fb6c1d5d58aa2091e7b4e76";
+      sha256 = "21f3decedb24478bc391152bf26a9b88d9e4fa5fcdbdb8a558d95b6bb7be2ff1";
+    };
+    dependencies = [];
+
+  };
+  "snipmate" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "snipmate";
+    src = fetchgit {
+      url = "git://github.com/garbas/vim-snipmate";
+      rev = "8cb6c3ebe267873dc5abb9a36305c75d9564dea4";
+      sha256 = "f4692709724a50ff14ccdd5692d90ebdb950417267adb2228f5ce6006471bad4";
+    };
+    dependencies = ["vim-addon-mw-utils" "tlib"];
 
-  vim-addon-completion = buildVimPlugin {
-    name = "vim-addon-completion";
+  };
+  "sourcemap.vim" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "sourcemap.vim";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-completion";
-      rev = "80f717d68df5b0d7b32228229ddfd29c3e86e435";
-      sha256 = "c8c0af8760f2622c4caef371482916861f68a850eb6a7cd746fe8c9ab405c859";
+      url = "git://github.com/chikatoike/sourcemap.vim";
+      rev = "0dd82d40faea2fdb0771067f46c01deb41610ba1";
+      sha256 = "a08c77aea39be4a0a980d62673d1d17fecc518a8aeb9101210e453aaacb78fbd";
     };
-    dependencies = ["tlib"];
+    dependencies = [];
+
   };
+  "surround" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "surround";
+    src = fetchgit {
+      url = "git://github.com/tpope/vim-surround";
+      rev = "fa433e0b7330753688f715f3be5d10dc480f20e5";
+      sha256 = "5f01daf72d23fc065f4e4e8eac734275474f32bfa276a9d90ce0d20dfe24058d";
+    };
+    dependencies = [];
 
-  vim-addon-errorformats = buildVimPlugin {
-    name = "vim-addon-errorformats";
+  };
+  "table-mode" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "table-mode";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-errorformats";
-      rev = "dcbb203ad5f56e47e75fdee35bc92e2ba69e1d28";
-      sha256 = "a1260206545d5ae17f2e6b3319f5cf1808b74e792979b1c6667d75974cc53f95";
+      url = "git://github.com/dhruvasagar/vim-table-mode";
+      rev = "e1258702126463b30e32a8a4cd1ba28689a93ef8";
+      sha256 = "2b8ac53a0a346f27db617dade3bd3e4da7d5b560a99c636da7d27cf5622a6690";
     };
     dependencies = [];
+
   };
+  "undotree" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "undotree";
+    src = fetchgit {
+      url = "git://github.com/mbbill/undotree";
+      rev = "88e4a9bc2f7916f24441faf884853a01ba11d294";
+      sha256 = "ad55b88db051f57d0c7ddc226a7b7778daab58fa67dc8ac1d78432c0e7d38520";
+    };
+    dependencies = [];
 
-  vim-addon-goto-thing-at-cursor = buildVimPlugin {
-    name = "vim-addon-goto-thing-at-cursor";
+  };
+  "vim-addon-async" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "vim-addon-async";
     src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-goto-thing-at-cursor";
-      rev = "f052e094bdb351829bf72ae3435af9042e09a6e4";
-      sha256 = "34658ac99d9a630db9c544b3dfcd2c3df69afa5209e27558cc022b7afc2078ea";
+      url = "git://github.com/MarcWeber/vim-addon-async";
+      rev = "dadc96e188f1cdacbac62129eb29a1eacfed792c";
+      sha256 = "27f941e21a8ca5940bd20914e2a9e3809e554f3ef2c27b3bafb9a153107a5d07";
     };
-    dependencies = ["tlib"];
+    dependencies = ["vim-addon-signs"];
+
   };
+  "vim-addon-commenting" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "vim-addon-commenting";
+    src = fetchgit {
+      url = "git://github.com/MarcWeber/vim-addon-commenting";
+      rev = "b7cf748ac1c9bf555cbd347589e3b7196030d20b";
+      sha256 = "4ad7d5f6669f0a1b4a24c9ce3649c030d7d3fc8588de4d4d6c3269140fbe9b3e";
+    };
+    dependencies = [];
 
-  vim-addon-local-vimrc = buildVimPlugin {
+  };
+  "vim-addon-local-vimrc" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-local-vimrc";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-local-vimrc";
@@ -967,19 +961,19 @@ rec {
       sha256 = "f11d13676e2fdfcc9cabc991577f0b2e85909665b6f245aa02f21ff78d6a8556";
     };
     dependencies = [];
-  };
 
-  vim-addon-manager = buildVimPlugin {
+  };
+  "vim-addon-manager" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-manager";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-manager";
-      rev = "d6de0d52bfe338eb373a4908b51b0eb89eaf42b0";
-      sha256 = "4becba76d3389e4ace9e01c4393bc7bf38767eecf9eee239689054b9ee0c1fc9";
+      rev = "345c4b357843b14f4622f212e4d1e0e3f8a7f08a";
+      sha256 = "d8fba7dd089f4a919f91dc284537880d7a841c26dacb503ea08b15dce35e7626";
     };
     dependencies = [];
-  };
 
-  vim-addon-mru = buildVimPlugin {
+  };
+  "vim-addon-mru" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-mru";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-mru";
@@ -987,9 +981,9 @@ rec {
       sha256 = "15b70f796f28cbd999060fea7f47408fa8a6cb176cd4915b9cc3dc6c53eed960";
     };
     dependencies = ["vim-addon-other" "vim-addon-mw-utils"];
-  };
 
-  vim-addon-mw-utils = buildVimPlugin {
+  };
+  "vim-addon-mw-utils" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-mw-utils";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-mw-utils";
@@ -997,9 +991,9 @@ rec {
       sha256 = "4e1b6d1b59050f1063e58ef4bee9e9603616ad184cd9ef7466d0ec3d8e22b91c";
     };
     dependencies = [];
-  };
 
-  vim-addon-nix = buildVimPlugin {
+  };
+  "vim-addon-nix" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-nix";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-nix";
@@ -1007,9 +1001,9 @@ rec {
       sha256 = "c2b0f6f50083063b5e801b872f38d4f00307fe5d7a4f3977a108e5cd10c1c410";
     };
     dependencies = ["vim-addon-completion" "vim-addon-goto-thing-at-cursor" "vim-addon-errorformats" "vim-addon-actions" "vim-addon-mw-utils" "tlib"];
-  };
 
-  vim-addon-other = buildVimPlugin {
+  };
+  "vim-addon-other" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-other";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-other";
@@ -1017,9 +1011,9 @@ rec {
       sha256 = "43f027e4b7576031072515c23c2b09f7f2c8bba7ee43a1e2041a4371bd954d1b";
     };
     dependencies = ["vim-addon-actions" "vim-addon-mw-utils"];
-  };
 
-  vim-addon-php-manual = buildVimPlugin {
+  };
+  "vim-addon-php-manual" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-php-manual";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-php-manual";
@@ -1027,19 +1021,9 @@ rec {
       sha256 = "b2f44be3a1ceca9de7789ea9b5fd36035b720ea529f4301f3771b010d1e453c2";
     };
     dependencies = [];
-  };
 
-  vim-addon-signs = buildVimPlugin {
-    name = "vim-addon-signs";
-    src = fetchgit {
-      url = "git://github.com/MarcWeber/vim-addon-signs";
-      rev = "17a49f293d18174ff09d1bfff5ba86e8eee8e8ae";
-      sha256 = "a9c03a32e758d51106741605188cb7f00db314c73a26cae75c0c9843509a8fb8";
-    };
-    dependencies = [];
   };
-
-  vim-addon-sql = buildVimPlugin {
+  "vim-addon-sql" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-sql";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-sql";
@@ -1047,9 +1031,9 @@ rec {
       sha256 = "a1334ae694e0a03229bacc8ba7e08e7223df240244c7378e3f1bd91d74e957c2";
     };
     dependencies = ["vim-addon-completion" "vim-addon-background-cmd" "tlib"];
-  };
 
-  vim-addon-syntax-checker = buildVimPlugin {
+  };
+  "vim-addon-syntax-checker" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-syntax-checker";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-syntax-checker";
@@ -1057,9 +1041,9 @@ rec {
       sha256 = "aef048e664653b5007df71ac24ed34ec55d8938c763d3f80885a122e445a9b3d";
     };
     dependencies = ["vim-addon-mw-utils" "tlib"];
-  };
 
-  vim-addon-toggle-buffer = buildVimPlugin {
+  };
+  "vim-addon-toggle-buffer" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-toggle-buffer";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-toggle-buffer";
@@ -1067,9 +1051,9 @@ rec {
       sha256 = "672166ecfe0599177afb56b444366f587f77e9659c256ac4e41ee45cb2df6055";
     };
     dependencies = ["vim-addon-mw-utils" "tlib"];
-  };
 
-  vim-addon-xdebug = buildVimPlugin {
+  };
+  "vim-addon-xdebug" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-addon-xdebug";
     src = fetchgit {
       url = "git://github.com/MarcWeber/vim-addon-xdebug";
@@ -1077,19 +1061,19 @@ rec {
       sha256 = "0a7bf2caf36772c94bd25bfbf46bf628623809c9cfab447ff788eb74149464ef";
     };
     dependencies = ["WebAPI" "vim-addon-mw-utils" "vim-addon-signs" "vim-addon-async"];
-  };
 
-  vim-airline = buildVimPlugin {
+  };
+  "vim-airline" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-airline";
     src = fetchgit {
       url = "git://github.com/bling/vim-airline";
-      rev = "256dec6800342c121c1b26dabc06dafb0c91edca";
-      sha256 = "9bb684da91bffc80d8489210fc74476895be81772b1d1370ee0b9a9ec7469750";
+      rev = "4a2208821e1d334c4d3cdf66cd1fd0968755e16a";
+      sha256 = "ea2d8bb459ae2cc378a46409c7e86db9b1cc8349bd3d2451c9a5db8ae9c8ea1d";
     };
     dependencies = [];
-  };
 
-  vim-coffee-script = buildVimPlugin {
+  };
+  "vim-coffee-script" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-coffee-script";
     src = fetchgit {
       url = "git://github.com/kchmck/vim-coffee-script";
@@ -1097,39 +1081,39 @@ rec {
       sha256 = "89ee4c7cce9f3310be502df6b2dd2e70a715c0b06882afc9c8169fbf58b207d0";
     };
     dependencies = [];
-  };
 
-  vim-easy-align = buildVimPlugin {
+  };
+  "vim-easy-align" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-easy-align";
     src = fetchgit {
       url = "git://github.com/junegunn/vim-easy-align";
-      rev = "2595ebf9333f3598502276b29f78ad39965bc595";
-      sha256 = "1223b587c515169d4b735bf56f109f7bfc4f7c1327e76865f498309f7472ef78";
+      rev = "246139c57c4a82a9787974165dfeb7bee7dacc9c";
+      sha256 = "9205b94f985f633b5cbdde63a4c5a36ce5c4f92f8a89c124ff4ba66458f98cbf";
     };
     dependencies = [];
-  };
 
-  vim-gitgutter = buildVimPlugin {
+  };
+  "vim-gitgutter" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-gitgutter";
     src = fetchgit {
       url = "git://github.com/airblade/vim-gitgutter";
-      rev = "39f011909620e0c7ae555efdace20c3963ac88af";
-      sha256 = "585c367c8cf72d7ef511b3beca3d1eae1d68bbd61b9a8d4dc7aea6e0caa4813a";
+      rev = "88c7916d2f653e13cbbcd2c461c83c403d09ca46";
+      sha256 = "df56b3cd81a71cd3a4286d878a4cfd7b53c3b7b09f3cf45fa41653050315056c";
     };
     dependencies = [];
-  };
 
-  vim-iced-coffee-script = buildVimPlugin {
+  };
+  "vim-iced-coffee-script" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-iced-coffee-script";
     src = fetchgit {
       url = "git://github.com/noc7c9/vim-iced-coffee-script";
       rev = "e42e0775fa4b1f8840c55cd36ac3d1cedbc1dea2";
       sha256 = "c7859591975a51a1736f99a433d7ca3e7638b417340a0472a63995e16d8ece93";
     };
-    dependencies = ["vim-coffee-script"];
-  };
+    dependencies = [];
 
-  vim-latex-live-preview = buildVimPlugin {
+  };
+  "vim-latex-live-preview" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-latex-live-preview";
     src = fetchgit {
       url = "git://github.com/xuhdev/vim-latex-live-preview";
@@ -1137,29 +1121,29 @@ rec {
       sha256 = "261852d3830189a50176f997a4c6b4ec7e25893c5b7842a3eb57eb7771158722";
     };
     dependencies = [];
-  };
 
-  vim-signature = buildVimPlugin {
+  };
+  "vim-signature" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-signature";
     src = fetchgit {
       url = "git://github.com/kshenoy/vim-signature";
-      rev = "29fc095535c4a3206d3194305739b33cd72ffad2";
-      sha256 = "46101330cd291dd819552ba1f47571342fe671d6985d06897c34465b87fd7bc4";
+      rev = "598a9275668d772ca18cc052246b96edcbe61de0";
+      sha256 = "1c410aaec24840b0e0566cd6e6df100ca3c7fb83d92337efdfc359494b6c49f8";
     };
     dependencies = [];
-  };
 
-  vim-snippets = buildVimPlugin {
+  };
+  "vim-snippets" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim-snippets";
     src = fetchgit {
       url = "git://github.com/honza/vim-snippets";
-      rev = "d05ca095ef93e256b45accb1e4b56ae3c44af125";
-      sha256 = "1685ebe317ad1029bfc25e06c8f14cc3c14db887a7e1d743378c3748e416ac77";
+      rev = "436038094a27ed635aaa11ebf50ccddc2d4b9328";
+      sha256 = "1db34df31ff1526394de42997e21b47cea152dc2c014dbbb1f3bbeb8986820e1";
     };
     dependencies = [];
-  };
 
-  vim2hs = buildVimPlugin {
+  };
+  "vim2hs" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vim2hs";
     src = fetchgit {
       url = "git://github.com/dag/vim2hs";
@@ -1167,66 +1151,9 @@ rec {
       sha256 = "485fc58595bb4e50f2239bec5a4cbb0d8f5662aa3f744e42c110cd1d66b7e5b0";
     };
     dependencies = [];
-  };
-
-  VimOutliner = buildVimPlugin {
-    name = "VimOutliner";
-    src = fetchgit {
-      url = "git://github.com/vimoutliner/vimoutliner";
-      rev = "91dccce033ca3924ad47831d29cd93fccc546013";
-      sha256 = "c6dd19df1432908574e84a339a15076ddf8bfd6dfd2544b220928c29d9f752d3";
-    };
-    dependencies = [];
-  };
 
-  vimproc = buildVimPlugin {
-    name = "vimproc-git-2014-10-03";
-    src = fetchgit {
-      url = "https://github.com/shougo/vimproc.vim.git";
-      rev = "3e055023dfab4f5a4dfa05a834f9d0cb7294a82e";
-      sha256 = "63c2786897e8315eed2473822879b7ceb847e6021695a861892d7b9ab15a69fb";
-     };
-    buildInputs = [ which ];
-
-    buildPhase = ''
-      sed -i 's/vimproc_mac\.so/vimproc_unix\.so/' autoload/vimproc.vim
-      make -f make_unix.mak
-    '';
-
-    meta = {
-      homepage = https://github.com/shougo/vimproc.vim;
-      maintainers = [ stdenv.lib.maintainers.jagajaga ];
-    };
   };
-
-  vimshell = buildVimPlugin rec {
-    version = "9.2";
-    name = "vimshell-${version}";
-
-    meta = with stdenv.lib; {
-      description = "An extreme shell that doesn't depend on external shells and is written completely in Vim script";
-      homepage    = https://github.com/Shougo/vimshell.vim;
-      repositories.git = https://github.com/Shougo/vimshell.vim.git;
-      license     = licenses.gpl3;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-    };
-
-    src = fetchurl {
-      url    = "https://github.com/Shougo/vimshell.vim/archive/ver.${version}.tar.gz";
-      sha256 = "1pbwxdhpv6pr09b6hwkgy7grpmpwlqpsgsawl38r40q6yib8zb4a";
-    };
-
-    buildInputs = [ vimproc ];
-
-    preBuild = ''
-      sed -ie '1 i\
-      set runtimepath+=${vimproc}/${rtpPath}/vimproc\
-      ' autoload/vimshell.vim
-    '';
-  };
-
-  vundle = buildVimPlugin {
+  "vundle" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "vundle";
     src = fetchgit {
       url = "git://github.com/gmarik/vundle";
@@ -1234,35 +1161,9 @@ rec {
       sha256 = "9681d471d1391626cb9ad22b2b469003d9980cd23c5c3a8d34666376447e6204";
     };
     dependencies = [];
-  };
 
-  watchdogs = buildVimPlugin {
-    name = "watchdogs-git-2014-10-18";
-    src = fetchgit {
-      url = "https://github.com/osyo-manga/vim-watchdogs.git";
-      rev = "ad222796eb88b44954340c19c39938046af26e05";
-      sha256 = "4c621ac2834864cf0c46f776029837913e1ba0c725a12d7cb24bf92e04ed1279";
-     };
-    meta = {
-      homepage = https://github.com/osyo-manga/vim-watchdogs;
-      maintainers = [ stdenv.lib.maintainers.jagajaga ];
-    };
   };
-
-  WebAPI = buildVimPlugin {
-    name = "WebAPI";
-    src = fetchgit {
-      url = "git://github.com/mattn/webapi-vim";
-      rev = "a7789abffe936db56e3152e23733847f94755753";
-      sha256 = "455b84d9fd13200ff5ced5d796075f434a7fb9c00f506769174579266ae2be80";
-    };
-    buildInputs = [ zip ];
-    dependencies = [];
-  };
-
-  webapi-vim = WebAPI;
-
-  wombat256 = buildVimPlugin {
+  "wombat256" = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "wombat256";
     src = fetchurl {
       url = "http://www.vim.org/scripts/download_script.php?src_id=13400";
@@ -1274,91 +1175,9 @@ rec {
     meta = {
        url = "http://www.vim.org/scripts/script.php?script_id=2465";
     };
-  };
 
-  xdebug = buildVimPlugin {
-    name = "xdebug-git-2012-08-15";
-    src = fetchgit {
-      url = "https://github.com/joonty/vim-xdebug.git";
-      rev = "a4980fa65f7f159780593ee37c178281691ba2c4";
-      sha256 = "1ccb0e63eaf68548feb1c37b09c07c84b6bea9b350c4257549f091aa414601e2";
-     };
-    postInstall = false;
-    meta = {
-      homepage = https://github.com/joonty/vim-xdebug;
-      maintainers = [ stdenv.lib.maintainers.jagajaga ];
-    };
-  };
 
-  YankRing = buildVimPlugin {
-    name = "YankRing";
-    src = fetchurl {
-      url = "http://www.vim.org/scripts/download_script.php?src_id=20842";
-      name = "yankring_180.zip";
-      sha256 = "0bsq4pxagy12jqxzs7gcf25k5ahwif13ayb9k8clyhm0jjdkf0la";
-    };
-    buildInputs = [ unzip ];
-    dependencies = [];
-    meta = {
-       url = "http://www.vim.org/scripts/script.php?script_id=1234";
-    };
   };
 
-  yankring = YankRing;
-
-  YouCompleteMe = addRtp "${rtpPath}/youcompleteme" (stdenv.mkDerivation {
-    src = fetchgit {
-      url = "https://github.com/Valloric/YouCompleteMe.git";
-      rev = "87b42c689391b69968950ae99c3aaacf2e14c329";
-      sha256 = "1f3pywv8bsqyyakvyarg7z9m73gmvp1lfbfp2f2jj73jmmlzb2kv";
-     };
-
-    name = "vimplugin-youcompleteme-2014-10-06";
-
-    buildInputs = [ python cmake llvmPackages.clang ];
-
-    configurePhase = ":";
-
-    buildPhase = ''
-      patchShebangs .
-
-      target=$out/${rtpPath}/youcompleteme
-      mkdir -p $target
-      cp -a ./ $target
-
-      mkdir $target/build
-      cd $target/build
-      cmake -G "Unix Makefiles" . $target/third_party/ycmd/cpp -DPYTHON_LIBRARIES:PATH=${python}/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR:PATH=${python}/include/python2.7 -DUSE_CLANG_COMPLETER=ON -DUSE_SYSTEM_LIBCLANG=ON
-      make ycm_support_libs -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
-      ${bash}/bin/bash $target/install.sh --clang-completer --system-libclang
-
-      ${vimHelpTags}
-      vimHelpTags $target
-    '';
-
-    # TODO: implement proper install phase rather than keeping everything in store
-    # TODO: support llvm based C completion, See README of git repository
-    installPhase = ":";
-
-    meta = {
-      description = "fastest non utf-8 aware word and C completion engine for Vim";
-      homepage = http://github.com/Valloric/YouCompleteMe;
-      license = stdenv.lib.licenses.gpl3;
-      maintainers = [stdenv.lib.maintainers.marcweber];
-      platforms = stdenv.lib.platforms.linux;
-    };
-  });
-
-  youcompleteme = YouCompleteMe;
-
-  YUNOcommit = buildVimPlugin {
-    name = "YUNOcommit";
-    src = fetchgit {
-      url = "git://github.com/esneide/YUNOcommit.vim";
-      rev = "10e0d674bfba05e88359dbe0ded4eb1d806b1342";
-      sha256 = "8efe7129ccc1cd13a09ffd4b5f8abe1fca12c434768ff57b865844cf40d49b41";
-    };
-    dependencies = [];
-  };
 
 }
diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names
new file mode 100644
index 000000000000..f685f6743bef
--- /dev/null
+++ b/pkgs/misc/vim-plugins/vim-plugin-names
@@ -0,0 +1,55 @@
+"vim-addon-syntax-checker"
+"vim-addon-other"
+"vim-addon-local-vimrc"
+"snipmate"
+"vim-snippets"
+"vim-addon-mru"
+"vim-addon-commenting"
+"vim-addon-sql"
+"vim-addon-async"
+"vim-addon-toggle-buffer"
+"vim-addon-mw-utils"
+"matchit.zip"
+"vim-addon-xdebug"
+"vim-addon-php-manual"
+"sourcemap.vim"
+"vim-iced-coffee-script"
+"ctrlp"
+"commentary"
+"Colour_Sampler_Pack"
+"Solarized"
+"vim-coffee-script"
+"vim-easy-align"
+"Tagbar"
+"Tabular"
+"table-mode"
+"Syntastic"
+"vim-signature"
+"surround"
+"Supertab"
+"rust"
+"rainbow_parentheses"
+"pathogen"
+"quickfixstatus"
+"The_NERD_Commenter"
+"The_NERD_tree"
+"vim-latex-live-preview"
+"Hoogle"
+"Gundo"
+"vim-gitgutter"
+"Gist"
+"ghcmod"
+"fugitive"
+"extradite"
+"vim-airline"
+"VimOutliner"
+"vim2hs"
+"undotree"
+"UltiSnips"
+"wombat256"
+"vundle"
+"WebAPI"
+"YankRing"
+"vim-addon-manager"
+"vim-addon-nix"
+"github:MarcWeber/vim-addon-vim2nix"
diff --git a/pkgs/misc/vim-plugins/vim-utils.nix b/pkgs/misc/vim-plugins/vim-utils.nix
new file mode 100644
index 000000000000..6b5dd139525b
--- /dev/null
+++ b/pkgs/misc/vim-plugins/vim-utils.nix
@@ -0,0 +1,384 @@
+{stdenv, vim, vimPlugins, vim_configurable, buildEnv, writeText, writeScriptBin}:
+
+/* 
+
+USAGE EXAMPLE
+=============
+
+Install Vim like this eg using nixos option environment.systemPackages which will provide
+vim-with-plugins in PATH:
+
+  vim_configurable.customize {
+    name = "vim-with-plugins";
+
+    # add custom .vimrc lines like this:
+    vimrcConfig.customRC = ''
+      set hidden
+    '';
+
+    vimrcConfig.vam.knownPlugins = pkgs.vimPlugins; # optional
+    vimrcConfig.vam.pluginDictionaries = [
+      # load always
+      { name = "youcompleteme"; }
+      { names = ["youcompleteme" "foo"]; }
+
+      # only load when opening a .php file
+      { name = "phpCompletion"; ft_regex = "^php\$"; }
+      { name = "phpCompletion"; filename_regex = "^.php\$"; }
+
+      # provide plugin which can be loaded manually:
+      { name = "phpCompletion"; tag = "lazy"; }
+
+      # full ducomentation at github.com/MarcWeber/vim-addon-manager
+    ];
+
+    # there is a pathogen implementation as well, but its startup is slower and [VAM] has more feature
+    # vimrcConfig.pathogen.knownPlugins = vimPlugins; # optional
+    # vimrcConfig.pathogen.pluginNames = ["vim-addon-nix"];
+  };
+
+WHAT IS A VIM PLUGIN?
+=====================
+Typical plugin files:
+
+  plugin/P1.vim
+  autoload/P1.vim
+  ftplugin/xyz.vim
+  doc/plugin-documentation.txt (traditional documentation)
+  README(.md) (nowadays thanks to github)
+
+
+Vim offers the :h rtp setting which works for most plugins. Thus adding
+this to your .vimrc should make most plugins work:
+
+  set rtp+=~/.nix-profile/share/vim-plugins/youcompleteme
+  " or for p in ["youcompleteme"] | exec 'set rtp+=~/.nix-profile/share/vim-plugins/'.p | endfor
+
+which is what the [VAM]/pathogen solutions above basically do.
+
+Learn about about plugin Vim plugin mm managers at
+http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html.
+
+The documentation can be accessed by Vim's :help command if it was tagged.
+See vimHelpTags sample code below.
+
+CONTRIBUTING AND CUSTOMIZING
+============================
+The example file pkgs/misc/vim-plugins/default.nix provides both: 
+* manually mantained plugins 
+* plugins created by VAM's nix#ExportPluginsForNix implementation
+
+I highly recommend to lookup vim plugin attribute names at the [vim-pi] project
+ which is a database containing all plugins from
+vim.org and quite a lot of found at github and similar sources. vim-pi's documented purpose
+is to associate vim.org script ids to human readable names so that dependencies
+can be describe easily.
+
+How to find a name?
+  * http://vam.mawercer.de/ or VAM's
+  * grep vim-pi
+  * use VAM's completion or :AddonsInfo command
+
+It might happen than a plugin is not known by vim-pi yet. We encourage you to
+contribute to vim-pi so that plugins can be updated automatically.
+
+
+CREATING DERVITATIONS AUTOMATICALLY BY PLUGIN NAME
+==================================================
+Most convenient is to use a ~/.vim-scripts file putting a plugin name into each line
+as documented by [VAM]'s README.md
+It is the same format you pass to vimrcConfig.vam.pluginDictionaries from the
+usage example above.
+
+Then create a temp vim file and insert:
+
+  let opts = {}
+  let opts.path_to_nixpkgs = '/etc/nixos/nixpkgs'
+  let opts.cache_file = '/tmp/export-vim-plugin-for-nix-cache-file'
+  let opts.plugin_dictionaries = map(readfile("vim-plugins"), 'eval(v:val)')
+  " add more files
+  " let opts.plugin_dictionaries += map(.. other file )
+  call nix#ExportPluginsForNix(opts)
+
+Then ":source %" it.
+
+nix#ExportPluginsForNix is provided by github.com/MarcWeber/vim-addon-vim2nix
+
+A buffer will open containing the plugin derivation lines as well list 
+fitting the vimrcConfig.vam.pluginDictionaries option.
+
+Thus the most simple usage would be:
+
+  vim_with_plugins =
+    let vim = vim_configurable;
+        inherit (vimUtil.override {inherit vim}) rtpPath addRtp buildVimPlugin vimHelpTags;
+        vimPlugins = [
+          # the derivation list from the buffer created by nix#ExportPluginsForNix
+          # don't set which will default to pkgs.vimPlugins
+        ];
+    in vim.customize {
+      name = "vim-with-plugins";
+
+      vimrcConfig.customRC = '' .. '';
+
+      vimrcConfig.vam.knownPlugins = vimPlugins;
+      vimrcConfig.vam.pluginDictionaries = [
+          # the plugin list form ~/.vim-scripts turned into nix format added to
+          # the buffer created by the nix#ExportPluginsForNix 
+      ];
+    }
+
+vim_with_plugins can be installed like any other application within Nix.
+
+[VAM]    https://github.com/MarcWeber/vim-addon-manager
+[vim-pi] https://bitbucket.org/vimcommunity/vim-pi
+*/
+
+
+let
+  inherit (stdenv) lib;
+
+  findDependenciesRecursively = {knownPlugins, names}:
+
+    let depsOf = name: (builtins.getAttr name knownPlugins).dependencies or [];
+
+        recurseNames = path: names: lib.concatMap (name: recurse ([name]++path)) names;
+
+        recurse = path:
+          let name = builtins.head path;
+          in if builtins.elem name (builtins.tail path)
+            then throw "recursive vim dependencies"
+            else [name] ++ recurseNames path (depsOf name);
+
+    in lib.uniqList { inputList = recurseNames [] names; };
+
+  vimrcFile = {
+    vam ? null,
+    pathogen ? null,
+    customRC ? ""
+  }:
+
+    let
+      /* pathogen mostly can set &rtp at startup time. Its used very commonly.
+      */
+      pathogenImpl = lib.optionalString (pathogen != null)
+      (let
+        knownPlugins = pathogen.knownPlugins or vimPlugins;
+
+        plugins = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
+
+        pluginsEnv = buildEnv {
+          name = "pathogen-plugin-env";
+          paths = map (x: "${x}/${vimPlugins.rtpPath}") plugins;
+        };
+      in
+      ''
+        let &rtp.=(empty(&rtp)?"":',')."${vimPlugins.pathogen.rtp}"
+        execute pathogen#infect('${pluginsEnv}/{}')
+      '');
+
+      /*
+       vim-addon-manager = VAM
+
+       * maps names to plugin location
+
+       * manipulates &rtp at startup time
+         or when Vim has been running for a while
+
+       * can activate plugins laziy (eg when loading a specific filetype)
+
+       * knows about vim plugin dependencies (addon-info.json files)
+
+       * still is minimalistic (only loads one file), the "check out" code it also
+         has only gets loaded when a plugin is requested which is not found on disk
+         yet
+
+      */
+      vamImpl = lib.optionalString (vam != null)
+      (let
+        knownPlugins = vam.knownPlugins or vimPlugins;
+
+        toNames = x:
+            if builtins.isString x then [x]
+            else (lib.optional (x ? name) x.name)
+                  ++ (x.names or []);
+
+        names = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
+
+        # Vim almost reads JSON, so eventually JSON support should be added to Nix
+        # TODO: proper quoting
+        toNix = x:
+          if (builtins.isString x) then "'${x}'"
+          else if builtins.isAttrs x && builtins ? out then toNix "${x}" # a derivation
+          else if builtins.isAttrs x then "{${lib.concatStringsSep ", " (lib.mapAttrsToList (n: v: "${toNix n}: ${toNix v}") x)}}"
+          else if builtins.isList x then "[${lib.concatMapStringsSep ", " toNix x}]"
+          else throw "turning ${lib.showVal x} into a VimL thing not implemented yet";
+
+      in assert builtins.hasAttr "vim-addon-manager" knownPlugins;
+      ''
+        let g:nix_plugin_locations = {}
+        ${lib.concatMapStrings (name: ''
+          let g:nix_plugin_locations['${name}'] = "${knownPlugins.${name}.rtp}"
+        '') names}
+        let g:nix_plugin_locations['vim-addon-manager'] = "${knownPlugins."vim-addon-manager".rtp}"
+
+        let g:vim_addon_manager = {}
+
+        if exists('g:nix_plugin_locations')
+          " nix managed config
+
+          " override default function making VAM aware of plugin locations:
+          fun! NixPluginLocation(name)
+            let path = get(g:nix_plugin_locations, a:name, "")
+            return path == "" ? vam#DefaultPluginDirFromName(a:name) : path
+          endfun
+          let g:vim_addon_manager.plugin_dir_by_name = 'NixPluginLocation'
+          " tell Vim about VAM:
+          let &rtp.=(empty(&rtp)?"":','). g:nix_plugin_locations['vim-addon-manager']
+        else
+          " standalone config
+
+          let &rtp.=(empty(&rtp)?"":',').c.plugin_root_dir.'/vim-addon-manager'
+          if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
+            " checkout VAM
+            execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '
+                \       shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
+          endif
+        endif
+
+        " tell vam about which plugins to load when:
+        let l = []
+        ${lib.concatMapStrings (p: "call add(l, ${toNix p})\n") vam.pluginDictionaries}
+        call vam#Scripts(l, {})
+      '');
+
+      # somebody else could provide these implementations
+      vundleImpl = "";
+
+      neobundleImpl = "";
+
+
+  in writeText "vimrc" ''
+  " minimal setup, generated by NIX
+  set nocompatible
+  filetype indent plugin on | syn on
+
+  ${vamImpl}
+  ${pathogenImpl}
+  ${vundleImpl}
+  ${neobundleImpl}
+
+  ${customRC}
+  '';
+
+in
+
+rec {
+  inherit vimrcFile;
+
+  # shell script with custom name passing [-u vimrc] [-U gvimrc] to vim
+  vimWithRC = {vimExecutable, name ? null, vimrcFile ? null, gvimrcFile ? null}:
+    let rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
+    in writeScriptBin (if name == null then "vim" else name) ''
+      #!/bin/sh
+      exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
+      '';
+
+  # add a customize option to a vim derivation
+  makeCustomizable = vim: vim // {
+    customize = {name, vimrcConfig}: vimWithRC {
+      vimExecutable = "${vim}/bin/vim";
+      inherit name;
+      vimrcFile = vimrcFile vimrcConfig;
+    };
+  };
+
+  pluginnames2Nix = {name, namefiles} : vim_configurable.customize {
+    inherit name;
+    vimrcConfig.vam.knownPlugins = vimPlugins;
+    vimrcConfig.vam.pluginDictionaries = ["github:MarcWeber/vim-addon-vim2nix"];
+    vimrcConfig.customRC = ''
+      " Yes - this is impure and will create the cache file and checkout vim-pi
+      " into ~/.vim/vim-addons
+      let g:vim_addon_manager.plugin_root_dir = "/tmp/vim2nix-".$USER
+      if !isdirectory(g:vim_addon_manager.plugin_root_dir)
+        call mkdir(g:vim_addon_manager.plugin_root_dir)
+      else
+        echom repeat("=", 80)
+        echom "WARNING: reusing cache directory :".g:vim_addon_manager.plugin_root_dir
+        echom repeat("=", 80)
+      endif
+      let opts = {}
+      let opts.nix_prefetch_git = "${../../../pkgs/build-support/fetchgit/nix-prefetch-git}"
+      let opts.nix_prefetch_hg  = "${../../../pkgs/build-support/fetchhg/nix-prefetch-hg}"
+      let opts.cache_file = g:vim_addon_manager.plugin_root_dir.'/cache'
+      let opts.plugin_dictionaries = []
+      ${lib.concatMapStrings (file: "let opts.plugin_dictionaries += map(readfile(\"${file}\"), 'eval(v:val)')\n") namefiles }
+
+      " uncomment for debugging failures
+      " let opts.try_catch = 0
+
+      " add more files
+      " let opts.plugin_dictionaries += map(.. other file )
+      call nix#ExportPluginsForNix(opts)
+    '';
+  };
+
+  rtpPath = "share/vim-plugins";
+
+  vimHelpTags = ''
+  vimHelpTags(){
+    if [ -d "$1/doc" ]; then
+      ${vim}/bin/vim -N -u NONE -i NONE -n -e -s -c "helptags $1/doc" +quit!
+    fi
+  }
+  '';
+
+  addRtp = path: derivation:
+    derivation // { rtp = "${derivation}/${path}"; };
+
+  buildVimPlugin = a@{
+    name,
+    namePrefix ? "vimplugin-",
+    src,
+    unpackPhase ? "",
+    configurePhase ? "",
+    buildPhase ? "",
+    path ? (builtins.parseDrvName name).name,
+    addonInfo ? null,
+    ...
+  }:
+    addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
+      name = namePrefix + name;
+
+      inherit unpackPhase configurePhase buildPhase addonInfo;
+
+      installPhase = ''
+        target=$out/${rtpPath}/${path}
+        mkdir -p $out/${rtpPath}
+        cp -r . $target
+        ${vimHelpTags}
+        vimHelpTags $target
+        if [ -n "$addonInfo" ]; then
+          echo "$addonInfo" > $target/addon-info.json
+        fi
+      '';
+    }));
+
+  buildVimPluginFrom2Nix = a: buildVimPlugin ({
+    buildPhase = ":";
+    configurePhase =":";
+  } // a);
+
+  # test cases:
+  test_vim_with_vim_addon_nix_using_vam = vim_configurable.customize {
+   name = "vim-with-vim-addon-nix-using-vam";
+    vimrcConfig.vam.pluginDictionaries = [{name = "vim-addon-nix"; }];
+  };
+
+  test_vim_with_vim_addon_nix_using_pathogen = vim_configurable.customize {
+    name = "vim-with-vim-addon-nix-using-pathogen";
+    vimrcConfig.pathogen.pluginNames = [ "vim-addon-nix" ];
+  };
+
+}
diff --git a/pkgs/misc/vim-plugins/vimrc.nix b/pkgs/misc/vim-plugins/vimrc.nix
deleted file mode 100644
index 4e97d7f1d549..000000000000
--- a/pkgs/misc/vim-plugins/vimrc.nix
+++ /dev/null
@@ -1,203 +0,0 @@
-{stdenv, vimPlugins, vim_configurable, buildEnv, writeText, writeScriptBin}:
-
-  /* usage example::
-     let vimrcConfig = {
-
-       # If you like pathogen use such
-       pathogen.knownPlugins = vimPlugins; # optional
-       pathogen.pluginNames = ["vim-addon-nix"];
-
-       # If you like VAM use such:
-       vam.knownPlugins = vimPlugins; # optional
-       vam.pluginDictionaries = [
-         # load always
-         { name = "youcompleteme"; }
-         { names = ["youcompleteme" "foo"]; }
-         # only load when opening a .php file
-         { name = "phpCompletion"; ft_regex = "^php\$"; }
-         { name = "phpCompletion"; filename_regex = "^.php\$"; }
-
-         # provide plugin which can be loaded manually:
-         { name = "phpCompletion"; tag = "lazy"; }
-       ];
-
-       # if you like NeoBundle or Vundle provide an implementation
-
-       # add custom .vimrc lines like this:
-       customRC = ''
-         set hidden
-       '';
-     };
-     in vim_configurable.customize { name = "vim-with-plugins"; inherit vimrcConfig; };
-
-  */
-
-let
-  inherit (stdenv) lib;
-
-  findDependenciesRecursively = {knownPlugins, names}:
-
-    let depsOf = name: (builtins.getAttr name knownPlugins).dependencies or [];
-
-        recurseNames = path: names: lib.concatMap (name: recurse ([name]++path)) names;
-
-        recurse = path:
-          let name = builtins.head path;
-          in if builtins.elem name (builtins.tail path)
-            then throw "recursive vim dependencies"
-            else [name] ++ recurseNames path (depsOf name);
-
-    in lib.uniqList { inputList = recurseNames [] names; };
-
-  vimrcFile = {
-    vam ? null,
-    pathogen ? null,
-    customRC ? ""
-  }:
-
-    let
-      /* pathogen mostly can set &rtp at startup time. Its used very commonly.
-      */
-      pathogenImpl = lib.optionalString (pathogen != null)
-      (let
-        knownPlugins = pathogen.knownPlugins or vimPlugins;
-
-        plugins = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
-
-        pluginsEnv = buildEnv {
-          name = "pathogen-plugin-env";
-          paths = map (x: "${x}/${vimPlugins.rtpPath}") plugins;
-        };
-      in
-      ''
-        let &rtp.=(empty(&rtp)?"":',')."${vimPlugins.pathogen.rtp}"
-        execute pathogen#infect('${pluginsEnv}/{}')
-      '');
-
-      /*
-       vim-addon-manager = VAM
-
-       * maps names to plugin location
-
-       * manipulates &rtp at startup time
-         or when Vim has been running for a while
-
-       * can activate plugins laziy (eg when loading a specific filetype)
-
-       * knows about vim plugin dependencies (addon-info.json files)
-
-       * still is minimalistic (only loads one file), the "check out" code it also
-         has only gets loaded when a plugin is requested which is not found on disk
-         yet
-
-      */
-      vamImpl = lib.optionalString (vam != null)
-      (let
-        knownPlugins = vam.knownPlugins or vimPlugins;
-
-        toNames = x:
-            if builtins.isString x then [x]
-            else (lib.optional (x ? name) x.name)
-                  ++ (x.names or []);
-
-        names = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
-
-        # Vim almost reads JSON, so eventually JSON support should be added to Nix
-        # TODO: proper quoting
-        toNix = x:
-          if (builtins.isString x) then "'${x}'"
-          else if builtins.isAttrs x && builtins ? out then toNix "${x}" # a derivation
-          else if builtins.isAttrs x then "{${lib.concatStringsSep ", " (lib.mapAttrsToList (n: v: "${toNix n}: ${toNix v}") x)}}"
-          else if builtins.isList x then "[${lib.concatMapStringsSep ", " toNix x}]"
-          else throw "turning ${lib.showVal x} into a VimL thing not implemented yet";
-
-      in assert builtins.hasAttr "vim-addon-manager" knownPlugins;
-      ''
-        let g:nix_plugin_locations = {}
-        ${lib.concatMapStrings (name: ''
-          let g:nix_plugin_locations['${name}'] = "${knownPlugins.${name}.rtp}"
-        '') names}
-        let g:nix_plugin_locations['vim-addon-manager'] = "${vimPlugins."vim-addon-manager".rtp}"
-
-        let g:vim_addon_manager = {}
-
-        if exists('g:nix_plugin_locations')
-          " nix managed config
-
-          " override default function making VAM aware of plugin locations:
-          fun! NixPluginLocation(name)
-            let path = get(g:nix_plugin_locations, a:name, "")
-            return path == "" ? vam#DefaultPluginDirFromName(a:name) : path
-          endfun
-          let g:vim_addon_manager.plugin_dir_by_name = 'NixPluginLocation'
-          " tell Vim about VAM:
-          let &rtp.=(empty(&rtp)?"":','). g:nix_plugin_locations['vim-addon-manager']
-        else
-          " standalone config
-
-          let &rtp.=(empty(&rtp)?"":',').c.plugin_root_dir.'/vim-addon-manager'
-          if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
-            " checkout VAM
-            execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '
-                \       shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
-          endif
-        endif
-
-        " tell vam about which plugins to load when:
-        let l = []
-        ${lib.concatMapStrings (p: "call add(l, ${toNix p})\n") vam.pluginDictionaries}
-        call vam#Scripts(l, {})
-      '');
-
-      # somebody else could provide these implementations
-      vundleImpl = "";
-
-      neobundleImpl = "";
-
-
-  in writeText "vimrc" ''
-  " minimal setup, generated by NIX
-  set nocompatible
-  filetype indent plugin on | syn on
-
-  ${vamImpl}
-  ${pathogenImpl}
-  ${vundleImpl}
-  ${neobundleImpl}
-
-  ${customRC}
-  '';
-
-in
-
-rec {
-  inherit vimrcFile;
-
-  # shell script with custom name passing [-u vimrc] [-U gvimrc] to vim
-  vimWithRC = {vimExecutable, name ? null, vimrcFile ? null, gvimrcFile ? null}:
-    let rcOption = o: file: stdenv.lib.optionalString (file != null) "-${o} ${file}";
-    in writeScriptBin (if name == null then "vim" else name) ''
-      #!/bin/sh
-      exec ${vimExecutable} ${rcOption "u" vimrcFile} ${rcOption "U" gvimrcFile} "$@"
-      '';
-
-  # add a customize option to a vim derivation
-  makeCustomizable = vim: vim // {
-    customize = {name, vimrcConfig}: vimWithRC {
-      vimExecutable = "${vim}/bin/vim";
-      inherit name;
-      vimrcFile = vimrcFile vimrcConfig;
-    };
-  };
-
-  # test cases:
-  test_vim_with_vim_addon_nix_using_vam = vim_configurable.customize {
-    name = "vim-with-vim-addon-nix-using-vam";
-    vimrcConfig.vam.pluginDictionaries = [{name = "vim-addon-nix"; }];
-  };
-
-  test_vim_with_vim_addon_nix_using_pathogen = vim_configurable.customize {
-    name = "vim-with-vim-addon-nix-using-pathogen";
-    vimrcConfig.pathogen.pluginNames = [ "vim-addon-nix" ];
-  };
-}