Highlight over 350 languages in Libre Office.
Copy and paste your code, select the text or the containing object and go to Format -> Highlight Code