summaryrefslogtreecommitdiff
path: root/modules/programs
diff options
context:
space:
mode:
authorBrandon Kase <brandon.kase@gmail.com>2017-03-05 15:48:56 -0800
committerBrandon Kase <brandon.kase@gmail.com>2017-03-06 20:41:56 -0800
commitb26de8a84eced778d79baa8f94c64af483b56e4e (patch)
tree592a469775f92d03d413645a3b7605c5604b274a /modules/programs
parent395ee139c4d17d7947efdaa12e949a6c620c45f0 (diff)
Add ability to load custom vim plugins
Diffstat (limited to 'modules/programs')
-rw-r--r--modules/programs/vim.nix28
1 files changed, 27 insertions, 1 deletions
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 = [];