~fancycade/tox.cr

Minimalist Text Editor written in Crystal
Changed scripts to commands + no-debug for release
Add bounds detection for kill line
Add bounds detection for cursor down

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~fancycade/tox.cr
read/write
git@git.sr.ht:~fancycade/tox.cr

You can also use your local clone with git send-email.

tox.cr

Minimalist text editor written in Crystal using the Termbox library.

Port of my original implementation in C

Want this to be a hackable text editor. Personally found it hard to hack advanced features in C. This is my first app in Crystal and thoroughly enjoyed it.

I feel that the Ruby style makes this more enjoyable to hack on, and Crystal gives me a small compiled binary and speed.

Make

Install

shards install

Build

Dev

make dev
crystal build editor.cr

Prod

make prod
crystal build --release editor.cr -o txc

Usage

Dev

./editor *filepath*

Prod

./txc *filepath*

Install

Add these lines to your ~/.bashrc:

Add project path to your bin:

export PATH=$PATH:/home/shiba/projects/tox.c/ 

To make txc your default terminal editor:

export EDITOR="txc"

Usage

Commands:

  • Ctrl+Q: Quit
  • Ctrl+S: Save
  • Ctrl+A: Cursor Start of Row
  • Ctrl+E: Cursor End of Row
  • Ctrl+Z: Shift Screen Up
  • Ctrl+V: Shift Screen Down
  • Ctrl+K: Kill line after cursor into copy buffer
  • Ctrl+Y: Yank line from copy buffer

License

Fancy Cade hereby disclaims all copyright interest in the program tox.cr (which edits text in the terminal) written by fancycade.

fancycade 2019

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.