Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions client/modules/IDE/components/KeyboardShortcutModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ function KeyboardShortcutModal() {
const newFileCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + Alt + N` : `${metaKeyName} + ⌥ + N`;
const renameCommand = metaKey === 'Ctrl' ? 'F2' : 'Ctrl + F2';
const selectNextOccurrenceCommand = `${metaKeyName} + D`;
const addCursorAboveCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Alt + Up`
: `${metaKeyName} + ⌥ + Up`;
const addCursorBelowCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Alt + Down`
: `${metaKeyName} + ⌥ + Down`;
const deleteLineCommand = `${metaKeyName} + Shift + K`;
const goToLineCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + Alt + G` : `${metaKeyName} + ⌥ + G`;
const matchingBracketCommand = `${metaKeyName} + Shift + \\`;
const duplicateLineUpCommand =
metaKey === 'Ctrl' ? 'Shift + Alt + Up' : 'Shift + ⌥ + Up';
return (
<div className="keyboard-shortcuts">
<h3 className="keyboard-shortcuts__title">
Expand Down Expand Up @@ -80,6 +95,46 @@ function KeyboardShortcutModal() {
<span className="keyboard-shortcut__command">{renameCommand}</span>
<span>{t('KeyboardShortcuts.CodeEditing.RenameVariable')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{selectNextOccurrenceCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.SelectNextOccurrence')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{addCursorAboveCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.AddCursorAbove')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{addCursorBelowCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.AddCursorBelow')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{deleteLineCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.DeleteLine')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">{goToLineCommand}</span>
<span>{t('KeyboardShortcuts.CodeEditing.GoToLine')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{matchingBracketCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.MatchingBracket')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{duplicateLineUpCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.DuplicateLineUp')}</span>
</li>
</ul>
<h3 className="keyboard-shortcuts__title">
{t('KeyboardShortcuts.General')}
Expand Down
9 changes: 8 additions & 1 deletion translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,14 @@
"CodeEditing": "Code Editing",
"ColorPicker": "Show Inline Color Picker",
"CreateNewFile": "Create New File",
"RenameVariable": "Rename Variable"
"RenameVariable": "Rename Variable",
"SelectNextOccurrence": "Select Next Occurrence",
"AddCursorAbove": "Add Cursor Above",
"AddCursorBelow": "Add Cursor Below",
"DeleteLine": "Delete Line",
"GoToLine": "Go to Line",
"MatchingBracket": "Jump to Matching Bracket",
"DuplicateLineUp": "Duplicate Line Up"
},
"General": "General",
"GeneralSelection": {
Expand Down
Loading