1
0
Fork 0
src/Wip/it
dtb f501a77764 spring cleaning 1 2023-12-31 10:46:23 -07:00
..
LICENSE spring cleaning 1 2023-12-31 10:46:23 -07:00
Q.py spring cleaning 1 2023-12-31 10:46:23 -07:00
README.md spring cleaning 1 2023-12-31 10:46:23 -07:00
bang.py spring cleaning 1 2023-12-31 10:46:23 -07:00
buffer.py spring cleaning 1 2023-12-31 10:46:23 -07:00
config.py spring cleaning 1 2023-12-31 10:46:23 -07:00
dot.py spring cleaning 1 2023-12-31 10:46:23 -07:00
exit.py spring cleaning 1 2023-12-31 10:46:23 -07:00
f.py spring cleaning 1 2023-12-31 10:46:23 -07:00
get_command.py spring cleaning 1 2023-12-31 10:46:23 -07:00
hello_world.py spring cleaning 1 2023-12-31 10:46:23 -07:00
i.py spring cleaning 1 2023-12-31 10:46:23 -07:00
it spring cleaning 1 2023-12-31 10:46:23 -07:00
load_module.py spring cleaning 1 2023-12-31 10:46:23 -07:00
p.py spring cleaning 1 2023-12-31 10:46:23 -07:00
parse_command.py spring cleaning 1 2023-12-31 10:46:23 -07:00
q.py spring cleaning 1 2023-12-31 10:46:23 -07:00
saved.py spring cleaning 1 2023-12-31 10:46:23 -07:00
version.py spring cleaning 1 2023-12-31 10:46:23 -07:00

README.md

it

UNIX ed for a new age...

Just kidding, no need to use this over ed. This is just my take on a line editor, heavily inspired by ed.

For disambiguation it's suggested that this project be referred to as "ited", pronounced however one likes (suggested: "iht-ehd").

Included commands

!

Passes arguments to Python subprocess.run.

buffer

This is where code relating to the Buffer class is kept but calling this from within the editor will allow you to view the current buffer's attributes.

dot

Change the current position within the buffer.

exit

Will exit via sys.exit rather than telling main.py to break out of the main loop. Functionally identical to Q.

f

Displays or changes the filename associated with the current buffer.

it

Launches a new instance of it.

It should be noted that quitting a nested instance of it through the usual means (exit, q, or Q) will exit all nested instances of it as well. To return to a higher instance of it, send an EOF character via your terminal. In xterm this is CTRL+d.

load_module

Manually loads a module, whether or not it was already loaded.

parse_command

Used by it's main Python module but calling this from within the editor will allow you to test the command argument splitting.

Q

Quits.

q

Quits, unless your current buffer is unsaved.

saved

With no arguments given, flips the buffer's "saved" boolean attribute. Otherwise, sets the buffer's "saved" attribute to the first argument or errors if multiple arguments given.

version

Prints the versions of given modules. If no modules are specified, prints the version of module "it".

Making new commands

Making new commands is very easy. Read buffer.py and it.py (<100 LOC total).