flyfish wrote:
Hi,
i want to set some words in the text file in italic format, but not the
whole file, i use gvim and when i set font from the edit menu, and choose
italic, it will set all words in that file to be italic, but that is not
what i want, how to use command to implement? and i think there is also
problem with setting font bold
Thanks
You will have to define a 'syntax' telling Vim how to decide what it italic,
or bold, or both, or neither. For instance, the HTML syntax
$VIMRUNTIME/syntax/html.vim defines a number of syntax groups for when <a> <i>
<u> </a> </i> </u> tags are encountered (and where), and then it defines a
number of highlight groups for those syntax groups (quoting the GUI part from
memory):
hi default htmlBold gui=bold
hi default htmlItalic gui=italic
hi default htmlUnderline gui=underline
hi default htmlBoldItalic gui=bold,italic
hi default link htmlItalicBold htmlBoldItalic
hi default htmlBoldUnderline gui=bold,underline
hi default link htmlUnderlineBold htmlBoldUnderline
hi default htmlItalicUnderline gui=italic,underline
hi default link htmlUnderlineItalic htmlItalicUnderline
etc. -- there are quite a lot of them. View that syntax file for more
details.; then see
:help usr_44.txt
:help syntax.txt
Best regards,
Tony.
--
Atlee is a very modest man. And with reason.
-- Winston Churchill