From b26de8a84eced778d79baa8f94c64af483b56e4e Mon Sep 17 00:00:00 2001 From: Brandon Kase Date: Sun, 5 Mar 2017 15:48:56 -0800 Subject: [PATCH] Add ability to load custom vim plugins --- modules/programs/vim.nix | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index 67b557d..4a17a1b 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -9,7 +9,10 @@ let vim = pkgs.vim_configurable.customize { name = "vim"; vimrcConfig.customRC = config.environment.etc."vimrc".text; - vimrcConfig.vam.pluginDictionaries = cfg.plugins; + vimrcConfig.vam = { + knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins; + pluginDictionaries = cfg.plugins; + }; }; text = import ../lib/write-text.nix { @@ -39,6 +42,29 @@ in { ''; }; + programs.vim.extraKnownPlugins = mkOption { + type = types.attrsOf types.package; + default = {}; + example = literalExample + '' + { + vim-jsx = pkgs.vimUtils.buildVimPluginFrom2Nix { + name = "vim-javascript-2016-07-29"; + src = pkgs.fetchgit { + url = "git://github.com/mxw/vim-jsx"; + rev = "261114c925ea81eeb4db1651cc1edced66d6b5d6"; + sha256 = "17pffzwnvsimnnr4ql1qifdh4a0sqqsmcwfiqqzgglvsnzw5vpls"; + }; + dependencies = []; + + }; + } + ''; + description = '' + Custom plugin declarations to add to VAM's knownPlugins. + ''; + }; + programs.vim.plugins = mkOption { type = types.listOf types.attrs; default = [];