The Common Text Editor
The only editor you'll never need
The Common Text Editor is a text editor that is written in Rust. It uses a binding scheme
that is a mixture between Emacs, Vim, and my own made up ones. It's a great improvement
over older iterations (such as actually reassembling a real editor) but still nothing
incredible.
The previos version was a pretty dated
looking project, and was a buggy mess too. This new version, while not fully production
quality, fixes a lot of the bugs and quirks that the old project had (even if it required
a rewrite to do so). Two biggest improvements were removing a bug where the entire thing
flickered during terminal redraws (every keypress), and adding actual cursor movement, not
just an input buffer. The first one was a side effect of the terminal drawing abstraction
layer that I made, and was fixed by just becoming better and using raw crossterm. The
second one could only be classed as ignorance, since at the point I wanted to add the
actual editing part of the editor, the file content drawing function was one big messy fix,
which made adding editing the way I wanted to pretty hard. This was fixed by just getting
better.
Usage:
- Clone the repository.
- Build using 'cargo build -r' and use the binary in 'target/release/cte'.
- Run with 'cte OPTIONS FILE'.
Features:
- Character by character movement.
- Primitive auto indenting (Like Nano).
- Configuration options with a config file.
- Saving cursor position alongside files (Like Vim).
- Some QoL bindings.
- Anti emacs-pinky technology.
- Full bar customisation.
- Add the ability to make custom themes.
Bindings:
- Ctrl + h/j/k/l ... Moves left/down/up/right (arrow keys also work).
- Ctrl + p/o ....... Scroll up/down.
- Ctrl + t/b ....... Go straight to the top/bottom of the file.
- Ctrl + a/s ....... Go to beginning/end of current line.
- Ctrl + q ......... Quit without saving.
- Ctrl + w ......... Save and quit.
- Ctrl + z ......... Sticks and unsticks the ctrl key.
Config options
- theme ............ Specify the name of the theme you're using.
- bar_bottom ....... Choose wether to have the bar on bottom.
- bar_char ......... Specify a char to use for the bar empty space.
- bar_borders ...... Choose wether to have borders on the bar sections.
- bar_left ......... Specify what to have at the left section of the bar.
- bar_middle ....... Specify what to have at the middle section of the bar.
- bar_right ........ Specify what to have at the right section of the bar.
- show_numbers ..... Choose wether to show line numbers or not.
- num_alignment .... Specify how to align the numbers.
- num_char ......... Specify a char to use for the number bar whitespace.
- num_border ....... Specify a char to use for the number bar border.
- auto_indent ...... Choose wether to activate auto_indent or not.
- increment ........ Specify the amount of lines for Ctrl + p/o to scroll.
- hl_line .......... Choose wether to highlight current cursor line.
- tab_spaces ....... Choose wether to have TAB use spaces instead of tabs.
- tab_width ........ Specify the amount of spaces that tabs display/input as.
- include .......... Specify a file to include along the config. Used for themes.