XWiki Standard 9.8.1 Documentation » XWiki Applications Overview » Syntax Highlighting Application

Syntax Highlighting Application

The XWiki Syntax Highlighting application provides CodeMirror based syntax highlighting for:

  • Velocity
  • Groovy
  • JavaScript
  • CSS
  • Python
  • HTML
  • XWiki Macros (Experimental)

In XWiki Standard, syntax highlighting is automatically activated for:

  • page content editor ("Wiki" editing mode)
  • object editor for the following objects:
    • XWiki.StyleSheetExtension objects
    • XWiki.JavaScriptExtension objects
    • XWiki.XWikiSkins objects for all properties with the name ending in .css or .js
    • XWiki.WikiMacroClass objects for the Code property



  • syntax highlighting
  • line numbers
  • active line highlighting
  • tab line indentation and 2 spaces on tab
  • matching and auto-closing brackets, parentheses and quotes
  • matching selection highlighting
  • scroll to undo/redo position
  • trailing whitespace highlighting
  • multiline comment auto indentation on newline
  • find and replace tool with regex support:
    • Press Ctrl+F / Ctrl+Shift+F (while the editor is focused) to search inside the editor


    • Press Ctrl+Shift+R (while the editor is focused) for search and replace


    • Press F3 after searching for something (with the editor focused) in order to scroll to the next result

Matching results are both highlighted in the editor and displayed in the scrollbar so that you can easily get to the next match.


  • fullscreen editing support: press F11 while the editor is focused to enter full screen, then press Esc to exit full screen
The Auto Completion Application provides auto-completion for Velocity and JavaScript, thus enhancing the Syntax Highlighting application's features. 


To disable the syntax highlighting feature, log in as administrator, click the DrawerMenuIcon.png button to open the drawer menu and choose "Administer Wiki".


Next, click on "Other" -> "Syntax Highlighting" in the accordion menu, uncheck the "Enabled" option, then hit "Save". 


Additionally, you may choose one of the 33 themes provided by CodeMirror or change the color to use when highlighting the currently selected word or piece of text.


Bonus: see a related blog post on how pages are rendered with XWiki syntax to format text, create tables, create links, display images, etc.

Search this space