From 6412cdf137a7b1993473937988648517a06629a9 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2015 13:59:53 +0100 Subject: tv vim: decouple vimrc from ENV --- tv/2configs/vim.nix | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'tv') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index f17443871..b9ee725b8 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -4,33 +4,24 @@ with lib; let out = { environment.systemPackages = [ - vim' + pkgs.vim ]; # Nano really is just a stupid name for Vim. - # Note: passing just pkgs.vim to cvs to not rebuild it all the time nixpkgs.config.packageOverrides = pkgs: { - cvs = pkgs.cvs.override { nano = pkgs.vim; }; - nano = vim'; + nano = pkgs.vim; }; + environment.etc.vimrc.source = vimrc; + environment.variables.EDITOR = mkForce "vim"; + environment.variables.VIMINIT = ":so /etc/vimrc"; }; extra-runtimepath = concatStringsSep "," [ "${pkgs.vimPlugins.undotree}/share/vim-plugins/undotree" ]; - vim' = pkgs.writeScriptBin "vim" '' - #! /bin/sh - set -efu - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/backup - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/cache - ${pkgs.coreutils}/bin/mkdir -p "$HOME"/.vim/undo - export VIMINIT; VIMINIT=':so ${vimrc}' - exec ${pkgs.vim}/bin/vim "$@" - ''; - vimrc = pkgs.writeText "vimrc" '' set nocompatible -- cgit v1.2.3