...[snip]...
>
> > Well, I could replace "<A>" by "<A> + token Txtfmt uses" to get
> > highlighting.
>
> Yes. It would actually be quite simple. Far be it from me, however, to
> discourage someone from writing his own Vim script. Still, if you did
> want the added flexibility of Txtfmt in your files (e.g., being able
> to highlight a piece of text with bold, italic, blue fg, and red bg
> all at the same time), there are at least two simple ways to convert
> your existing files...
>
> -- Method #1 --
> :%s/<A>/\=nr2char(0xE005)/g
> :%s/<B>/\=nr2char(0xE007)/g
> :%s/<D>/\=nr2char(0xE002)/g
> :%s/<E>/\=nr2char(0xE003)/g
> :%s/<\/[ABDE]>/\=nr2char(0xE000)/g
I should have pointed out that the method above assumes that the
Txtfmt tokens are located at 0xE000 (start of Unicode's "Private Use
Area"), which is the default location for a utf-8 encoding. For a
latin1 encoding, on the other hand, the default location is decimal
180. You can determine the token locations used in a Txtfmt buffer by
running :ShowTokenMap (or by setting the start token explicitly with
the txtfmtTokrange option).
Method #2 (below) is preferable to the method outlined above because
it ensures that the correct characters are used, without requiring you
to know or care what they are...
Brett Stahlman
>
> -- Method #2 --
> :set ft=txtfmt
> :%s/<A>/\=Txtfmt_GetTokStr("cred")/g
> :%s/<B>/\=Txtfmt_GetTokStr("cyellow")/g
> :%s/<D>/\=Txtfmt_GetTokStr("cblue")/g
> :%s/<E>/\=Txtfmt_GetTokStr("cgreen")/g
> :%s/<\/[ABDE]>/\=Txtfmt_GetTokStr("c-")/g
>
> The latter method uses a function defined by the Txtfmt plugin; hence,
> you would need to set filetype to txtfmt first...
>
> Brett Stahlman
>
>
>
>
>
> > I looked at writing my onw syntax file, which I found rather complex.
> > And I found the match command which I couldn't get to do what I
> > wanted, probably because I'm no good in regular expressions.
>
> > It should not be too complicated though...
>
> > Thanks anyway!- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--
You received this message from the "vim_use" 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