# Editing Text

*Lx* keeps common editing actions close at hand.

## Save and undo

| Shortcut | Action |
| --- | --- |
| Ctrl+S | Save |
| Ctrl+Shift+S | Save As |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z | Redo |

## Select text

Drag with the mouse, or hold **Shift** while moving the cursor.

Useful selection shortcuts include:

| Shortcut | Action |
| --- | --- |
| Ctrl+A | Select everything |
| Ctrl+L | Select whole lines |
| Ctrl+Shift+Left | Select to the previous word |
| Ctrl+Shift+Right | Select to the next word |
| Shift+Home | Select to the start of the line |
| Shift+End | Select to the end of the line |

## Work with lines

| Shortcut | Action |
| --- | --- |
| Ctrl+Y | Delete the selected lines |
| Ctrl+Shift+D | Duplicate the selected lines |
| Ctrl+J | Join lines |
| Tab | Indent |
| Shift+Tab | Unindent |
| Ctrl+/ | Add or remove line comments |

Most line actions also work when you have only a cursor and no selection.

## Use more than one cursor

- Press **Ctrl+Alt+Up** or **Ctrl+Alt+Down** to add a cursor on the line above or below.
- Press **Alt+D** to select the next occurrence of the current word or selection.
- Press **Shift+Alt+I** to place a cursor at the end of every selected line.
- Press **Escape** to remove extra cursors.

Typing and editing then apply at every cursor.

## Wrap long lines

Press **Alt+Z** to turn word wrapping on or off. You can also click **Wrap** or **No Wrap** in the status bar.

Wrapping changes how a long line fits on screen. It does not add line breaks to the file.

## Format marked-up text

*Lx* can add or remove markers for bold, italic, underline, and other supported formats. It can also surround selected text as you type.

See [Formatting and Surrounding Text](format_shortcuts.md) and [Auto Surround](auto_surround.md).
