Yin-Yang
Yin-Yang copied to clipboard
Support for nvim
I have created bash scripts to change programs between light and dark mode. I'm listing lines from these scripts with the intention of adding support for these programs once I understand how Yin-Yang is structured. If someone else wants to add it first, be my guest. The commands below have only been tested on Fedora Linux.
To change nvim to light mode:
sed -i 's/set background=.*/set background=light/g' ~/.config/nvim/init.vim
To change nvim to dark mode:
sed -i 's/set background=.*/set background=dark/g' ~/.config/nvim/init.vim
I tried to add support for nvim however this options only tells vim what the background should look like, it does not change the background itself. I try to come up with a better solution.
Good point. I have vim-colors-solarized installed, which changes the rest of my colors automatically when I change the background.
Ok i tried around and came up with this:
sed -i 's/colo.*/colo shine/g' ~/.config/nvim/init.vim
this would change your theme inside the config to a light theme vise versa it works for a dark theme too. However one would need to restart vim for the changes to take effect.
for f in /tmp/nvim*/0; do
nvr --servername $f -cc 'call SetTheme()'
done
Is what I am using for running instances, where SetTheme does the dark/light switching. nvr is https://github.com/mhinz/neovim-remote.
Another option is to have Neovim automatically set background based on the time of day: https://github.com/polyzen/dotfiles/commit/b79b154061f0e9bdfe580d5711b1666bde154f6f#diff-3145d4c1195c26bb0f804ae72cf2a1a86c43f4614bdd76dc9c72c7459c765dff
I am using darkman and vim-lumen to toggle nvim background
just like this ⬇️
https://github.com/oskarsh/Yin-Yang/assets/62200137/babadb35-d2e6-4935-9b5e-30e3333a0986