Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax highlighting when pasting into emails

Im in the situation that I often send small codesnippets and xml-snippets to coworkers and partners via my outlook. Has anyone got a good idea or tool that I can use to have my pastes syntaxhighlighted before I paste them into an email.

I was thinking of an intermediate paste to "$fancytool" and then I would have something to copy that will htmlified so I can copy paste it into the "compose email" window.

Edit-More-info:

Im pasting from windows within a VMWare virtual Machine, it might be eclipse, xmlspy, logfiles and other programs

Even-more-info:

I've seen this link how to do it from Vim. Unfortunately it seldom from vim im copying Code, and my email machine hasnt got any vim. The vmware machines has gvim, but I was hoping for an easier way that pasting to vim, saving to file, opening in internetexplorer and then copy/paste

like image 588
svrist Avatar asked Oct 22 '08 13:10

svrist


1 Answers

Late but I can give an answer that works. You need 2 things

  1. putty
  2. access to some Unix server (With vim)

In putty options, Under window → selection , turn the check box on for

Paste in to clipboard in RTF as well as plain text.

Log on to the server using putty. start vim by typing vim Paste your text (for example XML ) in to vim. enter command mode (of vim by pressing ESC) and type :set syn=xml.

Syntax highlighting kicks in. Copy the text using mouse and paste it into your email.

like image 51
ring bearer Avatar answered Oct 05 '22 11:10

ring bearer