Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A modern take on 'ed'

License

NotificationsYou must be signed in to change notification settings

sidju/hired

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The ed rewrite for daily use

After tiring of emacs freezing up on me one time too many and concluding that vim isn't any less of a monstrosity I made the reasonable choice and started using ed.It was a bit frustrating at the start but grew to be quite nice. The only missing feature really being syntax highlighting. After some research I couldn't find any ed fork or clone with syntax highlighting, so I once again made the reasonable choice and wrote my own.And so here it is, with all its flaws and deficiencies. Any and all pull requests welcome.

Core concepts:

The selection:

The original 'ed' keeps track of one line that you recently interacted with and defaults to working on that if nolines are given with a command. This is an extension of that logic, making it a span of lines. I find that thisis more intuitive.(To avoid unpleasantries some commands don't default to the selection, such as 'w'. If you want to modifythe selection behavior for any command create an issue, I may well have missed one.)

Usability:

The original 'ed' has very few features in its input editing. To improve on that this rewrite adds featuresfor moving both within lines and between lines in input. Similar capabilities exist for command input andmore are planned

Commands:

For details on commands instead look at theadd-ed repository, which houses the librarythat parses and runs the commands.

Attributions:

This project has of course greatly benefited from all the crates it depends on. Especially I'd like to thank regex and syntect for helping me through my, to various degrees badly though out, issues.

Then I have also gotten a hand up from 'bat', which I also consider an excellent companion to this application, from their handling of 16-color terminals. My theme is currently copied from their repo and will probably always be based on theirs.

Build:

git clone --recurse-submodules https://github.com/sidju/hiredcd hiredcargo build

Things to note:

  • rungh repo clone sidju/hired -- --recurse-submodules instead ofgit clone in case usingGitHub's CLI
  • if--recurse-submodules was omitted, no highlights would be available

Backing library

hired is built on theed runtime ofadd-ed.

If you wish to build your own editor usinged syntax youare advised to give it a look. It allows replacing the IO(file and shell interaction) as well as UI implementationsto better suit your needs.


[8]ページ先頭

©2009-2025 Movatter.jp