Skip to main content

Line editor, edlin clone with many improvements

Project description

dedlin

Dedlin is an interactive line-by-line text editor and a DSL, similar to edlin or ed. It is perfect for letting AI chatbots edit documents without sending the whole document back and forth.

It is scriptable making it similar to sed for doing find, insert, replace, delete operations on existing files.

Soon it will support non-line number ranges, e.g. "/Done/ DELETE

Dedlin extends on edlin enough that it is not backwards compatible.

I have made changes to make the app less user hostile than classic ed or edlin, but there is a --vim_mode where all help, warnings, feedback will be suppressed.

Badges

Libraries.io dependency status for latest release

Downloads

CodeFactor

Installation

Requires python 3.11 or higher. Someday I'll write a standalone installer for it.

Install globally in an isolated virtual environment. This is a good idea.

pipx install dedlin

Run pre-built image with docker. Painful, but you're using an edlin clone, so that is what you're looking for.

# This is should work in powershell or linux bash. Not windows git-bash.
docker run --rm -it -v "${PWD}/:/app"  ghcr.io/matthewdeanmartin/dedlin:latest file.txt

Usage

Launch and edit file_name.txt

If you installed with pip or pipx

dedlin file_name.txt

Command line help

> python -m dedlin --help
Dedlin.

An improved version of the edlin.

Usage:
  dedlin [<file>] [options]
  dedlin (-h | --help)
  dedlin --version

Options:
  -h --help          Show this screen.
  --version          Show version.
  --macro=<macro>    Run macro file.
  --echo             Echo commands.
  --halt_on_error    End program on error.
  --promptless_quit  Skip prompt on quit.
  --vim_mode         User hostile, no feedback.
  --verbose          Displaying all debugging info.
  --blind_mode       Optimize for blind users (experimental).

Sample session

   _          _  _  _
 __| | ___  __| || |(_) _ _
/ _` |/ -_)/ _` || || || ' \
\__,_|\___|\__,_||_||_||_||_|


Editing /home/mmartin/github/dedlin/sample.txt
? * 1i
1 INSERT
Control C to exit insert mode
?    1 :  cabbage
?    2 :  bread
?    3 :  carrots
?    4 :  ghost peppers
?    5 :  coffee
?    6 :  tortillas
?    7 :

Exiting insert mode

? * SORT
 SORT
Sorted
? * LIST
1,6 LIST
   1 : bread
   2 : cabbage
   3 : carrots
   4 : coffee
   5 : ghost peppers
   6 : tortillas

? * EXIT
1,6 EXIT

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dedlin-1.19.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

dedlin-1.19.1-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file dedlin-1.19.1.tar.gz.

File metadata

  • Download URL: dedlin-1.19.1.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for dedlin-1.19.1.tar.gz
Algorithm Hash digest
SHA256 b414c4e90089dcc4ab51c84d96890bef362d15bbf2168627b409ea0b46741f75
MD5 9ab5836c960caeefe8f91ded5b2dfaf6
BLAKE2b-256 1fb66a79c8ba9a273a22fd3f615b01796d3e93d16dfbc5876bd8fe10c4b36c5a

See more details on using hashes here.

File details

Details for the file dedlin-1.19.1-py3-none-any.whl.

File metadata

  • Download URL: dedlin-1.19.1-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for dedlin-1.19.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c32514764d71488dc66f069d76eff46cbfee49be7c0f51db7d47d8c68442564
MD5 e441809db73270c377d0584563edc5ac
BLAKE2b-256 ddc877727f84f9c89bfd6a86bf53fb12fa92cc9045b3aacabaaee2e8a93187c1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page