Skip to main content

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 and import 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
  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 ⎈g git status autoreplace with navi's best match
  • git status ⎈g run navi with current command as search input
  • git sta‸; git show ⎈g git status‸; git show autoreplace 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)

Source distribution for xontrib-navi 0.0.7
File Size Uploaded
xontrib_navi-0.0.7.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xontrib-navi 0.0.7
File Interpreter ABI Platform
xontrib_navi-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / xontrib_navi-0.0.7.tar.gz

Download URL xontrib_navi-0.0.7.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ab57f1402fca3577b479d3084d26059990dc265275f408b6a2d9895c82db1b60
BLAKE2b-256 checksum
How to use checksums
1895ef7fe805c4a456b944ad218e8ec571c9295a2d2004313d0735f5f7a19739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / xontrib_navi-0.0.7-py3-none-any.whl

Download URL xontrib_navi-0.0.7-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
258c7efb6bafe4edcf2f7ca1d41d8149407ec6123e0ea391e801fb001e3f6b64
BLAKE2b-256 checksum
How to use checksums
d8337ae376d7975edbd68920d008992890ba9b51a5b2c54c4884965b272017e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page