home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

pass a runtime attrset along with vim plugins

Open teto opened this issue 2 years ago • 0 comments

I've got a pretty fluid neovim setup, e.g, I often add/remove/disable neovim plugins. I sometimes achieve this imperatively via vim-plug/packer and sometimes via nix. One advantage of nix is that disabling removes the cruft.

Right now we can install plugins with an associated config, e.g.:

    programs.neovim.plugins = {
      plugin = gitsigns-nvim;
      config = ''" hello world'';
   }

Having everything written to a single init.vim prevents from using vim mechanisms that can make the config clearer (subjectively), for instance I prefer to add files in the "after" folder rather than using autocommands

    programs.neovim.plugins = {
      plugin = gitsigns-nvim;
      config = ''" hello world'';
      runtime = {
           # implemented with a linFarm 
           "after/git/signs.vim".text =  ''ventrecloque'';
   }

teto avatar Aug 09 '22 15:08 teto