On 25-Jun-2012 07:16:46 -0700 (PDT), Ben Fritz wrote:
> I see some of these so infrequently that sometimes I forget what they
> mean, so I have this in my .vimrc:
>
> " show example of spelling highlights
> command! SpellLegend noautocmd topleft new |
> \ setlocal buftype=nofile tabstop=8 |
> \ file Spell\ Legend |
> \ call clearmatches() |
> \ silent put =' SpellBad word not recognized' |
> \ call matchadd('SpellBad', 'SpellBad') |
> \ silent put =' SpellCap word not capitalized' |
> \ call matchadd('SpellCap', 'SpellCap') |
> \ silent put =' SpellRare rare word' |
> \ call matchadd('SpellRare', 'SpellRare') |
> \ silent put =' SpellLocal wrong spelling for selected
> region' |
> \ call matchadd('SpellLocal', 'SpellLocal') |
> \ 1d | resize 4 |
> \ setlocal winfixheight |
> \ noautocmd wincmd p
Hey, that's a clever idea! Thanks for sharing. I would prefer a temporary
:echo'ing instead of a permanent scratch buffer, like this:
function! SpellLegend()
for [l:group, l:explanation] in [
\ ['SpellBad', 'word not recognized'],
\ ['SpellCap', 'word not capitalized'],
\ ['SpellRare', 'rare word'],
\ ['SpellLocal', 'wrong spelling for selected region']
\]
echo ''
echon l:group . "\t"
execute 'echohl' l:group
echon 'xxx'
echohl None
echon "\t" . l:explanation
endfor
endfunction
command! -bar SpellLegend call SpellLegend()
-- regards, ingo
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php