joshdick / onedark.vim

A dark Vim/Neovim color scheme inspired by Atom's One Dark syntax theme.
MIT License
3.9k stars 529 forks source link

It don't seems to work in iTerm2 #1

Closed jimzenn closed 8 years ago

jimzenn commented 8 years ago

I installed the scheme with iTerm2 and MacVim. In GVim it works well. However, it don't work in iTerm2 as it should. Here's the relevant code in ~/.vimrc

" Basics
set nocompatible " get out of horrible vi-compatible mode [Vundle required]
filetype off " [Vundle required]
set encoding=utf-8

" Font
set guifont=PragmataPro\ for\ Powerline:h16

" Scheme
syntax on " syntax highlighting on
set t_Co=256
set background=dark
colorscheme onedark
let g:onedark_termcolors=256
let g:onedark_terminal_italics=1
joshdick commented 8 years ago

What happens if you omit the set t_Co=256 line?

All of the g:onedark variable declarations need to appear before the colorscheme onedark line for them to have any effect.

You also shouldn't need to set g:onedark_termcolors at all, since 256 is the default.

jimzenn commented 8 years ago

Thanks for your help.

I tried everything I can. It just don't work. Don't work in both Mac Terminal and iterm2. Don't work with MacVim or NeoVim. It only works in MacVim GUI. However, Terminal and iTerm2 do have the same wrong scheme.

Not only this color schemes, none of the color schemes except solarized works the exact way as the preview pics. There are always an apparent difference. Even those Base 16 schemes do not work correctly.

My iterm2 is set to xterm-256. Any idea how this happens?

jimzenn commented 8 years ago

Oh... Finally I got the solution! neoVim has an option: let $NVIM_TUI_ENABLE_TRUE_COLOR=1 and it solves everything.

Though I don't know what this is but it's great!

Thanks anyway :P

joshdick commented 8 years ago

Glad you figured it out!

shangsunset commented 8 years ago

Hey @joshdick ! I installed One Dark.itermcolors, and set the theme to use terminal's color. bui i still cant get the color right. screen shot 2016-02-01 at 10 18 50 am

my config:

syntax enable 
let g:onedark_termcolors=16
colorscheme onedark
set background=dark

any idea where i did wrong? thanks.

@Jim-Zenn I also tried let $NVIM_TUI_ENABLE_TRUE_COLOR=1 as im using neovim, but it didnt work for me. can i see your config regarding to the theme if possible?

joshdick commented 8 years ago

The colors themselves look correct, but if you're wondering why the highlighting doesn't look exactly like it does in my screenshot, it's because I'm using the othree/yajs.vim plugin which has better JavaScript highlighting than stock Vim.

shangsunset commented 8 years ago

got it. thanks for the help!

filipebarros commented 8 years ago

I had to remove the set background=dark for the theme to work. Without it it looks fine