Emonad is a text editor that is similar to emacs, but written in Haskell. The frontend will be text only. The editor logic will be completely pure reducing bugs and complications. This will be an interesting design approach to text editors since most text editors, including emacs, are written with lots of mutable state. While emacs has elisp at its core, emonad will have Haskell at its core. Config files will be written in Haskell.
This is the data structure that holds the text of the buffer. We extended the rope library with a few extra functions that make it easier to use.
- log time insertion and deletion
- constant time length
This is the data structure that deals with the buffer
- Move the mark and point
- Manipulate text
- Save to a file
- Load from a file
- Paging
This is the module that deals with the collection of buffers.
- Add new buffers
- Kill buffer
- Switch between buffers
- Transform the current buffer
This is the current state of the editor. It knows about the buffer list, the context of key presses, the minibuffer, and the terminal
- Deals with user input
- Switches between buffer and minibuffer
- Reads user input (IO)
- Sets the text in the minibuffer
This is the code that draws the editor in the terminal
- Primarily uses the vty library
- Uses combinators to layout the page
This is the efficient data structure that we use to store text
Terminal interaction library
Monads!!!
Library that deals with the filesystem
Unit testing
Property based testing
- C-x C-f: Find file
- C-x C-s: Save buffer to file
- C-x b: Switch to buffer by name
- C-x k: Kill buffer by name
- C-a: Beginning of line
- C-e: End of line
- C-f: Move forward
- C-b: Move Backward
- C-n: Move to next line
- C-p: Move to previous line
- C-space: Set the mark
- C-x C-x: Swap the point and mark
- C-d: Delete
- C-g: Exit command or minibuffer
cabal configure
cabal install