> 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

It sounds like you want some sort of syntax highlighting.  It
allows for changing not only the color but the attributes
(bold/italic/underline/undercurl) assuming your display supports
it (gvim does, and some characteristics may be on the terminal
such as bold).

Assuming you have some way to discern your italic text, you can
do things like

:hi Italic gui=italic
:match Italic !/\w*\(/\w\+\)*/!

which will highlight text like /this/ or /compound/strings/ as
italicized.

You can read more at

        :help :hi
        :help :match
        :help :syn-match

and it can be helpful to read some of the syntax-highlighting
files that come with vim in your $VIMRUNTIME/syntax/ especially
for things that do something similar to what you describe.
Particularly, the rst.vim file may have a lot of good stuff in it.

-tim


Reply via email to