Skip to content

lojikil/microdired

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

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.

Language

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-shell glob-alike
  • cmd: an actual command, like l or def
  • argN: character string arguments

Commands:

  • .: print the current working directory
  • ..: go up to the parent directory
  • /somedirectory: go to /somedirectory
  • l/L: print directory with or without entry numbers
  • p/P: pretty print directory with or without entry numbers
  • c/C: create a file/directory
  • f: print only files
  • F: pretty print only files
  • d: print only directories
  • D: pretty print only directories
  • e: invoke $EDITOR, falling back on internal ed(1)
  • E: invoke internal ed(1)
  • m: more, but built in
  • M: mode, as in chmod
  • t: test-like interface
  • !: execute a unix shell

About

an ed(1)-like directory editor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages