Expands input words as you type in xonsh shell.
Project description
Expands input words as you type in xonsh shell.
If you like the idea click ⭐ on the repo and tweet.
Installation
To install use pip:
xpip install xontrib-abbrevs
# or: xpip install -U git+https://github.com/xonsh/xontrib-abbrevs
Usage
This expands input words from abbrevs
dictionary as you type.
Adds abbrevs
dictionary to hold user-defined "command abbreviations.
The dictionary is searched as you type the matching words are replaced
at the command line by the corresponding dictionary contents once you hit
'Space' or 'Return' key.
For instance a frequently used command such as git status
can be abbreviated to gst
as follows:
xontrib load abbrevs
abbrevs['gst'] = 'git status'
gst # Once you hit <space> or <return> 'gst' gets expanded to 'git status'.
one can set a callback function that receives current buffer and word to customize the expanded word based on context
abbrevs['ps'] = lambda buffer, word: "procs" if buffer.text.startswith(word) else word
It is also possible to set the cursor position after expansion with,
abbrevs['gp'] = "git push <edit> --force"
Credits
This package was created with xontrib template.
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 Distribution
File details
Details for the file xontrib_abbrevs-0.1.0.tar.gz
.
File metadata
- Download URL: xontrib_abbrevs-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e00bf7081d01345eb1f303dbe32fb78def34bcf4036c22b2a36a54ba0d75ff |
|
MD5 | 9cee97a7a451e71838524ced6eb29afe |
|
BLAKE2b-256 | 2c8dfe9d19a14bc25e9640ed79342a9c5b95511d39c52f2466fb9184498acb5f |
File details
Details for the file xontrib_abbrevs-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: xontrib_abbrevs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab577ce4bac3ce7431a5d1d50b3dd7c4c162f23b085333e9a42016493aec5df1 |
|
MD5 | 75b8f673a0d711ceeb401cc6ee7757a3 |
|
BLAKE2b-256 | ff7076b32465f535b1327fac54ecf07ea8190747f3654567b092cb3f3717f6dd |