Skip to content

Keyboard Shortcut List

bobbylight edited this page Sep 23, 2022 · 2 revisions

RSyntaxTextArea is pretty mature so its set of keyboard shortcuts don't change that much, but for the most up-to-date list, check out the following places in the code:

  • RTADefaultInputMap - Keyboard shortcuts for the base RTextArea class. Most common functionality not specific to code editors
  • RSyntaxTextAreaDefaultInputMap - An extension of the RTextArea-specific input map above. Extends and adds behavior specific to editing source code

Actions that are unique and worth calling out are in bold.

Windows

Below is a list of the current set of keyboard shortcuts on Windows:

Shortcut Action Behavior
Shift + Tab Decrease Indent Decreases the indentation of the selected lines
} Close Curly Brace Inserts the closing curly brace and fixes its indentation for languages where curlies denote code blocks
/ Close Markup Tag Completes the closing markup tag for languages that support it (e.g. </html> in HTML)
Ctrl + / Toggle Comment Toggles whether the selected lines are commented out
Ctrl + { Go To Matching Bracket Jumps to the matching bracket in languages where curlies denote code blocks
Ctrl + Subtract Collapse Fold Collapses the fold on the current line
Ctrl + Add Expand Fold Expands the fold on the current line
Ctrl + Divide Collapse All Folds Collapses all folds in the editor
Ctrl + Multiply Expand All Folds Expands all folds in the editor
Ctrl + Shift + Space Insert Template Inserts a code template, if enabled
Home Start of Line Go to the start of the current line
Shift + Home Select to Start of Line Go to the start of the current line and select text
Ctrl + Home Top of Editor Go to the top of the editor
Ctrl + Shift + Home Select to Top of Editor Go to the top of the editor and select text
End End of Line Go to the end of the current line
Ctrl + End End of Editor Go to the end of the editor
Ctrl + Shift + End Select to End of Editor Go to the end of the editor and select text
Alt + Down Move Lines Down Move the selected lines down
Alt + Up Move Lines Up Move the selected lines up
Ctrl + X Cut Cuts selected text
Ctrl + C Copy Copies selected text
Ctrl + V Paste Pastes selected text
Ctrl + Shift + V Paste Clipboard Displays a popup allowing the user to paste from several recent pasted values
Insert Toggle Mode Toggles between insert and overwrite mode
Ctrl + D Delete Line Deletes the current or selected lines
Ctrl + J Join Line Concatenates the current line with the next line
Ctrl + Enter Complete Word Completes the current word based on prior words in the editor with that prefix. Repeatable for earlier words
Ctrl + Z Undo Undoes the last action performed
Ctrl + Y Redo Redoes the last action performed
F2 Next Bookmark Goes to the next bookmarked line
Shift + F2 Prior Bookmark Goes to the prior bookmarked line
Ctrl + F2 Bookmark Current Line Bookmarks the current line
Ctrl + K Next Occurrence Finds the word at the caret position and selects the next occurrence of it
Ctrl + Shift + K Previous Occurrence Finds the word at the caret position and selects the prior occurrence of it

Mac

On Mac the shortcuts are mostly the same, but using Cmd instead of Ctrl. Some navigation actions have slightly different behavior to mimic the behavior of text components on that platform:

Shortcut Action Behavior
Shift + Tab Decrease Indent Decreases the indentation of the selected lines
} Close Curly Brace Inserts the closing curly brace and fixes its indentation for languages where curlies denote code blocks
/ Close Markup Tag Completes the closing markup tag for languages that support it (e.g. </html> in HTML)
Cmd + / Toggle Comment Toggles whether the selected lines are commented out
Cmd + { Go To Matching Bracket Jumps to the matching bracket in languages where curlies denote code blocks
Cmd + Subtract Collapse Fold Collapses the fold on the current line
Cmd + Add Expand Fold Expands the fold on the current line
Cmd + Divide Collapse All Folds Collapses all folds in the editor
Cmd + Multiply Expand All Folds Expands all folds in the editor
Cmd + Shift + Space Insert Template Inserts a code template, if enabled
Cmd + Left Start of Line Go to the start of the current line
Cmd + Shift + Left Select to Start of Line Go to the start of the current line and select text
Cmd + Right End of Line Go to the end of the current line
Cmd + Shift + Right Select to End of Line Go to the end of the current line and select text
Home Top of Editor Go to the top of the editor
Shift + Home Select to Top of Editor Go to the top of the editor and select text
Cmd + Home Top of Editor Go to the top of the editor
Cmd + Shift + Home Select to Top of Editor Go to the top of the editor and select text
End End of Editor Go to the end of the editor
Cmd + End End of Editor Go to the end of the editor
Cmd + Shift + End Select to End of Editor Go to the end of the editor and select text
Alt + Down Move Lines Down Move the selected lines down
Alt + Up Move Lines Up Move the selected lines up
Cmd + X Cut Cuts selected text
Cmd + C Copy Copies selected text
Cmd + V Paste Pastes selected text
Cmd + Shift + V Paste Clipboard Displays a popup allowing the user to paste from several recent pasted values
Insert Toggle Mode Toggles between insert and overwrite mode
Cmd + D Delete Line Deletes the current or selected lines
Cmd + J Join Line Concatenates the current line with the next line
Cmd + Enter Complete Word Completes the current word based on prior words in the editor with that prefix. Repeatable for earlier words
Cmd + Z Undo Undoes the last action performed
Cmd + Y Redo Redoes the last action performed
F2 Next Bookmark Goes to the next bookmarked line
Shift + F2 Prior Bookmark Goes to the prior bookmarked line
Cmd + F2 Bookmark Current Line Bookmarks the current line
Cmd + K Next Occurrence Finds the word at the caret position and selects the next occurrence of it
Cmd + Shift + K Previous Occurrence Finds the word at the caret position and selects the prior occurrence of it