Comments (3)
Hi @SevereOverfl0w, setting background
only works if the color scheme uses the same foreground colors for both light and dark, i.e. solarized, which doesn't give the desired contrast for readability. Onehalf uses lighter foreground colors for dark theme and darker foreground colors for light theme.
You can think of this as white on black (dark) and black on white (light), versus gray on white or gray on black.
If you want to achieve similar functionality to the plugin, I think it's simply a matter of replacing set background=(light|dark)
with colorscheme (onehalflight|onehalfdark)
.
from onehalf.
As a workaround, I wrote this to automatically switch the scheme when '&background' changes:
augroup myColourschemes
autocmd!
augroup end
autocmd myColourschemes colorscheme * let colorSch =
\ get(g:, 'colors_name', 'default')
Plug 'sonph/onehalf', {'rtp': 'vim/'}
function! s:onehalfSwapLightDark()
if g:colorSch =~? "dark"
colorscheme onehalflight
else
colorscheme onehalfdark
endif
endfunction
function! s:setOnehalfColourSwapAutocmd()
au myColourschemes OptionSet background if g:colorSch =~? "onehalf" | call <sid>onehalfSwapLightDark() | endif
endfunction
" When using onehalf, set up an autocmd to change colourscheme when
" 'background' option is set (e.g. with `yob`)
au myColourschemes ColorScheme onehalf* call <sid>setOnehalfColourSwapAutocmd() | au! myColourschemes ColorScheme onehalf*
from onehalf.
Hi @SevereOverfl0w, setting
background
only works if the color scheme uses the same foreground colors for both light and dark
I apologize for necroposting, but that is simply not true. Could be that it was true at some point, but I couldn't find when that point was.
To quote help pages for background
option:
This option does NOT change the background color, it tells Nvim what
the "inherited" (terminal/GUI) background looks like.
Moreover:
When a color scheme is loaded (the "g:colors_name" variable is set)
setting 'background' will cause the color scheme to be reloaded. If
the color scheme adjusts to the value of 'background' this will work.
Basically, colorscheme needs to read &background
and uses the corresponding palette to just work.
from onehalf.
Related Issues (20)
- Vim lightline seems missing onehalflight option HOT 1
- Is this project still maintained? HOT 1
- St support? HOT 1
- Comments bg color acts strangely HOT 4
- add rxvt-unicode/urxvt
- Add Theme for Logsec
- How do I get the extra colour themes? HOT 1
- Please add onehalf theme for RStudio
- NeoVim compared to VSCode (dimmer colors with wrong? colors)
- (Vim) Wrong colors for `ctermfg` and `guifg` for `highlight SpecialKey` but not `highlight LineNr`
- Vis editor support
- Ideal font for onehalf theme HOT 1
- Jetbrains Support HOT 1
- deepin terminal support
- add installation in vim with packer
- Visual Studio support
- Logseq
- Why is it called One _Half_ and what is the difference from Atom's "One"?
- Helix editor
- Suggestion: add bright and faint colours
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onehalf.