Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ergusto opened this issue Sep 26, 2019 · 5 comments

Comments

@ergusto
Copy link

ergusto commented Sep 26, 2019

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.

@ergusto ergusto closed this as completed Oct 1, 2019
@bunnyfly
Copy link

@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
Copy link
Author

ergusto commented Nov 27, 2019

@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
Copy link

bunnyfly commented Nov 27, 2019 via email

@JLL32
Copy link

JLL32 commented May 30, 2020

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

@sonph
Copy link
Owner

sonph commented Jun 11, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants