changing spelling error highlight

361 views
Skip to first unread message

TheLonelyStar

unread,
Jul 8, 2009, 9:04:46 AM7/8/09
to vim...@googlegroups.com

Hi,

I am currently trying to understand how vim text highlighting works.
The problem is, that strings are violet and spelling errors are highlighted
red. I can not read the string anymore.

What is a quick fix for this problem?

Thanks!
nathan
--
View this message in context: http://www.nabble.com/changing-spelling-error-highlight-tp24391160p24391160.html
Sent from the Vim - General mailing list archive at Nabble.com.

Dominique Pellé

unread,
Jul 8, 2009, 10:01:35 AM7/8/09
to vim...@googlegroups.com
TheLonelyStar wrote:

> Hi,
>
> I am currently trying to understand how vim text highlighting works.
> The problem is, that strings are violet and spelling errors are highlighted
> red. I can not read the string anymore.
>
> What is a quick fix for this problem?
>
> Thanks!
> nathan


In my colorscheme, I have this:

if version >= 700
hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE
ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE
ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellRare guisp=blue gui=undercurl guifg=NONE guibg=NONE
ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellLocal guisp=orange gui=undercurl guifg=NONE guibg=NONE
ctermfg=NONE ctermbg=NONE term=underline cterm=underline
endif


It underlines spelling errors which I find less distracting than changing
color and which interferes less with syntax highlighting.

You can put those lines in your colorscheme or directly in your ~/.vimrc.
It works in a color terminal or in gvim. Color of undercurls when using gvim
depends on the kind of spelling mistake.

If you want try my full colorsheme, installation instructions &
screenshot are at:

http://www.vim.org/scripts/script.php?script_id=2198

-- Regards

TheLonelyStar

unread,
Jul 9, 2009, 10:08:08 AM7/9/09
to vim...@googlegroups.com

Hi,

Thanks for the colorsheme. I tried it and after a few days, I discovered
that plain underlining is not enough for me!
So I tried this:
if version >= 700
hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=red


ctermbg=NONE term=underline cterm=underline
hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE

ctermfg=yellow ctermbg=NONE term=underline cterm=underline


hi SpellRare guisp=blue gui=undercurl guifg=NONE guibg=NONE

ctermfg=yellow ctermbg=NONE term=underline cterm=underline


hi SpellLocal guisp=orange gui=undercurl guifg=NONE guibg=NONE

ctermfg=yellow ctermbg=NONE term=underline cterm=underline

(I also change the fg color).
Works fine, but when current line highlighting is on:
setlocal cursorline

Spelling mistakes in the current line do not have a different color ...

How can I fix this?
Thanks!

Nathan
--
View this message in context: http://www.nabble.com/changing-spelling-error-highlight-tp24391160p24410512.html

Tony Mechelynck

unread,
Jul 10, 2009, 10:01:28 PM7/10/09
to vim...@googlegroups.com
On 09/07/09 16:08, TheLonelyStar wrote:
>
>
> Hi,
>
> Thanks for the colorsheme. I tried it and after a few days, I discovered
> that plain underlining is not enough for me!
> So I tried this:
> if version>= 700
> hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=red
> ctermbg=NONE term=underline cterm=underline
> hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE
> ctermfg=yellow ctermbg=NONE term=underline cterm=underline
> hi SpellRare guisp=blue gui=undercurl guifg=NONE guibg=NONE
> ctermfg=yellow ctermbg=NONE term=underline cterm=underline
> hi SpellLocal guisp=orange gui=undercurl guifg=NONE guibg=NONE
> ctermfg=yellow ctermbg=NONE term=underline cterm=underline
>
> (I also change the fg color).
> Works fine, but when current line highlighting is on:
> setlocal cursorline
>
> Spelling mistakes in the current line do not have a different color ...
>
> How can I fix this?
> Thanks!
>
> Nathan

What is your CursorLine highlight?

:verbose hi CursorLine

Maybe you should tweak it? Maybe something like (assuming white for the
default GUI background)

hi CursorLine cterm=NONE,underline ctermbg=NONE ctermfg=NONE
\ gui=NONE guibg=#F4F4F4 guifg=NONE guisp=NONE

or even the same without ,underline (with the result that the CursorLine
highlight will IIUC appear only in the GUI, not in Console Vim).

Setting a background color by 'cursorline' overrides syntax background
highlighting (but not Search etc.) on the cursor line. I think this is a
limitation of Vim. (I also use 'cursorline' and 'cursorcolumn'; when I
write intentionally incomplete syntax to give it an Error highlight, the
red background only appears once the cursor is moved to another line.
Similarly the yellow background for the word "Note" in helpfiles [there
is one near the bottom of help.txt] disappears when I move the cursor to
it, leaving only the blue foreground. But text I searched for keeps its
yellow BG, and matchparen highlighting, set by a ":3match" command,
keeps its cyan BG.)


Best regards,
Tony.
--
Legalize free-enterprise murder: why should governments have all the
fun?

Reply all
Reply to author
Forward
0 new messages