Edit

This guide describes commands you can use to edit a document efficiently. It assumes you are familiar with the commands described in the Quickstart.

If you have used vim before, these will feel familiar. If not, this guide may feel a little overwhelming. Don't worry! You do not need to memorize all of these commands to use aretext effectively. The best way to learn is to choose a few commands that you think might be useful and practice until they feel comfortable.

Insert and append

In normal mode, type "i" to enter insert mode at the current cursor position. To insert at the position after the cursor, type "a" (short for "append") instead.

To insert at the start of the line, type "I". To append after the end of the line, type "A".

From insert mode, you can return to normal mode by pressing the escape key.

Delete

To delete a single character in normal mode, type "x". (In insert mode, you can use the backspace key instead.)

To delete a line, type "dd" in normal mode. To delete from the cursor to the end of the line, type "D".

There are many delete commands of the form "d", where is one of the cursor movement commands described in Navigation:

Replace

To replace the character under the cursor, type "r" in normal mode, then type the new character.

Change

In aretext, "change" means to delete some text then enter insert mode. This is useful for quickly changing a word or line.

To change the current word under the cursor in normal mode, type "ciw" ("change inner word").

To change the current word under the cursor and trailing whitespace in normal mode, type "caw" ("change a word").

Put and yank

When you delete text, aretext copies it to a hidden buffer. You can then insert the deleted text after the cursor by typing "p" (short for "put") in normal mode. Alternatively, you can type "P" to insert the text before the cursor.

You can copy a line into the buffer by typing "yy" (short for "yank") in normal mode.

If you want to copy/paste using your system's clipboard, you will need to add custom menu commands (see Customization for instructions).

Inserting and joining lines

To start a new line below the cursor and enter insert mode, type "o".

To start a new line above the cursor and enter insert mode, type "O".

To join the current line with the line below, type "J".

Indenting and outdenting

To indent the current line, type ">>".

To outdent the current line, type "<<".

Toggle case

To change the character under the cursor from uppercase to lowercase, or vice versa, type "~".

Selection (visual mode)

To start a selection, type "v" (short for "visual mode"). You can use the same cursor motions as in normal mode to move the end of the selection.

To select entire lines (instead of individual characters), type "V".

You can use the following commands to modify the selected text:

To clear the selection and return to normal mode, press the escape key.

Undo and redo

To undo the last edit, type "u" (short for "undo") in normal mode.

To redo the last edit, press Ctrl-r (short for "redo") in normal mode.

Aretext clears the undo history whenever a document is loaded or reloaded.

Repeat last action (macros)

To repeat the last action, type "." in normal mode. This is useful for avoiding repetitive typing.