Re: [Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-27 Thread Marc Weber
Now that that it does make sense to think about moving your .vim config
into nix space it also makes sense to package most commonly used
plugins. Thus if you think a plugin is missing in vimPlugins send me a
private mail and I'll try to include it using the vimp-pi = nix export
when creating the pull request.

If you're using VAM you can create a list of plugins in use by

  :echo keys(g:vim_addon_manager.activated_plugins)

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-27 Thread Arseniy Seroka
I wrote that on github, but will copy-paste here:
1) We have to remove the old code from vim/configurable.nix (I mean the
part of plugins loading
https://github.com/NixOS/nixpkgs/blob/15bb4c20e614ed6835c59c7c9101ee59eacbe473/pkgs/applications/editors/vim/configurable.nix#L7
)

2) Maybe it's a good idea to move `misc/vim-plugins` to
`editors/vim/vim-plugins`?

3) After all of this all write the wiki page about vim in nixos, ok?

4) And I thing we have to rename `dependencies` to smth like
`runtimeDependencies` and make them the same type as `buildInputs`, not the
list of strings. So change in `vimrc` the conversion of deps to strings for
vam, but in nixos make checking the existence of them. There will be more
magic.

-- 
Sincerely,
Arseniy Seroka
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-27 Thread Marc Weber
 4) And I thin[*k*] we have to rename `dependencies` to smth like
 `runtimeDependencies` and make them the same type as `buildInputs`, not the
Well runtimeDependencies could be executable tools. That dependencies
attr only lists vim plugin names. We could flag derivations to be a vim
plugin and traverse the dependenciy tree (runtime/build dependencies),
but that would be more work (cpu wise) probably.

I notice that we can do the same for pathogen: install all dependencies,
thus the interface changed slightly to

pathogen.pluginNames = [...];
and
vim.pluginDictionaries = [..];

and vim-addon-nix will also install all depnedencies.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-26 Thread Marc Weber
Well - it might be desirable - but for other users vim should be the way
they know it - plain simple stupid. Thus forcing a customized vim
behavior on other people is could be a pain.

The first step for letting the users choose is
- create nix code creating .vimrc files
- create vim wrappers which use them, eventually having a different name

This patch implements this:
  http://mawercer.de/tmp/vim-patch

More than that VAM (vim-addon-manager) got a autoload/nix.vim file which
can turn github based plugins (known by vim-pi) into nix derivations.

I'm not sure I should call myself of being a maintainer of anything
within nix, its just what I think will provide greatest value with least
effort. This change was driven by the discussion found here:
https://github.com/jagajaga/nixpkgs/commit/0b9432d5e22fc5453e0b4265ca36d5015cbcaf1c#commitcomment-8305911

The perfect fix (creating a huge package cross language/tool packagce
database) would be a lot more work, putting all vim plugins into nixpkgs
( 5.000 - a lot are no longer used) would be overkill. Thus this
attempt tries to follow the cabal2nix like approach making packaging 
plugins people use easier while supporting enhancements such as
addon-info.json files introduced by VAM containing simple unversioned
dependency information.

The result looks like this illustrating how much the unversioned
dependency management of VAM can simplify your setup:

# test cases:
test_vim_with_vim_addon_nix_using_vam = vim_configurable.customize {
  name = vim-with-vim-addon-nix-using-vam;
  vimrcConfig.vam.plugins = [
{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.plugins = map (x: vimPlugins.${x}) [
# target package:
vim-addon-nix
# dependencies:
vim-addon-completion vim-addon-goto-thing-at-cursor
vim-addon-mw-utils vim-addon-actions vim-addon-errorformats tlib
  ];
};

The depeendency magic is provided by a dependencies = [name1 name2]
attr in vimPlugins.

Please note that all features provided by VAM's vam#Scripts() function
are supported such as loading plugins lazily triggered by you opening
some special particular filetype.

Because pathogen and VAM are supported (sorry no Vundle/ NeoBundel
support yet) this should please the majority. Pathogen has no advantage
over VAM AFAIK - I just added it for completness and because the
discussion mentioned above asked for it.

This mail is for gathering feedback, I'll create a pull request soon.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev