From 19eaf1b39a092ae1bc1c9538ce781cce1643f5c3 Mon Sep 17 00:00:00 2001 From: Craige McWhirter Date: Fri, 8 Nov 2019 12:37:33 +1000 Subject: [PATCH] Added Solarized light/dark switching Switched between light and dark Solarized themes based on the time of day. --- Deployments/vim.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Deployments/vim.nix b/Deployments/vim.nix index 388a909..de92d48 100644 --- a/Deployments/vim.nix +++ b/Deployments/vim.nix @@ -6,7 +6,6 @@ vim_configurable.customize { vimrcConfig.customRC = '' " Preferred global default settings: set number " Enable line numbers by default - set background=dark " Set the default background to dark or light set smartindent " Automatically insert extra level of indentation set tabstop=4 " Default tabstop set shiftwidth=4 " Default indent spacing @@ -38,6 +37,14 @@ vim_configurable.customize { autocmd FilterWritePre * :call TrimWhiteSpace() autocmd BufWritePre * :call TrimWhiteSpace() + " Solarized light during the day, solarized dark during the night + let hour = strftime("%H") + if 7 <= hour && hour < 17 + set background=light + else + set background=dark + endif + " Transparent editing of gpg encrypted files. " By Wouter Hanegraaff augroup encrypted