diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 9d07121f4cb4..c10db35a51b9 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -1,14 +1,38 @@ # TODO tidy up eg The patchelf code is patching gvim even if you don't build it.. # but I have gvim with python support now :) - Marc -args: with args; +args@{source ? "latest", ...}: with args; + + let inherit (args.composableDerivation) composableDerivation edf; in -composableDerivation {} { +composableDerivation {} (fix: { name = "vim_configurable-7.3"; - src = args.fetchurl { - url = ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2; - sha256 = "079201qk8g9yisrrb0dn52ch96z3lzw6z473dydw9fzi0xp5spaw"; + enableParallelBuilding = true; # test this + + src = + builtins.getAttr source { + "default" = + # latest release + args.fetchurl { + url = ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2; + sha256 = "079201qk8g9yisrrb0dn52ch96z3lzw6z473dydw9fzi0xp5spaw"; + }; + "vim-nox" = + { + # vim nox branch: client-server without X by uing sockets + # REGION AUTO UPDATE: { name="vim-nox"; type="hg"; url="https://code.google.com/r/yukihironakadaira-vim-cmdsrv-nox/"; branch="cmdsrv-nox"; } + src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-nox-hg-2082fc3.tar.bz2"; sha256 = "293164ca1df752b7f975fd3b44766f5a1db752de6c7385753f083499651bd13a"; }); + name = "vim-nox-hg-2082fc3"; + # END + }.src; + "latest" = { + # vim latest usually is vim + bug fixes. So it should be very stable + # REGION AUTO UPDATE: { name="vim"; type="hg"; url="https://vim.googlecode.com/hg"; } + src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-hg-7f98896.tar.bz2"; sha256 = "efcb8cc5924b530631a8e5fc2a0622045c2892210d32d300add24aded51866f1"; }); + name = "vim-hg-7f98896"; + # END + }.src; }; configureFlags = ["--enable-gui=auto" "--with-features=${args.features}"]; @@ -54,6 +78,7 @@ composableDerivation {} { cscopeSupport = config.vim.cscope or false; # add .nix filetype detection and minimal syntax highlighting support ftNixSupport = config.vim.ftNix or true; + netbeansSupport = config.netbeans or true; # eg envim is using it }; #--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon @@ -85,4 +110,5 @@ composableDerivation {} { homepage = "www.vim.org"; }; -} +}) + diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix new file mode 100644 index 000000000000..b0c70d958217 --- /dev/null +++ b/pkgs/misc/vim-plugins/default.nix @@ -0,0 +1,129 @@ +{fetchurl, stdenv, python, cmake, vim}: + +/* +About Vim and plugins +===================== +Let me tell you how Vim plugins work, so that you can decide on how to orginize +your setup. + +typical plugin files: + + plugin/P1.vim + autoload/P1.vim + ftplugin/xyz.vim + doc/plugin-documentation.txt + 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/vim-plugins/YouCompleteMe + " or for p in ["YouCompleteMe"] | exec 'set rtp+=~/.nix-profile/vim-plugins/'.p | endfor + +Its what +pathogen, vundle, vim-addon-manager (VAM) use. + +VAM's benefits: +- works around after/* directories if they are used in non ~/.vim locations +- allows activating plugins at runtime, eg when you need them. (works around + some au command hooks, eg required for TheNerdTree plugin) +- VAM checkous out all sources (vim.sf.net, git, mercurial, ...) +- runs :helptags on update/installation only. Obviously it cannot do that on + store paths. + +VAM is made up of +- the code loading plugins +- an optional pool (github.com/MarcWeber/vim-addon-manager-known-repositories) + +That pool probably is the best source to automatically derive plugin +information from or to lookup about how to get data from www.vim.org. + +I'm not sure we should package them all. Most of them are not used much. +You need your .vimrc anyway, and then VAM gets the job done ? + +How to install VAM? eg provide such a bash function: + + vim-install-vam () { + mkdir -p ~/.vim/vim-addons && git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager.git ~/.vim/vim-addons/vim-addon-manager && cat >> ~/.vimrc <