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
5 changes: 3 additions & 2 deletions client/modules/IDE/components/Editor/utils/keymaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
moveLineDown
} from '@codemirror/commands';
import { foldKeymap } from '@codemirror/language';
import { searchKeymap } from '@codemirror/search';
import { searchKeymap, openSearchPanel } from '@codemirror/search';
import { expandAbbreviation } from '@emmetio/codemirror6-plugin';
import { tidyCodeWithPrettier } from './tidier';

Expand Down Expand Up @@ -87,7 +87,8 @@ export const extraKeymaps = [
{ key: 'ArrowRight', run: focusOnReferenceArrow },
indentWithTab,
{ key: 'Ctrl-Shift-ArrowUp', mac: 'Cmd-Ctrl-ArrowUp', run: moveLineUp },
{ key: 'Ctrl-Shift-ArrowDown', mac: 'Cmd-Ctrl-ArrowDown', run: moveLineDown }
{ key: 'Ctrl-Shift-ArrowDown', mac: 'Cmd-Ctrl-ArrowDown', run: moveLineDown },
{ key: 'Ctrl-h', mac: 'Cmd-Alt-f', run: openSearchPanel }
];

export const emmetKeymaps = [{ key: 'Tab', run: expandAbbreviation }];
Expand Down
20 changes: 20 additions & 0 deletions client/modules/IDE/components/KeyboardShortcutModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ function KeyboardShortcutModal() {
const newFileCommand =
metaKey === 'Ctrl' ? `${metaKeyName} + Alt + N` : `${metaKeyName} + ⌥ + N`;
const renameCommand = metaKey === 'Ctrl' ? 'F2' : 'Ctrl + F2';
const moveLineUpCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Shift + Up`
: `${metaKeyName} + Ctrl + Up`;
const moveLineDownCommand =
metaKey === 'Ctrl'
? `${metaKeyName} + Shift + Down`
: `${metaKeyName} + Ctrl + Down`;
return (
<div className="keyboard-shortcuts">
<h3 className="keyboard-shortcuts__title">
Expand Down Expand Up @@ -80,6 +88,18 @@ 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">
{moveLineUpCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.MoveLineUp')}</span>
</li>
<li className="keyboard-shortcut-item">
<span className="keyboard-shortcut__command">
{moveLineDownCommand}
</span>
<span>{t('KeyboardShortcuts.CodeEditing.MoveLineDown')}</span>
</li>
</ul>
<h3 className="keyboard-shortcuts__title">
{t('KeyboardShortcuts.General')}
Expand Down
4 changes: 3 additions & 1 deletion translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@
"CodeEditing": "Code Editing",
"ColorPicker": "Show Inline Color Picker",
"CreateNewFile": "Create New File",
"RenameVariable": "Rename Variable"
"RenameVariable": "Rename Variable",
"MoveLineUp": "Move Line Up",
"MoveLineDown": "Move Line Down"
},
"General": "General",
"GeneralSelection": {
Expand Down
Loading