Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Working with shortcuts #140

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
49 changes: 18 additions & 31 deletions programming-ide/working-shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

Be more productive with Replit by learning the code editor’s powerful shortcuts for editing, writing, and inspecting code.

This documentation demonstrates Windows shortcuts. So, if using a Mac, make use of the `cmd` key instead of the `crtl` key, and make use of the `option` key instead of the `alt` key.

With any of these shortcuts, please ensure that your repl window has been clicked or these shortcuts may access the browser's shortcut keys instead.

## Command Palette

The command palette allows you to view all available commands based on your current context.

To access the command palette, press `F1` or `Ctrl+Shift+P` (`cmd+shift+P` on a Mac). **Note:** If you are using Firefox, `Ctrl+Shift+P` will open an incognito window, so use the `F1` option instead.
To access the command palette, press `F1` or `Ctrl+Shift+P`.

**Note:** If you are using Firefox, `Ctrl+Shift+P` will open an incognito window, so use the `F1` option instead.

![command palette](/images/repls/editor/command_palette.gif)

Expand All @@ -16,81 +22,64 @@ The following keyboard shortcuts can be used in a variety of ways. If you forget

### Moving the Current Line

On a Mac, press `option+up` or `option+down` to move the current line up or down.
Press `alt+up` or `alt+down` to move the current line up or down.

On other computers, press `alt+up` or `alt+down`.

![move line](/images/repls/editor/move_line.gif)

### Clone the Current Line

On a Mac, press `shift+option+up` or `shift+option+down` to clone the current line above or below.
Press `shift+alt+up` or `shift+alt+down` to clone the current line above or below.

On other computers, press `shift+alt+up` or `shift+alt+down`.

![clone line](/images/repls/editor/clone_line.gif)

### Selecting Lines

On a Mac, press `cmd+I` to select a line.
Press `ctrl+L` to select a line.

On other computers, press `ctrl+I`.

![select line](/images/repls/editor/select_line.gif)

### Deleting Lines

On a Mac, press `shift+cmd+K` to delete a line.
Press `ctrl+shift+K` to delete a line.

On other computers, press `ctrl+shift+K`.

![delete line](/images/repls/editor/delete_line.gif)

### Inserting Lines

On a Mac, press `shift+cmd+enter` to insert a line above.
Press `ctrl+shift+enter` to insert a line above.

On other computers, press `ctrl+shift+enter`.

![insert line](/images/repls/editor/insert_line.gif)

### Adding Cursors

On a Mac, press `cmd+option+up` or `cmd+option+down` to add cursors above or below your current line.
Press `ctrl+alt` or `ctrl+alt` and then click with the mouse to add more cursors.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesdanielwhitford - does pressing ctrl+alt do anything on its own? For me (on mac) it only works if I also click. I'd also change "click with the mouse" to "left click" just to make it unambiguous.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sixhobbits Yes that makes sense. It should say ctrl+alt+left click


On other computers, press `ctrl+alt+up` or `ctrl+alt+down`.

![adding cursors](/images/repls/editor/adding_cursors.gif)

### Find

On a Mac, press `cmd+F` to find.
Press `ctrl+F` to find.

On other computers, press `ctrl+F`.

![find](/images/repls/editor/find.gif)

### Replace

On a Mac, press `option+cmd+F` to replace.
Press `ctrl+H` to replace.

On other computers, press `ctrl+H`.

![replace](/images/repls/editor/replace.gif)

### Find Next/Previous

On a Mac, press `cmd+G` to find next or `shift+cmd+G` to find previous.

On other computers, press `F3` to find next or `shift+F3` to find previous.

![find next](/images/repls/editor/find_next.gif)

### Adding Selections to Next Find Match

On a Mac, press `cmd+D` to add a selection to the next find match.
Press `ctrl+D` to select and then `ctrl+F` to add a selection to the next find match.

On other computers, press `ctrl+D`.

![adding selections](/images/repls/editor/adding_selections.gif)

Expand All @@ -100,17 +89,15 @@ Use the following shortcuts to navigate the editor.

### Open Files

On a Mac, press `cmd+P` to quickly open files.
Press `ctrl+P` to quickly open files.

On other computers, press `ctrl+P`.

![Open files](/images/repls/editor/open_files.gif)

### Go to Line

On a Mac, press `cmd+G` to go to a specified line.
Press `ctrl+G` to go to a specified line.

On other computers, press `ctrl+G`.

![go to line](/images/repls/editor/go_to_line.gif)