I wrote a function to show some special characters with red color:
function! ShowChar()
set list
set listchars=tab:→\ ,space:·,nbsp:␣,eol:¶
highlight SpecialKey ctermfg=blue ctermbg=red guifg=blue guibg=red
endfunction
map <f5> :call ShowChar()<CR>
When to press f5, the characters -- tab, space, nbsp, eol will be shown with red color, now I want to design a new function key f6, when to press f6 after pressing f5, all the special characters will be shown as previous status, not with red color.
Should I write a new function which called by f6?
SpecialKeyWarningandSpecialKeyNormaland use:h :highlight-link? In your vimrc you linkSpecialKeytoSpecialKeyNormal, inShowChar()you link it toSpecialKeyWarningand when you're done you link again toSpecialKeyNormal? – statox Jul 20 '20 at 12:49execute 'colorscheme' g:colors_name– D. Ben Knoble Jul 20 '20 at 13:23