Code Monkey home page Code Monkey logo

led's Introduction

led

led is an ed clone written in lua!

What is ed?

ed is a very old text editor, made in 1969. You can think of it as a "cli text editor", or a line editor if you will. What i mean by that is that you write a command/some text and hit enter. That's it. That's the entire UI.

Why did you make this?

Is this a practical editor? Probably not, but was it fun to make? Yes!

I made this for mainly two reasons:

  • As a practice project so i can get some experience with lua and understand it better.
  • Because i find the fact that you can edit text files through a complete cli interface very interesting, since you don't have anything like a cursor to move around or a status bar or anything of that sort.

How to use

Make sure you have lua installed. After that, go into the directory where led.lua is located and do,

lua led.lua

Alternatively, you could set up an alias if you want,

alias led='lua ~/path/to/file/led.lua'

Functions

  • Open/Close files
  • Make/Rename files
  • Add/Change/Delete lines
  • Check all the lines, or just the current line
  • Move between lines
  • Yank/Paste lines
  • Undo
  • Write/Quit files
  • Clear screen (no cli program is complete without this)

Limitations

  • Unlike ed, you can't work with a range of lines, this means you can't delete lines in bulk, etc.
  • The undo command has a history of 1. If you do one command and then do another command, the first one is lost. Also, keep in mind that it only works for -> add/change/delete/pasting lines.
  • Since undo is here, you'd probably expect redo to be a function too, but sadly it's not... as of now. I may implement it in the future.

Cheatsheet

Cheatsheet

License

This project is licensed under the GPL 3.0 License - see the License file for details


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.