catppuccin / vim

🧋 Soothing pastel theme for Vim
MIT License
233 stars 14 forks source link

Incorrect spelling highlights are not legible #24

Closed bfxfer closed 1 month ago

bfxfer commented 1 month ago

I am using vim 8.0.1763 on RHEL 8.8. Colour scheme is catppuccin_macchiato.

The different spell check highlights are not legible. The highlighted text is illegible in all dark variants -- frappe, macchiato, and mocha. Frappe looks better though. The screeshot below was with :setlocal spell spelllang=en_gb.

Macchiato: illegible highlights

Latte: latte

What's required to make the text legible?

Thanks!

M3nny commented 1 month ago

Would you mind sharing your .vimrc and the terminal you are using?

bfxfer commented 1 month ago
Expand to view vimrc ``` vim " vim configuration file (location: ~/.vimrc). set nocompatible " Don't bother with being vi compatible " Plug plugins manager " Download vim-plug if not present if empty(glob("~/.vim/autoload/plug.vim")) execute '!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.github.com/junegunn/vim-plug/master/plug.vim' endif call plug#begin('~/.vim/plugged') Plug 'bfrg/vim-cpp-modern' Plug 'catppuccin/vim', { 'as': 'catppuccin' } Plug 'dhruvasagar/vim-table-mode' Plug 'editorconfig/editorconfig-vim' Plug 'itchyny/lightline.vim' Plug 'itchyny/vim-gitbranch' Plug 'junegunn/fzf' Plug 'junegunn/fzf.vim' Plug 'junegunn/vim-plug' Plug 'majutsushi/tagbar' Plug 'preservim/vim-markdown' Plug 'tpope/vim-surround' call plug#end() " Navigation nnoremap nnoremap nnoremap nnoremap set splitright " always split to the right set splitbelow " always split at the bottom " Spaces & Tabs set tabstop=4 " number of visual spaces per tab set shiftwidth=4 " number of spaces to shift in >> or << set softtabstop=4 " number of spaces in tab when editing set expandtab " tabs are visual spaces " UI Config set background=dark " dark background, light foreground set t_md= " disable bold fontface set number " show line numbers set relativenumber " show relative number for all but current line set ruler " show line and column numbers set cursorline " highlight current line set backspace=indent,eol,start " allow bksp in diff. cursor positions set scrolloff=2 " always show 2 lines before/after cursor set laststatus=2 " always display status bar filetype indent on " load filetype-specific indent files syntax on " enable syntax color/processing colorscheme catppuccin_macchiato if !has('gui_running') set t_Co=256 endif " True colour support. if exists('+termguicolors') " Some terminals do not set their TERM to xterm. So, we have to manually " set forground and background colours (t_8f and t_8b). " See ':h xterm-true-color' for more details. let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" set termguicolors endif " Search set ignorecase " case insensitive search set smartcase " respecat case only if pattern has UPPER char set incsearch " search as chars are entered set hlsearch " highlight matches set showmatch " highlight matching [{()}] " Plugin configurations " Lightline let g:lightline = {'colorscheme': 'catppuccin_macchiato'} " Tagbar let g:tagbar_width = 33 " width of tagbar in chars let g:tabar_autofocus = 1 " foucs tagbar when opened nmap . :TagbarToggle " FZF let g:rg_command = ' \ rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color=always \ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,rs,go,hs,rb,conf}" \ -g "!{.git,node_modules,vendor,*.o}/*" ' command! -bang -nargs=* Find call fzf#vim#grep(g:rg_command .shellescape(), 1, 0) nnoremap f :GFiles nnoremap F :Files nnoremap b :Buffers nnoremap t :BTags nnoremap T :Tags nnoremap l :BLines nnoremap L :Lines nnoremap s :BCommits nnoremap S :Commits nnoremap m :Marks nmap h :History: nmap H :Helptags! nmap C :Commands let g:fzf_preview_window = ['right:50%:hidden', 'ctrl-/'] " Rust.vim let g:rustfmt_autosave = 1 " Table mode let g:table_mode_corner='|' " generate Markdown-compatible tables ```
M3nny commented 1 month ago

I found that in different terminals with the same settings the highlights were different for the Spell group, now it should be fixed

bfxfer commented 1 month ago

Looks better after applying https://github.com/catppuccin/vim/commit/e4e612c26902de31b0ba5c8ff826230071b6387c. Thanks!

bfxfer commented 1 month ago

But, now the the cursorline highlight colour makes the rest of the highlighted words illegible.

Consider the following test file which illustrates the issue.

// vim: spell spelllang=en_gb norelativenumber cursorline

// Some comments here.
//
// TODO: check how this line looks w/ and w/out cursorline.
// FIXME: same as above
//
// bad speling standalone good
//
// bad speling standalone good
//
// Bad spelling stand-alone good

#include <stdio.h>

int main(void)
{
    printf("Test catppuccin colours\n");
}

Lines 5 and 6 has TODO/FIXME markers which are highlighted in yellow. Lines 8 and 10 has words with incorrect spelling, incorrect capitalization, etc.

Screeshots below (macchiato theme) are with cursorline at different lines as described in this table:

image cursorline position
left blank line
middle TODO
right bad spelling

How the lines look with https://github.com/catppuccin/vim/commit/e4e612c26902de31b0ba5c8ff826230071b6387c

current

How the lines look with this patch

Expand to view patch ``` diff diff --git colors/catppuccin_macchiato.vim colors/catppuccin_macchiato.vim index 1ef4bf2..05f5011 100644 --- colors/catppuccin_macchiato.vim +++ colors/catppuccin_macchiato.vim @@ -71,7 +71,7 @@ call s:hi("Cursor", "NONE", s:base, s:text, "NONE", "NONE") call s:hi("lCursor", "NONE", s:base, s:text, "NONE", "NONE") call s:hi("CursorIM", "NONE", s:base, s:text, "NONE", "NONE") call s:hi("CursorColumn", "NONE", "NONE", s:mantle, "NONE", "NONE") -call s:hi("CursorLine", "NONE", "NONE", s:surface0, "NONE", "NONE") +call s:hi("CursorLine", "NONE", "NONE", s:surface1, "NONE", "NONE") call s:hi("Directory", "NONE", s:blue, "NONE", "NONE", "NONE") call s:hi("DiffAdd", "NONE", s:base, s:green, "NONE", "NONE") call s:hi("DiffChange", "NONE", s:base, s:yellow, "NONE", "NONE") @@ -113,7 +113,7 @@ call s:hi("Title", "NONE", s:blue, "NONE", "bold", "bold") call s:hi("VisualNOS", "NONE", "NONE", s:surface1, "bold", "bold") call s:hi("WarningMsg", "NONE", s:yellow, "NONE", "NONE", "NONE") call s:hi("WildMenu", "NONE", "NONE", s:overlay0, "NONE", "NONE") -call s:hi("Comment", "NONE", s:surface2, "NONE", "NONE", "NONE") +call s:hi("Comment", "NONE", s:subtext0, "NONE", "NONE", "NONE") call s:hi("Constant", "NONE", s:peach, "NONE", "NONE", "NONE") call s:hi("Identifier", "NONE", s:flamingo, "NONE", "NONE", "NONE") call s:hi("Statement", "NONE", s:mauve, "NONE", "NONE", "NONE") ```

new

With this patch:

Can we make this any better?

M3nny commented 1 month ago

The comments are too bright in your version, looking at the catppuccin neovim repo it seems that they are now using overlay0 instead of surface2, so this can be changed, as for the cursorline overwriting the colors I don't think anything can be done.

This is how it would look like with overlay0 on comments: image