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
Style spellcheck #71
Style spellcheck #71
Conversation
How can I test it? I tried making a typo but nothing happened (maybe my vim is too old?). |
That's exactly the issue. Seems to work in neovim but not vim 😕 I checked it with |
:( Well, I think getting it to work in plain vim has priority over neovim (even though I like neovim project and I've been planning to switch for some time already). |
Yeah it's not my intention. I want it to work in both. |
Have you set You may find guidelines about testing certain highlight groups under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I test it? I tried making a typo but nothing happened (maybe my vim is too old?).
Have you set
'spell'
? Isspelllang
set toen
or some other language?
Yes I did set set spell
. I observed that SpellRare
doesn't seem to be showing even though I set the spellang to en_au
. I currently have this in .vimrc
and init.vim
set t_Co=16
set termguicolors
colorscheme selenized
set spelllang=en_au
setlocal spell spelllang=en_au
set spell
set nu
syntax on
You may find guidelines about testing certain highlight groups under
:help colortemplate-best-practices
.
I did have a look through that. I noticed a couple of things, for example underlining doesn't seem to work in vim, (and I know you say not to depend on that.
I think the defaults are different which is why it works out of the box in NeoVim. I cannot seem to get the underline or SpellRare
to work.
vim/_hl_groups.colortemplate
Outdated
SpellBad br_red none t=underline,reverse g=undercurl s=red | ||
SpellCap br_red none t=underline,reverse g=undercurl s=red | ||
SpellLocal yellow none t=underline,reverse g=undercurl s=red | ||
SpellRare cyan none t=underline,reverse g=undercurl s=cyan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to start with the spelling taking into consideration #47 (comment)
I noticed I couldn't get underlining in Vim to work, although it seemed to work in Neovim. Also the coloring didn't seem to work for SpellLocal or SpellRare.
I have Neovim v0.4.3 and Vim 8.2.343 my .vimrc has:
set t_Co=16
set termguicolors
colorscheme selenized
syntax on
My Neovim config is the same except that it doesn't have set t_Co=16
because that is not supported. Terminal is Alacritty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a terminal issue? Have you tried with a different terminal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've tried with Alacritty, and Gnome Terminal, kitty and a few others same result across them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, it is worth opening an issue at Vim's repo, or at least ask in Vim users' mailing list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dngray I'd suggest styling other interface elements first and leave this for later, what do you think? In the meantime maybe we'll find someone who can help us with solving it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks more or less what I suggested. Do you need any help, @dngray ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually had time to do this, looking at having a go with it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks more or less what I suggested. Do you need any help, @dngray ?
I tested this, seem to be getting a variety of results. Hmm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So my guess is, not all terminals support undercurl, in the case of alacritty, it will fallback to _.
However I am not sure as to why it does not want to work in Vim with either Gnome Terminal or Alacritty.
Looking at the code colortemplate generates, we see in:
if (has('termguicolors') && &termguicolors) || has('gui_running')
hi SpellBad guifg=NONE guibg=NONE guisp=#fa5750 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=undercurl
hi SpellCap guifg=NONE guibg=NONE guisp=#fa5750 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=undercurl
hi SpellLocal guifg=NONE guibg=NONE guisp=#dbb32d gui=undercurl ctermfg=NONE ctermbg=NONE cterm=undercurl
hi SpellRare guifg=NONE guibg=NONE guisp=#41c7b9 gui=undercurl ctermfg=NONE ctermbg=NONE cterm=undercurl
if s:t_Co >= 256
hi SpellBad ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellCap ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellLocal ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellRare ctermfg=NONE ctermbg=NONE cterm=underline
if s:t_Co >= 16
hi SpellBad ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellCap ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellLocal ctermfg=NONE ctermbg=NONE cterm=underline
hi SpellRare ctermfg=NONE ctermbg=NONE cterm=underline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
reverse,underline
? The style forSpell*
is supposed to beundercurl
, which is rendered as a swiggly underline in GUI Vim and as an underline in TUI.
cterm=undercurl
is guaranteed to work in Vim. It is the right value to use.
I seem as above with cterm=undercurl
.
I've checked that it works, but I think using reverse red is way too intrusive: What about just using underscores like this? SpellBad none none t=underline g=undercurl s=red
SpellCap none none t=underline g=undercurl s=red
SpellLocal none none t=underline g=undercurl s=yellow
SpellRare none none t=underline g=undercurl s=cyan |
#71 (comment) is that in nvim, gvim, vim-qt? |
That's gvim 7.4. When I tried it with terminal Vim, it used underscore instead of wavy line, and it wasn't colored red, but I think we shouldn't color the whole word. |
So yeah, I tested this but unfortunately getting no feedback in regular Vim. I was able to get it working in gVim though. |
Interestingly it works for me in terminal vim, with gnome-terminal and terminator. I guess it may be terminal quirks, so as far as I'm concerned this is good enough. 👍 |
Closes #67