sonph / onehalf

Clean, vibrant and pleasing color schemes for Vim, Sublime Text, iTerm, gnome-terminal and more.
MIT License
1.78k stars 236 forks source link

Background colour within Vim in iTerm 2 not consistent with screenshots or other editors. #58

Closed ergusto closed 4 years ago

ergusto commented 4 years ago
Screenshot 2019-09-26 at 21 14 59

It works perfectly fine in Sublime, and I love the colour scheme so I'm bummed out that I can't get this to work, but in Vim the background is this sort of dark brown colour and I can't for the life of me figure out why. What I'dl like is to have it mimic this screenshot. I've followed all the instructions in the readme and searched the web for the past few hours to see if it was a more general Vim issue, and can't get it looking like that. I'm using the OneHalfDark.terminal colour scheme found in this repo. It's possible I've configured something wrong but I can't figure out what. Relevant vim settings are all in that screenshot.

bunnyfly commented 4 years ago

@ergusto did you close this because you figured it out or because you gave up on it? I am having the same issue. 256 color is enabled. Other color schemes render fine.

I'm using iTerm2 3.3.0, Tmux 2.9a, neovim 0.3.7. (Also tested with vim 8.0 and not using Tmux, but that still gives the same result.)

image

ergusto commented 4 years ago

@bunnyfly Because I gave up, unfortunately. I tried messing around with it a bit more but couldn't get it looking right, and the sort of off-black background just really ruined the aesthetic for me. I moved onto https://github.com/sainnhe/vim-color-atlantis which I've been using for a while now and I am very happy with it.

bunnyfly commented 4 years ago

Ok. Too bad...onehalf looks so nice 😟 Thank you for the info!

On Wed, Nov 27, 2019 at 2:01 PM Fergus Ruston notifications@github.com wrote:

@bunnyfly https://github.com/bunnyfly Because I gave up, unfortunately. I tried messing around with a bit more but couldn't get it looking right, and the sort of off-black background just really ruined the aesthetic for me. I moved onto https://github.com/sainnhe/vim-color-atlantis which I've been using for a while now and I am very happy with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sonph/onehalf/issues/58?email_source=notifications&email_token=AA5OU4SIB37R23T2BEK4ZJDQV3U43A5CNFSM4I26VOJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFK3MUI#issuecomment-559265361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5OU4WBFNB54YQVW57IA6TQV3U43ANCNFSM4I26VOJA .

JLL32 commented 4 years ago

This happens when using the default vim in macOS. Install vim using homebrew brew install vim, this should solve your problem.

sonph commented 4 years ago

Ya the screenshot looks like its background color is the default 256 color fallback.

In https://github.com/sonph/onehalf/blob/master/vim/colors/onehalfdark.vim I set

let s:black       = { "gui": "#282c34", "cterm": "236" }

And cterm=236 corresponds to 303030 which is a gray color, instead of the blue-ish gui color: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg

I'm not sure what's the current support for true colors in vim, but you should be able to check with

:echo has("termguicolors")

returning 1.

There are plenty of guides on the Internet about true colors in vim. Hope anyone encountering this problem will be able to get your setup working. I have some basic instructions in https://github.com/sonph/onehalf/blob/master/vim/README.md