4 ms·
Don't set the colorscheme on Vim, set it on your terminal and Vim will honor it. I do that with iTerm2.
by pablasso 11y ago
Don't set the colorscheme on Vim, set it on your terminal and Vim will honor it. I do that with iTerm2.
- gitaarik 11y agoBut you'll have to restart the terminal for that, right?
- JupiterMoon 11y agoUse a modern terminal?
- gitaarik 11y agoUsing a more modern terminal won't make vim magically change it's color scheme.
- JupiterMoon 11y agoIt does for me.
- nevinera 11y agoNothing magical about it, but yes it will. Or rather, vim doesn't need to change its color scheme in order to be displayed in a completely different set of colors, which is what he's talking about. If you change the color mapping of your terminal and vim doesn't immediately reflect that, then your terminal is not applying those changes to that window/tab.
- gitaarik 11y agoFair enough, I just tried it out and it indeed works, I was a bit ignorant ;). I'll see if this will work out for me. Don't know what any pitfalls could be by setting the color scheme in the terminal. At least it's annoying if you use different terminals on different systems, you'll have to configure them separately, you can't put it in your dotfiles repos or something. Thanks anyway, will look into it!
- JupiterMoon 11y agoI keep my terminal's settings in my dotfiles repo... It opens by default in what I've set as the default. I can change on a case by case basis if I want.
- nazri1 11y agoYup! I'm in the same boat as you - need to switch between light and dark theme due to the switch between outdoor/indoor. I run xterm in openbox, with specific placements (geometry setting) for a specific xterm window session. I ended up writing a script to place the xterm windows exactly where I want them so that I don't have to worry about restarting xterm windows and losing the spatial context. It's a hairy perl script that started life about 8 years ago I think. I have two openbox menu configured to start my xterm windows - one for black and one for white background. It also sets an environment variable there so that vim knows what colorscheme to use when it starts. So everytime I switch between indoor/outdoor I do a ":mksession!|quit", followed by alt+f4 to close the xterm window and then hit the openbox menu to reopen the just closed xterm window with the new background color, and resume my vim session with the color scheme adapted to the current background color. I bet using a modern IDE you can get this done with just one or two keystroke heh.
- gitaarik 11y agoNice to hear someone is having the same problem as me :). Your solution sounds nice, you still have to restart things but you kind of automated that part. Maybe I'll end up doing the same, for now I'll try to explore more possibilities. For example, `help remote.txt` could help.
- skeuomorf 11y agoWell, you can use this and not restart the terminal https://github.com/sos4nt/dynamic-colors https://github.com/sos4nt/dynamic-colors
- gitaarik 11y agoThanks, will check it out!