9 cfg = config.programs.vim;
12 options.programs.vim = {
13 enable = lib.mkEnableOption "Vi IMproved, an advanced text";
15 defaultEditor = lib.mkEnableOption "vim as the default editor";
17 package = lib.mkPackageOption pkgs "vim" { example = "vim-full"; };
20 # TODO: convert it into assert after 24.11 release
21 config = lib.mkIf (cfg.enable || cfg.defaultEditor) {
22 warnings = lib.mkIf (cfg.defaultEditor && !cfg.enable) [
23 "programs.vim.defaultEditor will only work if programs.vim.enable is enabled, which will be enforced after the 24.11 release"
26 systemPackages = [ cfg.package ];
27 variables.EDITOR = lib.mkIf cfg.defaultEditor (lib.mkOverride 900 "vim");
28 pathsToLink = [ "/share/vim-plugins" ];