• This repository has been archived on 15/Aug/2019
  • Stars
    star
    451
  • Rank 96,968 (Top 2 %)
  • Language
    C
  • License
    The Unlicense
  • Created over 7 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A dead simple editor

e

Braindead editor. Feels like Vim, only simpler. Inspired by kilo, of course, and a large swath of the code is similar.

It can be scripted through Lua.

asciicast

Features

  • Scripting through intuitive Lua interface
  • Incremental search (and replace)
  • Multiple modi (similar to Vim)
  • Mnemonic movement (feels like Vim, just different enough for you to be frustrated)
  • Limitless Undo (until memory runs out)
  • Extensible syntax highlighting
  • No global state in the library part (just in main.c)
  • Can be used as a library
  • Ships with syntax highlighting for
    • C/C++ (stable)
    • Python (experimental)
    • JavaScript (experimental)
    • Go (experimental)
    • Haskell (experimental)
    • Carp (experimental)
    • Markdown (unfinished)

Installation

git clone https://github.com/hellerve/e
cd e
make install # install_lua for Lua support

If there are any problems—particularly with Lua—, please refer to the Troubleshooting page on the wiki.

Usage

There are two major modes, init and edit. edit mode works like a normal text editor would. init mode enables the user to navigate and do meta work, such as saving the file, searching, and replacing.

init mode mnemonics

Use wasd or the arrow keys for movement. Editing (backspace, etc.) works normally.

  • n: insert a line below the cursor and start editing (next)
  • p: insert a line above the cursor and start editing (previous)
  • b: jump to the beginning of the line and start editing
  • t: jump to the end of the line and start editing (terminus)
  • h: hide a line (delete it) and add it to the system clipboard (clipboard only on Windows and OS X)
  • c: copy a line to the system clipboard (only on Windows and OS X)
  • v: view (i.e. paste) the contents of the system clipboard (only on Windows and OS X)
  • /: incremental highlighted search
  • r: search and replace first occurrence
  • R: search and replace all occurrences
  • Space: quick save (might be prompted for a file name)

In meta mode (reachable by pressing the colon character :), there are the following commands:

  • s: save and quit (might be prompted for a file name)
  • q: exit (will abort if the file has unsaved content)
  • !: force exit
  • Number n: jump to line n

Writing syntax files

By default, e creates a directory called .estx in the user's home directory (the location is overridable by providing STXDIR to make install). There, e will search for syntax files on startup. Their grammar is very minimal, see the C file below:

displayname: c
extensions: .*\.cpp$
            .*\.hpp$
            .*\.c$
            .*\.h$
comment|no_sep: //.*$
keyword: (restrict|switch|if|while|for|break|continue|return|else|try|catch|else|struct|union|class|typedef|static|enum|case|asm|default|delete|do|explicit|export|extern|inline|namespace|new|public|private|protected|sizeof|template|this|typedef|typeid|typename|using|virtual|friend|goto)
type: (auto|bool|char|const|double|float|inline|int|mutable|register|short|unsigned|volatile|void|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|size_t|ssize_t|time_t)
comment|no_sep: /\*.*\*/
comment|no_sep: /\*.*
                 .*\*/
pragma: \s*#(include|pragma|define|undef) .*$
predefined: (NULL|stdout|stderr)
pragma: \s*#(ifdef|ifndef|if) .*$
pragma: \s*#(endif)
string|no_sep: "([^\\\"]|\\.)*"
string|no_sep: '([^\\\']|\\.)'
number: [+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)[fl]?

displayname is the string displayed at the bottom of e. extensions is a list of regexes to match the filenames. Highlighting keys are comment, keyword, type, pragma, string, number, and predefined. By appending |no_sep, the user signals to e that no separator is needed, i.e. highlighting works even if the matched string is part of a longer word. The values are regexes.

If you provide a second regex (must by divided by a newline), e assumes that everything between the two matches should be colored (useful for e.g. multiline comments).

Scripting through Lua

The editor has scripting capabilities in Lua. Thus far I've only documented them in a blog post, but this post should give you a good overview of how to write Lua scripts for e. There is also an example .erc file in the repository that you can look at for inspiration.

That's it!

Tabs vs. Spaces

I personally always use spaces for indentation, thus e does the same. It will always convert all of the tabs in your file to spaces automatically for you, and I understand if that bit of behavior is undesired by some. It is very much by design, though, and probably won’t change.


Have fun!

More Repositories

1

programming-talks

Awesome & interesting talks about programming
Python
7,237
star
2

sbcli

A REPL for my SBCL needs
Common Lisp
91
star
3

ptolemy

My reading list
80
star
4

microml

A minimal ML, type-inferred, compiled, and/or interpreted in less than 750 lines
Python
36
star
5

cspfuck

Brainfuck with Actors
C
35
star
6

hawkweed

Yet another implementation of missing functions for Python
Python
19
star
7

carp-vim

A Vim plugin for Carp
Vim Script
17
star
8

anima.carp

A simple drawing and animation framework for Carp
15
star
9

blog

My personal blog
HTML
14
star
10

mae

maps are everything.
Python
9
star
11

unlambda

An Unlambda Interpreter and REPL
Haskell
9
star
12

gt

A simple greenthreading library
C
8
star
13

compfuck

A compile-time Brainfuck compiler, in Carp
8
star
14

cj

[WIP] A simple x86 JIT framework for C
C
7
star
15

gt4processing

is a Processing clone in GT
Smalltalk
7
star
16

notes

A dead simple note-taking utility
Python
6
star
17

Data.DDate

Discordian Dates for Haskell
Haskell
6
star
18

clox

My take on Crafting Interpreters
C
5
star
19

