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
.pyxontrib loading config andimportit in your xonsh run control file (~/.xonshrcor~/.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
envx["x_navi_key_skim"] = "⎇g" #False Autofill existing command with navi's best match or launch navi if no good match found (skim)
# run to see the allowed list for ↑: from prompt_toolkit.keys import ALL_KEYS; print(ALL_KEYS)
# Alt is also supported as either of: a- ⎇ ⌥ (converted to a prefix 'escape')
# Control symbols are also supported as either of: ⎈ ⌃
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" # ...
$x_navi_key_skim = ["escape","g"] # ...
Use
- ⎈g run navi
git sta⎈ggit statusautoreplace with navi's best matchgit status⎈g run navi with current command as search inputgit sta‸; git show⎈ggit status‸; git showautoreplace only the command at ‸cursor
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
Release files for xontrib-navi 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xontrib_navi-0.0.7.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xontrib_navi-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB