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. K DCtrl+K Ctrl+D skips the current match and takes the next one. 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. shiftshift with any movement key extends the selection.
Movement#
| Keys | Moves |
|---|---|
| ←Alt+← / →Alt+→ | By word. |
| ←Ctrl+← / →Ctrl+→ | To the start or the end of the line. |
| ↑Ctrl+↑ / ↓Ctrl+↓ | 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. |
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. |
| ]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. |
Find and replace#
FCtrl+F opens the search bar. Type, and Rip highlights every match. ↩Enter goes to the next match and ↩Shift+Enter to the previous one. GCtrl+G and GCtrl+Shift+G do the same from the editor. ⎋Esc closes the bar.
FCtrl+Alt+F opens the replace field. ↩Ctrl+Enter replaces the current match, and ↩Ctrl+Alt+Enter replaces every match. To search every file in the folder, see Search and traces.
Save#
SCtrl+S saves the file, SCtrl+Shift+S saves it under a new name, and SCtrl+Alt+S saves every open file. 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. 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. |
ensure-final-newline-on-save |
End the file with a newline on save. |