Editing and archives
Applies to: Rubian 4.0.2; archive commands require host utilities
Updated
Use Rubian's line editor for an existing text file, quick writing for a new note, and host archive tools for packaging host files. Choose an explicit destination before writing.
Edit a text file#
edit('/path/to/notes.txt')
texteditor, multiline_editor and nano also open the Rubian editor. The nano command here uses Rubian's line-oriented controls; GNU nano keyboard shortcuts do not apply.
The editor displays the file and a command prompt. Line numbers start at 1. Changes remain in the editing buffer until you save.
| Editor command | Effect |
|---|---|
:p or :p 2-5 |
Display the buffer or selected line range. |
:g 3 |
Move the insertion position to line 3. |
:i |
Enter insertion mode. A line containing only . ends insertion. |
:i New line |
Insert the supplied text immediately. |
:s 2 Replacement text |
Replace line 2. |
:a 2 New line / :b 2 New line |
Insert after or before line 2. |
:d 2 or :d 2-5 |
Delete a line or range from the buffer. |
:w or :w /path/to/copy.txt |
Save, optionally to another destination. |
:wq |
Save and exit after a successful write. |
:q |
Exit if the buffer has no unsaved changes. |
:q! |
Discard unsaved changes and exit. |
:help |
Display the available controls. |
Commands beginning with : are recognized even during insertion. After saving, read the destination with cat to confirm the content and selected path. A save failure leaves the error visible; resolve the path or permission problem before exiting with unsaved work.
Write a short file or note#
quick_write(path = nil), also named qw, collects several lines. It prompts for a destination if none is supplied. For an existing nonempty file, choose overwrite, append or cancel. Finish input with a blank line or a line containing only .; use Ctrl-C to cancel. A successful operation returns the destination path.
quick_write('/path/to/new-note.txt')
quick_note(path), also named qn, appends one prompted line to a host file. For a session note associated with your working identity, use session_log!.
copy_cat(*paths), also named cc, displays selected file contents and adds them to an available system clipboard. A directory input can include nested host files. Select individual files when you need controlled clipboard contents; this command copies text for reading, rather than creating a filesystem copy. Clipboard integration depends on host clipboard utilities.
Inspect, create and extract an archive#
These commands operate on host files and require the corresponding host utility. Use an empty destination when extracting an archive so its contents can be inspected before they are incorporated into a project.
tar('tzf', '/path/to/package.tar.gz')
This lists a gzip-compressed tar archive without extracting it. Other supported forms are:
| Command | Effect |
|---|---|
tar('czf', '/path/to/package.tar.gz', '/path/to/source') |
Create a gzip-compressed tar archive. Supply flags without a leading dash. |
tar('xzf', '/path/to/package.tar.gz') |
Extract into the current host working directory. |
zip('-r', '/path/to/package.zip', '/path/to/source') |
Create a recursive ZIP archive. |
unzip('/path/to/package.zip', '/path/to/destination') |
Extract a ZIP archive into the supplied directory. |
Check the host utility's result and the resulting files. These wrappers display host-tool output; they do not return a Rubian manifest proving that every desired file was archived. Archive operations do not directly package Rubian-managed files.