diff options
Diffstat (limited to '')
-rw-r--r-- | modules/common/vim/default.nix | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/modules/common/vim/default.nix b/modules/common/vim/default.nix index 2ee8a0b..3755201 100644 --- a/modules/common/vim/default.nix +++ b/modules/common/vim/default.nix @@ -7,43 +7,37 @@ with lib; let cfg = config.nixfiles.modules.vim; in { - options.nixfiles.modules.vim.enable = mkEnableOption "Vim"; + 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 { - programs.vim.package = with pkgs; - (vim_configurable.override { - features = "normal"; - cscopeSupport = false; - darwinSupport = pkgs.stdenv.isDarwin; - guiSupport = false; - luaSupport = false; - multibyteSupport = false; - netbeansSupport = false; - nlsSupport = false; - perlSupport = false; - pythonSupport = false; - rubySupport = false; - tclSupport = false; - ximSupport = false; - }) - .customize { - name = "vim"; - vimrcConfig = { - customRC = readFile ./rc.vim; - packages.myVimPackage.start = with vimPlugins; [ - editorconfig-vim - vim-eunuch - vim-nix - vim-sleuth - vim-surround - vim-unimpaired - ]; - }; + environment = with config.programs.vim; { + systemPackages = [package]; + variables = rec { + EDITOR = mkOverride 100 "${package}/bin/vim"; + VISUAL = EDITOR; }; - - environment = { - systemPackages = [config.programs.vim.package]; - variables.EDITOR = mkOverride 100 "vim"; }; }; } |