---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Syntax editor keyboard shortcuts and actions

# Syntax editor keyboard shortcuts and actions {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

The syntax editor offers keyboard shortcuts and actions to assist in writing
code.
{#r_SyntxEdtrKybrdSrtctsActn__table_wmy_bpl_ss__entry__3}

| Keyboard shortcut or action | Description | Example |
|-|-|-|
| Write code |||
| Scripting assistance Control+Spacebar | Displays a list of valid elements at the insertion point such as: * Class names * Function names * Object names * Variable names {#r_SyntxEdtrKybrdSrtctsActn__ul_uwc_b1h_cs} Double-click an entry to add it to the script. Note: The elements are based on server or client type of script. However, these elements are available based on the UI type you select. For example, spUtil is available for Service Portal client scripts and g_navigation is available for Desktop scripts. |   |
| Enter a period character after a valid class name. | Displays a list methods for the class. Double-click an entry to add it to the script. |   |
| Enter an open parenthesis character after a valid class, function, or method name. | Displays the expected parameters for the class or method. Enter the expected parameters as needed. |   |
| Toggle full screen mode Control+M | Switches between displaying the form with the full screen and displaying it normally. |   |
| Format code * Windows: Control+Shift+B * Mac: Command+Shift+B {#r_SyntxEdtrKybrdSrtctsActn__ul_l3q_2ql_ss} | Formats the selected lines to improve readability. |   |
| Toggle comment * Windows: Control+/ * Mac: Command+/ {#r_SyntxEdtrKybrdSrtctsActn__ul_vfb_gql_ss} | Adds or removes the comment characters `//` from the selected lines. |   |
| Insert macro text 1. In the Script field, type the macro keyword text. For example <kbd class="ph userinput">help</kbd>. 2. Press Tab. {#r_SyntxEdtrKybrdSrtctsActn__ol_jyf_vcg_ts} | Inserts macro text at the current position. |   |
| Search |||
| Start search * Windows: Control+F * Mac: Command+F {#r_SyntxEdtrKybrdSrtctsActn__ul_wr2_cmm_ss} | Highlights all occurrences of a search term in the script field and locates the first occurrence. You can create [regular expressions](http://www.regular-expressions.info/reference.html) by enclosing the search terms between slash characters . For example, the search term <kbd class="ph userinput">/a{3}/</kbd> locates the string aaa . |   |
| Find next * Windows: Control+G * Mac: Command+G {#r_SyntxEdtrKybrdSrtctsActn__ul_gsv_4mm_ss} | Locates the next occurrence of the current search term in the script field. Use Start Searching to change the current search term. |   |
| Find previous * Windows: Control+Shift+G * Mac: Command+Shift+G {#r_SyntxEdtrKybrdSrtctsActn__ul_br2_tmm_ss} | Locates the previous occurrence of the current search term in the script field. Use Start Searching to change the current search term. |   |
| Replace * Windows: Control+E * Mac: Command+E {#r_SyntxEdtrKybrdSrtctsActn__ul_jrb_wmm_ss} | Replaces the next occurrence of a text string in the script field. |   |
| Replace all * Windows: Control+; * Mac: Command+; {#r_SyntxEdtrKybrdSrtctsActn__ul_x32_1nm_ss} | Replaces all occurrences of a text string in the script field. |   |
| Help |||
| Help * Windows: Control+H * Mac: Command+H {#r_SyntxEdtrKybrdSrtctsActn__ul_ljt_mnm_ss} | Displays the list of syntax editor keyboard shortcuts. |   |
| Show description * Windows: Control+J * Mac: Command+J {#r_SyntxEdtrKybrdSrtctsActn__ul_x13_4nm_ss} | Displays API documentation for the scripting element at the cursor's current location. |   |
| Show macros 1. In the Script field, type <kbd class="ph userinput">help</kbd>. 2. Press Tab. {#r_SyntxEdtrKybrdSrtctsActn__ol_pnz_1cg_ts} | Displays the list of available syntax editor macros as text within the script field. |   |
[Table 1. Syntax editor keyboard shortcuts and actions for writing code]

{#r_SyntxEdtrKybrdSrtctsActn__table_wmy_bpl_ss}

