Skip to content

Commit

Permalink
vim: don't use deprecated vam attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed Jan 6, 2025
1 parent ba9b317 commit 6960b20
Showing 1 changed file with 6 additions and 32 deletions.
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

0 comments on commit 6960b20

Please sign in to comment.