rime for python, attached to prompt-toolkit keybindings for some prompt-toolkit applications such as ptpython
Project description
pyrime
rime for python, attached to prompt-toolkit keybindings for some prompt-toolkit applications such as ptpython.
Dependence
# Ubuntu
sudo apt-get -y install librime-dev librime1 pkg-config
sudo apt-mark auto librime-dev pkg-config
# ArchLinux
sudo pacman -S --noconfirm librime pkg-config
# Android Termux
apt-get -y install librime pkg-config
# Nix
# use nix-shell to create a virtual environment then build
# homebrew
brew tap tonyfettes/homebrew-rime
brew install librime pkg-config
# Windows msys2
pacboy -S --noconfirm pkg-config librime gcc
Configure
~/.config/ptpython/config.py:
from ptpython.repl import PythonRepl
from prompt_toolkit.filters import EmacsInsertMode, ViInsertMode
from prompt_toolkit.key_binding.key_processor import KeyPressEvent
from pyrime.ptpython.plugins import RIME
from pyrime.ptpython.utils.condition import (
InsertMode,
any_condition,
)
def configure(repl: PythonRepl) -> None:
rime = RIME(repl)
@repl.add_key_binding(
"c-^",
filter=any_condition(InsertMode, rime.mode(["c-^"])),
)
def _(event: KeyPressEvent) -> None:
rime.toggle()
If you defined some key bindings which will disturb rime, try:
@repl.add_key_binding("c-h", filter=rime.filter(EmacsInsertMode()))
def _(event: KeyPressEvent) -> None:
rime.toggle()
If you want to exit rime in ViNavigationMode(), try:
@repl.add_key_binding("escape", filter=EmacsInsertMode())
def _(event: KeyPressEvent) -> None:
""".
:param event:
:type event: KeyPressEvent
:rtype: None
"""
event.app.editing_mode = EditingMode.VI
event.app.vi_state.input_mode = InputMode.NAVIGATION
rime.conditional_disable()
# and a, I, A, ...
@repl.add_key_binding("i", filter=ViNavigationMode())
def _(event: KeyPressEvent) -> None:
""".
:param event:
:type event: KeyPressEvent
:rtype: None
"""
event.app.editing_mode = EditingMode.EMACS
event.app.vi_state.input_mode = InputMode.INSERT
rime.conditional_enable()
It will remember rime status and enable it when reenter ViInsertMode() or
EmacsInsertMode().
Some utility functions are defined in this project. Refer my ptpython config to know more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrime-0.0.13.tar.gz.
File metadata
- Download URL: pyrime-0.0.13.tar.gz
- Upload date:
- Size: 46.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6db4783e5cb62d18d0685637e19f576b61632994461fa60d9f88c793c645c0
|
|
| MD5 |
57bbcbcaf17bc65e9b410b4f02fdb587
|
|
| BLAKE2b-256 |
a90b17494a3eeb7550f74450f6bce647b9ad1681b9fd098590b70d7d2b57b6b4
|
File details
Details for the file pyrime-0.0.13-pp311-pypy311_pp73-macosx_15_0_arm64.whl.
File metadata
- Download URL: pyrime-0.0.13-pp311-pypy311_pp73-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: PyPy, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc8b105714443538ef283fb9e7ad6ad6b595de8b4b18d149cc45b96998e338ab
|
|
| MD5 |
62d15347514810111936d87565953ae1
|
|
| BLAKE2b-256 |
ba8bc82185e79eef2ef387d8d39712f7a040816b34a1e17aa34dbc7ef5fd4ab4
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 98.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92424439bbcb1f9a85cfefad7b5db0c7c0a63a2d151c7e34451d5914a8cd5569
|
|
| MD5 |
65e415d950d46e78d0794420f07c0758
|
|
| BLAKE2b-256 |
43834a39600474d90b61d9c04db2f23c560273f55dc6692af52f9db2af90bce7
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bbcb5409dce42294a80584bc2e34992326bf3cb66924a4a2f31250c013c4bd7
|
|
| MD5 |
b4dcb40e889450cee7cdfbc8da95ab8f
|
|
| BLAKE2b-256 |
2251fd2f483765b2cfad3844e8cc2981ba8a42ca62acdef444182bb8f7a6cc95
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_s390x.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_s390x.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a5b239bcae889218623de6774a4303c0f579caad46d09f48205baf0fceda465
|
|
| MD5 |
863b26e6b0aef051eb28dfb665542f96
|
|
| BLAKE2b-256 |
976750ace4fa8ef4e0c35fbb3d98986fa72983c62975f0c885e0b2854558dd80
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_ppc64le.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_ppc64le.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7107256e2d6468c67e9830137e82196d41e9a435d2d88998f704d0f5268abff9
|
|
| MD5 |
93ff77fa52666d39911fb539954927ee
|
|
| BLAKE2b-256 |
e8d6520409a94e896127c330dd3fcdcbd37f9b164148db7c987e4962c759f36c
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_i686.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77841be9cc5dcda92f03798e6b43886b98651b8042466de1332fdcb995478641
|
|
| MD5 |
c5c586773ecf7ce2af4dc8c7fbfc3695
|
|
| BLAKE2b-256 |
28e59d9d4578479eb5100e8e976c57d8ede851757817d57d2306adbeec237f67
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f87987fe3e3c033e75dec38cf168765bde21b7dcebc50e862a106d9c6f6029f
|
|
| MD5 |
417699b2212ef93f103541f15a9e937d
|
|
| BLAKE2b-256 |
068044fe1d6ef25b6b73db179a05f7d6e85f58335511353e6710e40ebd4192b4
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4efdb4d2a143633045443ead4b246f868357e818fb19ed27671966f082f3354
|
|
| MD5 |
9078daac33a41faf271c2e91600cabaf
|
|
| BLAKE2b-256 |
008bef7199486de2d40fded613fc1a3aac04746f352294f48ff0b3c35d58383e
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 70.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f56dfe50ff69fd9363af319d1961c39968f653773817d45edbfb46fe7ca76d8
|
|
| MD5 |
be238c965afe26db977b77663896cbab
|
|
| BLAKE2b-256 |
076012918b83a8dabfacb1a19f7a2965411bb39bb2a296876d54ed5b531fc936
|
File details
Details for the file pyrime-0.0.13-cp313-cp313-macosx_15_0_arm64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp313-cp313-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.13, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8303ab932d09a5f0d1113e59e6d31ba8046970324b3bb781ba6bf14dee9572c8
|
|
| MD5 |
2dcc03a7736534815a5a6c2577f350b0
|
|
| BLAKE2b-256 |
47dcd6c1f73882a08d8fe0c7b7cf254340f84a8e874488380c850dbd01f187a9
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af5c5c4f3371e98535f6ca6193c3677c317f2ec79519b2e46bb25f6d6339187e
|
|
| MD5 |
2f2beefa90e118532c5765842dd8b439
|
|
| BLAKE2b-256 |
df145c40d0d00f569d47c8acfba2bed885e02028e2f12d31a0323fc36f285abf
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_s390x.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_s390x.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c622a3dd5a54396fbdbb071d60b249d7a594ab3211053e93a6fdc74f62180e01
|
|
| MD5 |
ad8e609d21ac88766e8760cc93d1f959
|
|
| BLAKE2b-256 |
79d43ec527bf414801fa6d9cc47748a57db224051668a04077efa7ee93089217
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_ppc64le.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_ppc64le.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df363991cd3fa9217d48df4660adf4fc6cfbc38e718b4f8706308084670a1c99
|
|
| MD5 |
6e791a3ad6a84fc5bc59f47804a69995
|
|
| BLAKE2b-256 |
b28ca0ff1c781f935a25e00a9cbfb2ae0eaed6573f162abbfa8d16d8d57c554d
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_i686.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
402fd319ec7533211e4d2c23d11163a974a17f2de95fa25fbeb3c68a603f80ac
|
|
| MD5 |
9f9506fae3ee08c4605be589ab70c28b
|
|
| BLAKE2b-256 |
3f4a6961b0ded4fd1f55652eef8dd623a3066305047a337443cbc8f3435300ee
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2932ac29d1f46333c4a4c7374692170cdb17242c472de0cf24b0da5f2b8fe7d4
|
|
| MD5 |
20b24eed4562f92723e1641c51fb62b0
|
|
| BLAKE2b-256 |
7c1ec3d6c5abbd5cab18dcbfd35d00cb27aff410cd207eb0660270b0bcd15b92
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c53f51e97b9b0095e31fccfb3476430a87428d6018c77a39b8772ac389717c30
|
|
| MD5 |
1408b699e0e9505a9716c37f6b4eecbc
|
|
| BLAKE2b-256 |
4eb68e2055d84be0a3157ed6dee7cf523eca15abe8678f12cc88d7df6efae1cb
|
File details
Details for the file pyrime-0.0.13-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c13fa0d4a3294ebb9c4d4f56614c5fdda872db72183a481e808abfc046c1fe
|
|
| MD5 |
438201e0c828338dca2a1847d1d4c947
|
|
| BLAKE2b-256 |
2182dc4ab9bffc8f3b0fff6f5b3202b8733cf68c51b826940c657b820c7f4aa7
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e167131b10fc7ec62c5151e98a3ee04140fed133a546d6881dd96d06892f6d11
|
|
| MD5 |
973abac3b4b9de7cdf60db1bf211ac38
|
|
| BLAKE2b-256 |
bd114f6712a6fc12092b7c0656e82cd5af863a9472ce013215b7318fa0a4c90c
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_s390x.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_s390x.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb0cc65832ac70760dbd6e4f0827d75dd4d33abb573caf76ca93bb8733da1aea
|
|
| MD5 |
1e8a8252175bba016f8af567193e899c
|
|
| BLAKE2b-256 |
e5b7116ff5ee74491577b5e33ac999d1d7970046c96070256ba308769312d921
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_ppc64le.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_ppc64le.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9994176286da552e23ebb56436bc11bb1407ed4b534e2dfa9b1c9e510ecd2d6
|
|
| MD5 |
291e5bc59a9280b1fe62d5ef355b0f73
|
|
| BLAKE2b-256 |
6242c395125a17c6a84ad74ff87a37ca8419768344335d5756ba27e62b3f4720
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_i686.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb0e68ce20d54ffd9b2bfb4216074b90a1fc642cc50195a11c3e02651ed80b08
|
|
| MD5 |
667fa1d12744ada5b25a7bb1d0ee7d9b
|
|
| BLAKE2b-256 |
aebbb2c01c4ee7e99ee9a8eee99ac7d3fb1049da0f68fc12cb4bf80090c9e427
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a51e91c35ebf147e0cfd92c53792d4a73106389883b518182b308260c53b27b4
|
|
| MD5 |
c3d1b33863f3d03d150703991b95d0ac
|
|
| BLAKE2b-256 |
92a5b40d1f8a8ae75d0f0b25b064c90c044152b5154cf66656bc372624d48586
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b5adbc0325f518fd0efe3cd94033f0ab5bdfb36e130d52a0dfd2bdc4ba80dd6
|
|
| MD5 |
ae46d4d4308c4b3c25222e97c8de5375
|
|
| BLAKE2b-256 |
26a96625c204d2b97b51265612c304d674dad5a594bafc5b129f6e5c0a2e2395
|
File details
Details for the file pyrime-0.0.13-cp311-cp311-macosx_15_0_arm64.whl.
File metadata
- Download URL: pyrime-0.0.13-cp311-cp311-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6aa1cbdee2554af96ae08bc88c0c784493de5189b1164b1dddd406b6b6c86ee
|
|
| MD5 |
eee978d2a6a6fc8b496d5d2a897b294b
|
|
| BLAKE2b-256 |
e581b1041ec9ae670077009fa1b3a84297c328dc8d5e55239727cead8c320f66
|