{ config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.modules.vim; in { options.nixfiles.modules.vim = { enable = mkEnableOption "Vim"; rc = mkOption { type = types.str; default = readFile ./rc.vim; description = "Configuration file."; }; plugins = mkOption { type = with types; listOf package; default = with pkgs.vimPlugins; [ editorconfig-vim vim-eunuch vim-nix vim-sensible vim-sleuth vim-surround vim-unimpaired ]; description = "Plugins."; }; }; config = mkIf cfg.enable { hm.stylix.targets.vim.enable = false; programs.vim.package = (pkgs.vim-full.override { cscopeSupport = false; darwinSupport = false; features = "normal"; guiSupport = "gtk3"; luaSupport = false; multibyteSupport = false; netbeansSupport = false; nlsSupport = false; perlSupport = false; pythonSupport = false; rubySupport = false; tclSupport = false; ximSupport = false; }).customize { name = "vim"; vimrcConfig = with cfg; { customRC = rc; packages.myVimPackage.start = plugins; }; }; environment = { systemPackages = [ config.programs.vim.package ]; variables = rec { EDITOR = "vim"; VISUAL = EDITOR; }; }; }; }