Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim: don't use deprecated vam attribute #832

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 6 additions & 32 deletions modules/programs/vim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,11 @@ in
description = "Enable sensible configuration options for vim.";
};

programs.vim.extraKnownPlugins = mkOption {
type = types.attrsOf types.package;
default = {};
example = literalExpression
''
{
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 = [];
example = [ { names = [ "surround" "vim-nix" ]; } ];
description = "VAM plugin dictionaries to use for vim_configurable.";
type = types.listOf (types.either types.str types.attrs);
default = [ ];
example = lib.literalExpression "[ pkgs.vimPlugins.vim-nix ]";
description = "Plugins to use for vim_configurable.";
};

programs.vim.package = mkOption {
Expand Down Expand Up @@ -95,15 +74,10 @@ in
programs.vim.package = pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = config.environment.etc."vimrc".text;
vimrcConfig.vam = {
knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins;
pluginDictionaries = cfg.plugins;
};
vimrcConfig.packages.nix-darwin.start = cfg.plugins;
};

programs.vim.plugins = mkIf cfg.enableSensible [
{ names = [ "fugitive" "surround" "vim-nix" ]; }
];
programs.vim.plugins = mkIf cfg.enableSensible [pkgs.vimPlugins.vim-sensible];

programs.vim.vimOptions.sensible.text = mkIf cfg.enableSensible ''
set nocompatible
Expand Down