From 71628d6e356636cef794c6f2fe680cb31f4cab64 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Mon, 27 May 2013 18:29:35 +0200 Subject: vim: supporting multiple sources: - vim-nox: client-server implementation without X - latest: latest mercurial sources (still very stable) - default: latest release vim-plugins: Introduce an area to put vim plugins which are worth adding to nix because they need more effort than just "unpacking". Document that --- pkgs/misc/vim-plugins/default.nix | 129 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 pkgs/misc/vim-plugins/default.nix (limited to 'pkgs/misc') 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 <