A text editor can use shell scripts for almost all functionality. Key binding can be done through a
file, like in
. The first column of the configuration file contains the
key escape code
, the second column contains the commands to be executed.
Upon invocation, a script is given the contents of the text buffer on stdin. Several environment variables contain a byte count from the start of the text (0 represents the beginning of the text):
- position of the cursor
- start of the selection
- end of the selection
If a script finishes successfully, the contents of text the buffer are replaced by the output atomically.