sued - the shut up editor
sued [file]
sued is a stateless vector-oriented command-based text editor written in Rust, with focus on speed, simplicity, ease of use and staying the hell out of your way. It's inspired by more contemporary editors, such as the ed family (ed, em, ex, vi, Vim, Neovim, etc.).
To be clear, it's a text editor that works on Rust's Vec
type. To be clearer, it's a text editor that works on lines and isn't graphical, like you're probably used to.
This website supports vi
-style key navigation.
k
- Scroll upj
- Scroll downu
- Scroll up by the window heightd
- Scroll down by the window heightg
- Scroll to the startG
- Scroll to the endsued is available on crates.io - you can get it with cargo install sued.
Go to the GitHub page if you want to check out sued for yourself, or if you want to help me work on it.
The following options are available:
file - Specify the name of a file to read. If set, sued will store the file name.
You can view an asciinema demo showing sued in action.
This demo used to be embedded, but I couldn't get it to work right. Plus it kind of spoils the man page-ness of this website.
To run sued, simply run sued
at the command line.
Upon starting sued, you'll be greeted by the startup message.
$ sued
sued v0.17.0 - it's pronounced "soo-ed"
type ~ for commands, otherwise just start typing
Once you're here, you can just begin typing up your text file.
sued will automatically be pushing it onto the file buffer vector.
This text is
getting pushed
onto the file buffer!
If you want to look at your work so far, use the ~show
command.
Commands in sued are, by default, prefixed with ~. (though you can change that)
~show
1│This text is
2│getting pushed
3│onto the file buffer!
Only want to show a little bit of it? Let's specify a range in the ~show
command.
~show 2
2│getting pushed
You can learn more about ranges and Tilde Range Syntax (TRS) in the Tilde Range Syntax section.
Saving is straightforward too. You just enter ~save filename
.
~save sued-test.txt
saved to sued-text.txt
Is the editing experience a bit too seamless? Feel free to set a ~prompt
.
~prompt sued>
sued> ~show
1│This text is
2│getting pushed
3│onto the file buffer!
Let's see if we can make a correction. We'll use the ~replace
command.
sued> ~replace 3
replacing line 3
original line is 'onto the file buffer!'
into the file buffer vector!
replaced
sued> ~show
1│This text is
2│getting pushed
3│into the file buffer vector!
What about replacing only a part of a line instead of the whole line? sued supports regex through the ~substitute
command.
~substitute 3 buffer vector/contents
~show
1│This text is
2│getting pushed
3│into the file contents!
And that's all for this quick overview. Give sued a go and try it out yourself. The full command set awaits you down below.
Tilde Range Syntax (TRS) allows you to specify a range of lines to operate on using simple tilde syntax.
TRS looks like this, using the ~show
command as an example:
~show 1
1│This text is
~show 2~
2│getting pushed
3│onto the file buffer!
~show ~2
1│This text is
2│getting pushed
~show 2~3
2│getting pushed
3│onto the file buffer!
You can use TRS to specify only one line (X)
, all lines including and following a specific line (X~)
, all lines leading up to and including a specific line (~X)
, or a specific range of lines (X~Y)
.
TRS was implemented into sued v0.17.0 as a way to concisely represent line ranges without having to deal with argument trouble, while also making it feel sued-y.
sued supports command history. Use ↑ and ↓ to navigate through it.
All commands start with ~. Run ~ by itself to see a list of commands.
You can change sued's command prefix with ~prefix [prefix]. Replace ~ with your chosen prefix in this case.
All parameters marked "range" use Tilde Range Syntax (TRS).
KEY:
~command arg1/alt_arg2 [optional_arg] - what the command does
~about - display about text
~clear - clear buffer
~copy [range] - copy range or whole buffer to clipboard
~correct - replace most recent line (interactive)
~delete range - immediately delete specified range of lines
~exit - exit sued
~help - display this list
~indent range level - indent a range, negative level will outdent
~insert line - insert text at specified line (interactive)
~nothing - do nothing with the buffer contents
~open [filename] - load file into buffer
~prefix [prefix] - set command prefix
~print [range] - print the contents of the buffer without line numbers
~prompt [prompt] - set input prompt
~reopen - load last opened file into buffer
~replace line - replace specified line (interactive)
~run command - run executable or shell builtin
~runhere command - run executable or shell builtin on file contents
~save [filename] - save buffer to file
~search term - perform regex search in the whole buffer
~show [range] - display the contents of the buffer with line numbers
~substitute line pattern/replacement - perform regex substitution on the specified line
~swap source target - swap two lines
~write filename - write buffer to file without storing filename
I like ed. It's really nice, and the minimalism is really what sells it. I wanted to try my hand at writing a similar text editor, just a lot less complex.
Plus, I don't want to go insane trying to develop a Vim-like editor. Especially not when projects like Helix exist.
ed has a lot of commands, and like I said, I want sued to be more user-friendly.
Furthermore, sued inherits its command prefix (~) from my earlier project, Streakline.
It stands for "shut up editor," which alludes to how not-in-your-way it is.
"soo-ed". Don't pronounce it "sood," it's not a law thing, and has nothing to do with GitHub Copilot. (The context behind that statement is weird.)
Pfft. No. QVSED is a graphical editor with a completely different paradigm, and it isn't a sued replacement. It's just another project.
show
command should support syntax highlighting in a lightweight waysued is still 0.x software and probably isn't going to replace your favourite code editor anytime soon.
And as a line editor, it's not gonna have fancy features like a visual editing pane, complex syntax highlighting, an LSP client, AI assistance, code folding, or pretty much anything that's in VS Code.
sued is not a conventional text editor, it isn't a VS Code replacement, it isn't a Vim or Emacs replacement, it isn't even an ed replacement.
What it is, is sued. It edits text. Thanks and have fun.
Yes.