Try something like this:
:syntax match Error "yourterm"
or (to ignore case and match "Yourterm", "YOURTERM", "yourTerm" etc.):
:syntax match Error "\cyourterm"
... and print with hardcopy
- the term should be highlighted using the Error
highlight rules. (see also this).
Here's a pdf sample printed from my vimrc
, using :syntax match Error "Plug"
:
If the search term is already highlighted using current filetype syntax rules (so the previous command doesn't have any effect), and if you don't have a problem printing the text without those (in black-and-white, so to speak), then: :set ft=
and then syntax match Error "yourterm"
. You'll get black text on white background, with a touch of (probably) red - the highlighted matches.