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

SyntaxHighlightContent.png

Features

  • 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

      SyntaxHighlightFind.png

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

      SyntaxHighlightReplace.png

    • 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.

Scrollbar.png

  • 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. 

Administration

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

AdministerWikiMenu.png

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

SyntaxHighlightingMenu.png

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.

SyntaxHighlightingAdministration.png

 

Search this space