Giter VIP home page Giter VIP logo

readlike's Introduction

Readlike

A Python module that provides GNU Readline-like line editing functions (the default Emacs-style ones). If you just want to use Readline, use the readline package in the standard library--but this package allows access to those capabilties in settings outside of a standard CLI.

Currently, all stateless Readline commands are implemented. This means that yanking and history are not supported.

This module is especially well-suited to interfacing with Urwid due to a shared syntax for describing key inputs.

Installation

Install or upgrade to the latest version from PyPI:

[sudo] pip install -U readlike

Quick example

Transpose words:

>>> import readlike
>>> readlike.edit('perilous siege', 9, 'meta t')
('siege perilous', 14)

Commands

Implemented commands and their correspondings keys are as follows:

backward-char            ctrl b, left
backward-delete-char     ctrl h, backspace
backward-kill-word       ctrl meta h, meta backspace
backward-word            meta b, meta left
beginning-of-line        ctrl a, home
capitalize-word          meta c
delete-char              ctrl d, delete
delete-horizontal-space  meta \
downcase-word            meta l
end-of-line              ctrl e, end
forward-char             ctrl f, right
forward-word             meta f, meta right
kill-line                ctrl k
kill-word                meta d, meta delete
transpose-chars          ctrl t
transpose-words          meta t
unix-line-discard        ctrl u
unix-word-rubout         ctrl w
upcase-word              meta u

For more information about each command, see readline(3) or see the doc strings in readlike.py.

Projects using Readlike

readlike's People

Contributors

jangler avatar mrksmrtn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mrksmrtn

readlike's Issues

Update homepage on pypi.

Hi,

On pypi readlike's homepage link still points to http://jangler.info/code/readlike but it looks like that site was shutdown sometime in 2016/2017 and that now some other entity owns the domain.

Is there a chance you could update the link on pypi to point to this repository instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.