Vim logo vim online Vim Book Ad

basic Tip #284: Mapping to print syntax highlighted buffer in B&W;

 tip karma   Rating 14/5, Viewed by 624 

created:   July 20, 2002 2:26      complexity:   basic
author:   Sean      as of Vim:   6.0

I use this mapping to print syntax highlighted C++ code in B&W;
This tip needs vimscript #233 print_bw.

The mapping is as follows
map <C-p> :color print_bw<CR>:hardcopy<CR>:color sean<CR>:syn on<CR>

Change ":color sean" to whatever is your chosen color scheme.
Need to change line 7 of print_bw from "syntax reset" to "syntax off"
<C-p> on a syntax highlighted buffer turns off syntax highlighting , sets the colors to B&W;, prints the buffer, resets the color scheme and turns on syntax highlighting again.


 rate this tip  Life Changing Helpful Unfulfilling 

<<Turn on syntax coloring in Mac OS X | Don't use the escape key! >>

Additional Notes

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo