Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

Support for nvim

Open k4j8 opened this issue 5 years ago • 6 comments

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

k4j8 avatar Sep 29 '19 21:09 k4j8

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.

oskarsh avatar Apr 21 '20 11:04 oskarsh

Good point. I have vim-colors-solarized installed, which changes the rest of my colors automatically when I change the background.

k4j8 avatar Apr 21 '20 13:04 k4j8

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.

oskarsh avatar Apr 21 '20 15:04 oskarsh

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.

H-M-H avatar Aug 12 '21 08:08 H-M-H

Another option is to have Neovim automatically set background based on the time of day: https://github.com/polyzen/dotfiles/commit/b79b154061f0e9bdfe580d5711b1666bde154f6f#diff-3145d4c1195c26bb0f804ae72cf2a1a86c43f4614bdd76dc9c72c7459c765dff

polyzen avatar Aug 12 '21 15:08 polyzen

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

mayapony avatar Jul 11 '23 02:07 mayapony