vim-one
vim-one copied to clipboard
Strange background color.
Hello, I've been trying to figure out what is causing this issue when trying to use your color scheme. Applying the color scheme with set background=dark ends up looking like this.
https://i.imgur.com/jUCpuei.png
I have tried with 2 terminals, gnome-terminal and urxvt. both have 256 color support enabled.
I have tried creating a new vim install in a vm to verify it's not my personal configuration causing an issue.
output of vim --version https://hastebin.burningsmile.tech/wosocugasi.diff
Thanks,
Try putting this in your .vimrc before colorscheme one
:
set termguicolors
or, the longer version:
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
Regardless, it must be before the colorscheme declaration.
Seems that didn't work on my side, is it something to do with the fact that I'm running a Tmux session?
yeah, probably because of the tmux. try vim without tmux?
Tested that last night, it results in this mess. Though it only happens with when the codeblock above is set. However my assumption is that that is due to my terminal color scheme. As when I load it in gnome-terminal the error is not present and colors look correct.
https://i.imgur.com/FicLxTc.png
Oh, wow. Have you tried the same thing with other terminals? Though since you said you were using urxvt and gnome-terminal, it shouldn't happen.
can you post your .vimrc
?
Yeah, gnome-terminal works fine. Here is the ~/.vimrc.
https://hastebin.burningsmile.tech/apexefacoz
Try putting syntax on
right after call plug#end()
So it seems the black background color only apperars if the following conditions are met
- rxvt-unicode-256 is used.
- tmux is used in combination with eaither rxvt-unicode-256 or gnome-terminal.
gnome-terminal on its own is fine
I'm having the exact same issue here, with the black background on iTerm2. it happens inside and outside of tmux. I have played with many iTerm settings but none seem to actually resolve the issue :(
Same result here with iTerm2
I think that iTerm2 supports true colours by default, so the only solution that I can see so far is to setup the colorscheme using the following sequence
set termguicolors " enable true colors support
syntax enable
set background=light
colorscheme one
Make sure that your $TERM
variable is at least xterm-256color
This is my current setup on iTerm2.
@rakr thanks, this work for me
Keeping this issue open, but unfortunately I don't use a linux based computer. If someone in the linux community who uses Vim, gnome terminal and this theme can help that would be great.
@BurningSmile are you still having this issue with linux, gnome-terminal, tmux, and vim? I just fixed it and can provide help :)
@joshnroy Yup still having the issue since the last time i tested it, just tried with the newest copy of the theme. How did you go about fixing it?
I have the same issue as @BurningSmile using iTerm2, Build 3.1.6 with Vim v.8.0 and without tmux. Just a black background.
My config here.
au ColorScheme one hi Normal ctermbg=None
Another way to disable weird background color is to add line mentioned above to .vimrc
before colorscheme one
Using au ColorScheme one hi Normal ctermbg=None
seemed to have worked at first but then I realized it blasted the statusline colors when in insert or visual mode.
This sequence is what worked for me.
set termguicolors
syntax enable
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set background=dark
colorscheme one
I have my esc
mapped so that is why the color sequence starts with \<Esc>
instead of ^[
.
I am using: iTerm2 Build 3.2.7 Vim v8.1.873 Tmux v2.8
This is what the $TERM
variable prints outside Tmux...
$ echo $TERM
xterm-256color
...and inside.
$ echo $TERM
screen-256color
Probably not relevant but this is the sequence for my .tmux.config
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
Finally, I found this repository with iTerm color presets for this colorscheme and everything matches.
Hope it helps someone in the future.
@jmurinello confirmed, these steps work!
I have the exact same issue on MacOS in iTerm2. Switching from the system Vim (/usr/bin/vim) to Homebrew Vim solves the issue. Be aware that the system Vim does not support termguicolors, whereas Homebrew Vim has it (huge version).
$ /usr/bin/vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 13 2019 14:45:40)
Included patches: 1-503, 505-680, 682-1312
Compiled by [email protected]
Normal version without GUI. Features included (+) or not (-):
+acl +extra_search -mouse_netterm -tag_old_static
-arabic -farsi +mouse_sgr -tag_any_white
+autocmd +file_in_path -mouse_sysmouse -tcl
+autochdir +find_in_path -mouse_urxvt -termguicolors
[...]
Be aware that the system Vim does not support termguicolors
@Calvin-Xu Thank you for this. Been searching for hours and I was wondering why none of the popular solutions were working for me.