Skip to content

yesco/imacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imacs

Have a relase demo of "emacs" for esp8266

Help text, loaded by default

  imacs - possibly the worlds smallest emacs clone!
  (imacs said in Swedish sounds like [eeemacs])
  (c) 2015 Jonas S Karlsson
  It's an one file embeddable device emacs in
  about 200+ lines c code.

  Usage: ./imacs file.txt

  Help
  ====
  char    forward: ^B      back: ^F
  delete  forward: DEL     back: ^D
  pages      down: ^V        up: ESC V
  file        top: ESC <    end: ESC >
  lines      prev: ^P      next: ^N
  lines beginning: ^A       end: ^E
  newline   after: ^O    before: RET

  delete line after cursor: ^K
  exit: ^X^C ^X^Z ^X^F
  redraw: ^L
  eval: ^X^E (it has integration with [esp-lisp](https://github.com/yesco/esp-lisp))

  TAB indents cleverly, newline too
  1. return will create new line and indent like previous line
  2. tab will indent an empty line to the line above
  3. tab pressed anywhere on a line that start with spaces will not
     mess with it, just move cursor to beginning of text (after space)
  4. another press on tab will then indent an additional 2 spaces each time

  Why
  ===
  Support simple editing on embedded systems ala ESP8266 wifi device,
  on speeds like 115200 baud

  Limitations
  ===========
  - vt100 only
  - no undo/redo
  - no way to save a file!
  - can't handle files with longer lines than terminal width
  - tabs... get's funny
  - some things rewrite whole screen!
  - when you move till after the file end, it gets funny (TOFIX)
  - big files should mess it up
  - Not yet: no arrow keys, just as above and letters

how to build

linux

just run linux> ./imacs

it'll compile and run!

if you use bigger screen, try

  linux> export LINES
  linux> export COLUMNS

then start again, it should use whole screen

nodemcu esp8266

In a directory:

This is temporary; we need to patch in for read/write to get readline interactive on device!

These will now be in the same directory

Note: the build needs to do some special stuff for compiling to a plain make will not work.

For the nodemcu instead:

  • ./make

    if no errors, flash it:

  • make flash

  • ./mcu

to connect to it, then press ^L to redraw the screen!

Related projects

Femto-Emacs

Editor         Binary   BinSize     KLOC  Files

imacs          imacs      18808     0.364     1
femto          femto      43397     2.1k     11
atto           atto       33002     1.9k     10

About

imacs - possibly the Worlds Smallest Emacs clone! Meant to be embeddeble in nodemcu / eps8266

Resources

License

Stars

Watchers

Forks

Packages

No packages published