Navi (interactive cli cheatsheet) integration
Project description
navi (interactive cli cheatsheet) integration into xonsh (shell)
If you like the idea click ⭐ on the repo
Install
xpip install xontrib-navi
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-navi
Configure
- Add the following to your
.py
xontrib loading config andimport
it in your xonsh run control file (~/.xonshrc
or~/.config/rc.xsh
):
from xonsh.xontribs import xontribs_load
from xonsh.built_ins import XSH
envx = XSH.env
xontribs = [ "navi", # Initializes navi (interactive cli cheatsheet)
# your other xontribs
] # ↓ optional configuration variables (use `False` to disable a keybind)
if 'navi' in xontribs: # Configure navi only if you're actually loading it
# config var value |default|alt_cmd¦ comment
envx["X_NAVI_KEY"] = "⎈g" #|c-g| False¦ Autofill existing command with navi's best match or launch navi if no good match found
xontribs_load(xontribs) # actually load all xontribs in the list
- Or just add this to your xonsh run control file
xontrib load navi # Initializes navi (interactive cli cheatsheet)
# configure like in the example above, but replace envx['VAR'] with $VAR
$X_NAVI_KEY = "c-g" # ...
Use
- Autoreplace the command without invoking any manual selection UI with
navi
's best match:git sta
⎈ggit status
- or hit it again to invoke the manual seletion UI:
git status
⎈g navi UI - but failed best match will do nothing:
git stu
⎈ggit stu
- or hit it again to invoke the manual seletion UI:
- Split multiple commands and only autofill the one at the ‸cursor position:
git sta‸; git show
⎈ggit status‸; git show
ls -a‸ | rg 'txt'
⎈gls -alt ‸| rg 'txt'
Known issues
- Bottom toolbar may temporary disappear on some invokations of the commands in this xonrib likely due to this xonsh issue
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
xontrib_navi-0.0.3.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for xontrib_navi-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 057c80f9a0cf29e789cd5ce20908dce88a24f7e153757f31d36fd46ec8a9a1af |
|
MD5 | f848533d7fa6577562d5697bbf00973f |
|
BLAKE2b-256 | 68e9cd5bbf19690d20fe308cc06abfe126fced634451330ecadb1419eabf537a |