red-editor

Crates.iored-editor
lib.rsred-editor
version0.2.1
sourcesrc
created_at2018-09-09 00:37:07.123848
updated_at2018-09-09 21:30:31.195261
descriptionA Rust Editor - red is a line-oriented text editor, based on the popular ed utility.
homepagehttps://github.com/badboy/red
repositoryhttps://github.com/badboy/red
max_upload_size
id83669
size43,262
Engine Devs (github:amethyst:engine-devs)

documentation

README

red - A Rust Editor

red is a line-oriented text editor, based on the popular ed utility. It has two modes: command mode and input mode. In command mode the input characters are interpreted as commands, and in input mode they are interpreted as text.

Some of the history of ed is discussed in the article "Where Vim Came From".

Installation

cargo install red-editor

Usage

$ red file.txt
a
Hello World!
.
w
13
1,$p
Hello World!
q

Available commands

  • q - Quit the editor. If the buffer has changed since the last time it was written, a warning is saved and the editor is not quit. A successive q command will exit.
  • Q - Quit the editor without checking whether changes are unsaved.
  • (.,.)p - Print the addressed lines to standard output.
  • (.,.)n - Print the addressed lines to standard output, preceding each line by its line number and a <tab>.
  • (.,.)d - Delete the addressed lines from the buffer.
  • (.,.)w [file] - Write the addressed lines to the named file. The pathname is remembered for following writes.
  • (.)a - Append text after the addressed line. End text input with a single . in a line.
  • (.)i - Insert text before the addressed line. End text input with a single . in a line.
  • h - Write a short message to standard output that explains the reason for the most recent ?.
  • e [file] - Delete the entire contents of the buffer and read the specified file into the buffer.
  • (.,.)c - Delete the addressed line, then accept input text to replace these lines.
  • (.)r [file] - Read contents of another file and insert into the buffer.
  • (.,.)maddress - Move the addressed lines after the line addressed by address.
  • (.,.)s/RE/replacement/flags - Search the addressed lines for an occurence of RE and substitute either the first or all matched strings with replacement. Supported flags: g to globally substitute instances of RE.

Not (yet) implemented

  • / - Addressing lines by search.
  • (.,.)g/RE/command - Global regular expression search.
  • 'x - Marking lines with a name.

License

MIT. See LICENSE.


This file was written with red.

Commit count: 50

cargo fmt