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

Some colors look off in vim #105

Closed k2s09 closed 3 years ago

k2s09 commented 3 years ago

I am using Ubuntu 20.04 in Windows Subsystem for Linux. My terminal is WSLtty. I have the vim color scheme downloaded through vim-plug. I have set onehalfdark as the vim and terminal theme. The terminal type is xterm-256-color. image

image

It should look different. I tried a bunch of stuff. Here is the part from my ~/.vimrc

if exists('+termguicolors')
  let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
  let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
  set termguicolors
endif

" Colorscheme
syntax on
set cursorline
colorscheme onehalfdark
let g:airline_theme='onehalfdark'

Then I used the snipped from Joshdick's onedark repo

"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

" Colorscheme
syntax on
set t_Co=256
set cursorline
colorscheme onehalfdark
let g:airline_theme='onehalfdark'

Either it should look like this, or because of some problem, the part which is supposed to be Blue in color is purple. If there is a fix, pls tell me

sonph commented 3 years ago

Hey @k2s09 did you mean that the set and let keywords should be blue as in the main screenshot?

In that I'm running Sublime Text, not vim. Text editors may use different syntax parsing engines that label the syntactic elements differently. However if you like the blue better, put this in your config:

hi Statement guifg=#61afef ctermfg=75
k2s09 commented 3 years ago

Ahh that's exactly what I was looking for. Thanks a lot!