Skip to content

Edit Your First File

By the end of this chapter, you will have changed a real file and verified its saved text after leaving the editor.

Use Linux with the development prerequisites and an xterm, screen or tmux-compatible terminal. Run commands from the repository root. Standard input and output must refer to the same terminal device.

Create a small UTF-8 file and start the nonmodal profile:

printf 'Hello, λ\n' > example.txt
env -u RUBYOPT -u RUBYLIB -u GEM_HOME -u GEM_PATH cargo run --locked -p rur-editor --bin rur-terminal-proof -- --profile nonmodal example.txt

The editor opens that document. Press End, type !, then press Ctrl-X Ctrl-S (Ctrl-X followed by Ctrl-S). The modified indication clears after the current revision is published. Arrow keys move by grapheme; Backspace/Delete remove a whole grapheme. Ctrl-Z undoes and Ctrl-X Ctrl-Z redoes a native edit. Bracketed paste creates one separate undo step.

Press Ctrl-Q to leave. Back at the shell, run cat example.txt; the first line should be Hello, λ!. The original newline remains present. Save preserves admitted BOM, NUL, Unicode and line-ending bytes without normalization.

An existing regular target may be overwritten by explicit Save even if another process changed it. Review the file guarantees before editing files shared with another writer.

Previous: Build and Launch rur | Part | User Guide | Next: Use Commands and Interactions