microdired
is an experiment that came about when I first saw nnn, which features
vim
-like keystrokes. It looks extremely interesting, but I thought to myself "what if we made an ed(1)
-like
file editor? what would that look like?" This started as a simple gist
and grew into something fun to tinker with. Probably the most useful part of this program is the parser for
ed(1)
-like command languages: the parser parses:
- ranges
- globs
- commands
- arguments
into a simple data structure. I've thought about turning microdired
into something like Holzmann's pico(1)
but I have not gotten there just yet.
The language that this ed(1)
-alike parser consumes is as follows:
n,m(glob)cmd arg0 arg1 ... argN
n,m
: a start line, and optional completion line(glob)
: a Unix-shellglob
-alikecmd
: an actual command, likel
ordef
argN
: character string arguments
.
: print the current working directory..
: go up to the parent directory/somedirectory
: go to/somedirectory
l
/L
: print directory with or without entry numbersp
/P
: pretty print directory with or without entry numbersc
/C
: create a file/directoryf
: print only filesF
: pretty print only filesd
: print only directoriesD
: pretty print only directoriese
: invoke$EDITOR
, falling back on internaled(1)
E
: invoke internaled(1)
m
:more
, but built inM
: mode, as inchmod
t
:test
-like interface!
: execute a unix shell