render

Rendering experiments in Carp
5
star
20

barb

is almost a Carp (not really)
Python
5
star
21

hi

A dead simple chat
Go
5
star
22

invoicing

A homegrown invoicing system very similar to the one I use
TeX
4
star
23

remind.py

A personal reminder tool
Python
4
star
24

bachelor-thesis

My Bachelor Thesis (about zepto)
TeX
4
star
25

obf

An optimizing Brainfuck compiler in Pharo
Smalltalk
3
star
26

zepto-llvm

A non-compliant compiler from zepto to machine code
3
star
27

talks

A collection of talks I’ve given and proposed (reach out!)
TeX
3
star
28

cowsay.carp

cowsay, in Carp
C
3
star
29

rot26

A state-of-the-art crypto algorithm in Carp
3
star
30

Quines

A few Uniquines
Makefile
3
star
31

todo

My To Do list for big things
3
star
32

gt.carp

A gt wrapper for Carp (greenthreads, yay!)
C
3
star
33

reptile

Snake in Carp
3
star
34

collec

Generic collections for Carp.
2
star
35

lean

A lean zeps template
2
star
36

lolcarp

A Lolcat implementation in Carp
2
star
37

require

Add Clojure-style requiring to zepto
2
star
38

cli

A composable CLI library for zepto
2
star
39

typeinfer

A naive typechecker for zepto programs
2
star
40

queue.carp

[WIP] A simple Queue type for Carp
2
star
41

base64

A base64 library for and in zepto
2
star
42

marriage

April, 13th, 2018
HTML
2
star
43

braincarp

A Brainfuck interpreter in Carp
2
star
44

hiss

A REPL for a Lisp-like language - because why not
C
2
star
45

eventually-consistent-partying

TeX
2
star
46

shipping

A solution to Kevin’s shipping puzzle
2
star
47

a_bad_idea

Code for my Lightning Talk at EuroPython2016 (the one I didn’t give)
Python
2
star
48

Detanglement

Big Data Visualization / Research at FKI/HTW Berlin
JavaScript
2
star
49

readline

A readline port for and in zepto
2
star
50

js-parse-dispatch

Make script tags work with any language
JavaScript
1
star
51

zepto-keygen

A RSA key generator in zepto
1
star
52

minilisp

A minimal Lisp implementation in zepto
1
star
53

tool

A zeps template for tools
1
star
54

utilities

Utilities in various programming languages
Python
1
star
55

zvm

A useless register-based virtual machine in zepto
1
star
56

szc

A silly compiler [ABANDONED]
1
star
57

zepto-brainfuck

A Brainfuck interpreter written in zepto
1
star
58

advent-of-code-2015

My solutions for the Advent Of Code challenges
Python
1
star
59

WorkoutLog

A log for workouts in Glamorous Toolkit
Smalltalk
1
star
60

clojure-meetup-slides

The slides I used for the Berlin Clojure Meetup (13th January 2016)
1
star
61

coreutils

A few coreutils, rewritten in zepto
1
star
62

serialization

Serialization for zepto
1
star
63

redis

A redis client library for zepto
1
star
64

lang-server

A simple zepto DSL for creating HTTP servers
1
star
65

badges

A simple badge service written in zepto
1
star
66

fck-curl

Don't pipe into CURL.
1
star
67

bizc

My business cards and their LaTeX sources
TeX
1
star
68

hamurabi

The BASIC gaming classic in zepto
1
star
69

docgen

Automatic documentation generation for zepto
CSS
1
star
70

bach

Classes for zepto
1
star
71

native

A zeps template for native extensions
Haskell
1
star
72

backwards

A cross-compiler from zepto to JavaScript
JavaScript
1
star
73

golflisp

A few macros and aliases for zepto for better code golf performance
1
star
74

eval.carp

[WIP] A compile-time Lisp evaluator for Carp
1
star
75

pyzepto

A crude way of interfacing Python with zepto
Python
1
star
76

ddate-server

A simple Ddate server in zepto
1
star
77

m

Logorrheic incantations
Python
1
star
78

progress

A simple CLI progress bar for zepto
1
star
79

gh-stats

Fetch your personal Github statistics
JavaScript
1
star
80

carp-intro

An introductory talk about Carp, given at Enthusiasticon 2018
1
star
81

e12n-proposal

1
star
82

aoc-2017

AOC solutions for 2017 (in Carp and zepto)
1
star
83

env

A environment variable DSL for zepto
1
star
84

md5

A MD5 implementation for zepto [non-working]
1
star
85

match-utils

is a collection of utility macros around match.
1
star
86

release-party

The slides for my talk at the release party of zepto (0.9.6)
1
star
87

miss

For all y'all at home
HTML
1
star
88

carp-talks

A collection of talks I’ve given or will be giving on Carp
TeX
1
star
89

exemplar

An exemplar port for zepto
1
star
90

hashmap

A simple Hashmap for Carp
1
star
91

bricolage

Some ideas and programs that could maybe, possibly, at some point be almost acceptable.
1
star
92

zepsh

A small shell powered by zepto
1
star
93

mimir

Mimir is the God of Wisdom
Haskell
1
star
94

game-of-life

An implementation of the Game of Life in Carp, using anima.carp
1
star
95

levenshtein

An implementation of the Levenshtein edit distance in Carp
1
star
96

simplereq

A native extension for zepto that empowers you to make requests easily
Haskell
1
star
97

pi

A π-calculus based greenthreading actor concurrency lightweight [mumble]
1
star
98

geometry

Basic types and functions for geometry in zepto
1
star
99

silly

A silly implementation of fixed point arithmetic (mirror because I linked here on my blog)
C
1
star