Skip to content

Keep Several Buffers

By the end of this chapter, you will have created an unassociated buffer, saved it to a chosen path and switched between live documents.

Start the terminal without a file argument. The startup component offers Open File and New Buffer; it has no hidden text buffer. Press b, enter notes, and press Enter. In the nonmodal profile, type a short note. In the modal profile, press i first to enter Insert; Escape returns to Normal.

Ctrl-X Ctrl-S asks for the first path. Enter notes.txt and press Enter. The prompt names the actual target buffer. Ctrl-G cancels an unfinished path prompt. A cancelled or unpublished first Save leaves the buffer unassociated. A published Save associates it with the complete normalized path shown in its label.

Ctrl-X Ctrl-F opens another path. An absent final filename opens empty unsaved text; it does not create the file until Save. Its parent directory must exist. Opening another spelling of an already live normalized path reuses that buffer and its edits instead of rereading the disk.

At startup, choose Open... to select a file or directory. Enter opens the highlighted item; Tab completes a file name or enters a directory to browse its children. Type or paste ~ for your home directory, or ~/... for a path below it. Backspace at an empty leaf returns to the parent. Type . at the start of the leaf to include hidden names. A first interactive / or ~ opens your captured home as ~/; paste a complete absolute path to open it literally. Typing leaf characters filters the copied listing without another directory read.

Ctrl-X b searches all live buffer labels without regard to case. Type parts of the label, highlight a result with Up/Down or Ctrl-N/Ctrl-P, then press Enter. To create a new named buffer, select the separate Create buffer: NAME row. An exact live name suppresses that row; a differently cased name remains a distinct creation choice. Escape or Ctrl-G cancels without switching buffers. After first Save, the buffer's label becomes its complete path. Ctrl-X Ctrl-B opens the inventory: Up/Down highlight a row and Enter activates it. Each buffer retains its own text, history, point, viewport and supported editing state.

Ctrl-X Ctrl-Q toggles editor read-only policy. You can still navigate and issue Save. This policy does not change file permissions or discard unsaved work.

Navigate candidate lists

Alt-x command entry, Ctrl-X b buffer selection and Open... share a bottom panel in either profile. Its header shows the source, query, selected position, total and whether results are still preparing. Three results use one header and three rows; larger lists scroll within at most half the terminal height.

Use Down/Up or Ctrl-N/Ctrl-P to move the highlight. Page Down/Up move by the rows currently visible. Enter confirms the selected action; Ctrl-G cancels and returns to the current valid target. Backspace removes one query grapheme. Resizing keeps the query and selection. Narrow panels omit complete metadata columns before clipping labels; filenames and query characters that could affect the terminal appear as escapes. Original names remain unchanged.

Edit in panes

In nonmodal Editing, press Ctrl-X 3 to split right or Ctrl-X 2 to split below. In modal Normal or Visual, use Ctrl-W v or Ctrl-W s. Both panes initially show the same buffer, with independent stored points and viewports. A new modal pane starts in Normal; press i after selecting it when you want to insert text.

Click a pane's text to select that pane and position. Drag within it to select a region; crossing into another pane does not extend into its buffer. Status rows, vertical dividers and inventory rows grant no source selection. Saved bytes and undo history still belong to the shared buffer.

Use Ctrl-X o in nonmodal Editing to select the next pane in screen order. Modal Normal/Visual uses Ctrl-W h/j/k/l for directional focus. Alt-x also exposes these commands in the existing protected command entry. Surviving views retain their supported editing states when focus changes.

Use Ctrl-X 0 / Ctrl-W c to close a pane, or Ctrl-X 1 / Ctrl-W o to keep only the current one. Pane closure keeps its buffer open. The final pane cannot close by itself. Ctrl-X + / Ctrl-W = balances dimensions; resize and area balance commands are listed in the pane reference.

Closing a buffer retires every pane view of that buffer only after close is admitted. Retained linked history can refuse a close set that omits another participant; the linked edit chapter demonstrates why.

Ctrl-X 4 f in nonmodal Editing opens a file elsewhere and selects its destination. Ctrl-X 4 b selects a buffer elsewhere through the same candidate list; Ctrl-X 4 Ctrl-O displays it while retaining current focus. In modal editing, invoke open-file-other-pane, switch-buffer-other-pane or display-buffer-other-pane through Alt-x. A refused placement retains an already opened buffer in inventory.

A small terminal shows insufficient geometry while retaining the whole pane tree. Grow it to resume editing, or use the protected command entry to close panes or keep only the current pane. Ctrl-G remains available for cancellation.

Reuse an arrangement after restarting

Open the files you want to arrange, then choose store-layout through Alt-x and enter a name such as work. Nonmodal Editing also offers Ctrl-X r w. Every pane must show a file-backed buffer; saving an arrangement does not save its text edits.

After restarting, choose restore-layout through Alt-x or use Ctrl-X r f in nonmodal Editing and enter the same name. You can restore from the startup screen. Rur reuses open file buffers and keeps their edits, then restores the arrangement, selected leaf and pane dedication. It does not restore point, viewport or custom partition weights.

If a required file is missing or unreadable, the current panes stay intact. Earlier files successfully opened during that attempt remain in the buffer inventory. A terminal too small for a split may restore a Partial arrangement with the selected target and a count of omitted components. Grow the terminal and explicitly restore again to use the saved full arrangement.

The collection lives under $XDG_CONFIG_HOME/rur/named-layouts, falling back to $HOME/.config/rur/named-layouts. A malformed or unreadable collection reports a load failure while ordinary editing remains available.

Previous: Buffers and Panes | Part | User Guide | Next: Inspect and Leave