Buffers and windows

Buffers and windows

Arrange files in splits, move between editor and plugin panes, and resolve files that changed outside Red.

Move between buffers

Ctrl-jOpen the buffer picker
Space SpaceSwitch to the previous buffer
Space n / Space pMove through the buffer list
:bn / :bpSelect the next or previous buffer
:bdDelete the current buffer
:lsList open buffers

Browse directories in a buffer

Run red . or open a directory with :e path/to/dir. Move and search with normal editor keys, press Enter to open an entry, and press - to go to the parent directory. Use R to refresh the listing. Directory buffers are read-only and stay in the buffer list so you can return to them.

Arrange windows and panes

KeysAction
Ctrl-w sSplit horizontally
Ctrl-w vSplit vertically
Ctrl-w h/j/k/lMove between editor windows and docked panes
Ctrl-w H/J/K/LMove the focused window or pane to an outer edge
Ctrl-w >/<Resize horizontally
Ctrl-w +/-Resize vertically
Ctrl-w =Balance splits or restore a pane's original size
Ctrl-w zZoom the focused editor window or pane
Ctrl-w cClose the focused window

You can also drag editor and pane dividers with the mouse. Press Esc during a drag to cancel it.

Handle a file changed on disk

Red reloads a clean buffer when another program changes its file. If the buffer has unsaved edits, Red keeps your text and marks the conflict instead of overwriting either version.

:diffdiskCompare the buffer with the current disk version
:e!Discard local edits and reload from disk
:w fileSave the buffer under another name
:w!Deliberately overwrite the changed disk file

Ordinary :w and :wa don't silently overwrite an external change.