Editing
Cursors, selections, movement, find and replace, and what happens on save.
Rip is a plain text editor with the moves you expect, plus a few that come from its syntax tree. secondary means ⌘ on macOS and Ctrl on Linux.
Multiple cursors#
DCtrl+D selects the word under the cursor. Press it again to add the next match. Once you have two matches, K DCtrl+K Ctrl+D drops the last one and takes the next instead. LCtrl+Shift+L selects every match at once.
↑Ctrl+Alt+↑ and ↓Ctrl+Alt+↓ add a cursor on the line above or below. IAlt+Shift+I turns one selection into a cursor at the end of each of its lines. Hold altalt and click to add a cursor anywhere. ⎋Esc returns to one cursor.
Selection#
LCtrl+L selects the line, and ACtrl+A selects the whole file. ↑Alt+↑ grows the selection to the enclosing syntax node: a word, then an expression, then a block. ↓Alt+↓ shrinks it again. Both need a language with a grammar. shiftshift with the arrow, word, line, and page movement keys extends the selection.
Movement#
| Keys | Moves |
|---|---|
| ←Alt+← / →Alt+→ | By word. |
| HomeHome / EndEnd | To the start or the end of the line. |
| HomeCtrl+Home / EndCtrl+End | To the start or the end of the file. |
| PgUpPgUp / PgDnPgDn | By one screen. |
| ]Alt+] / [Alt+[ | To the next or the previous changed hunk. |
| GCtrl+G | To a line number. |
On macOS, ←Ctrl+← and →Ctrl+→ also jump to the ends of the line. ↑Ctrl+↑ and ↓Ctrl+↓ jump to the ends of the file. On Linux, those keys move by word and by paragraph instead.
To move the current line up or down, press ↑Ctrl+Ctrl+↑ or ↓Ctrl+Ctrl+↓ on macOS. On Linux, press ↑Ctrl+Shift+↑ or ↓Ctrl+Shift+↓.
Change text#
| Keys | What happens |
|---|---|
| ZCtrl+Z / ZCtrl+Shift+Z | Undo and redo. |
| DCtrl+Shift+D | Duplicate the line. |
| KCtrl+Shift+K | Delete the line. |
| JCtrl+J | Join the line with the next one. |
| /Ctrl+/ | Comment or uncomment the selection, in languages with a line comment. |
| FAlt+Shift+F | Prettify JSON in the selection, or the whole file when you select no text. |
| ]Ctrl+] / [Ctrl+[ | Indent or outdent. |
| ↩Ctrl+Enter / ↩Ctrl+Shift+Enter | Start a new line below or above. |
| ⌫Alt+Backspace / ⌦Alt+Delete | Delete to the start or the end of the word. |
| ⌫Ctrl+Backspace / ⌦Ctrl+Delete | Delete to the start or the end of the line. |
| ZAlt+Z | Turn soft wrap on or off for this file. |
Prettify JSON#
Press FAlt+Shift+F to format JSON with your indent and tab-size settings. You can also choose Prettify JSON from the Edit menu or command palette. The command works in any file, including an untitled tab.
Select a complete JSON value to format part of a file. With multiple selections, Rip formats each selected value. With no selection, Rip formats the whole file. One undo restores the text before formatting.
Rip preserves key order, number values, and string escapes. If any selected value is invalid JSON, Rip shows an error and leaves all text unchanged.
Find and replace#
FCtrl+F opens the search bar. Type, and Rip highlights every match, up to 100,000. ↩Enter goes to the next match and ↩Shift+Enter to the previous one. From the editor, GCtrl+G and GCtrl+Shift+G do the same on macOS, and F3F3 and F3Shift+F3 on Linux. ⎋Esc closes the bar.
FCtrl+Alt+F opens the replace field. ↩Ctrl+Enter replaces the current match, and ↩Ctrl+Alt+Enter replaces every match the bar found. To search the folder's indexed text files, see Search and traces.
Save#
SCtrl+S saves the file, and SCtrl+Shift+S saves it under a new name. SCtrl+Alt+S saves every open file that has a name. On save, Rip removes trailing whitespace and adds a final newline when the settings below say so.
A file can change on disk while you edit it. Rip merges the two versions and never writes over the change on disk. A deleted file is the exception: a save creates it again. Working with agents explains the merge and the keys for a conflict.
Settings#
| Key | What it changes |
|---|---|
tab-size |
The width of a tab, and the size of one indent. |
indent |
Whether ⇥Tab inserts spaces or a tab. |
soft-wrap |
Whether long lines wrap at the window edge. |
line-numbers |
Whether the gutter shows line numbers. |
relative-line-numbers |
Whether line numbers count from the cursor. |
cursor-blink |
Whether the cursor blinks. |
show-whitespace |
When to draw spaces and tabs: never, always, or in a selection. |
indent-guides |
Whether indent levels get a guide line. |
trim-trailing-whitespace-on-save |
Remove spaces at the end of each line on save. Markdown files keep them, because two spaces end a line. |
ensure-final-newline-on-save |
End the file with a newline on save. |