Skip to main content

Navi (interactive cli cheatsheet) integration

Project description

navi (interactive cli cheatsheet) integration into xonsh (shell)

If you like the idea click ⭐ on the repo

Installation

To install use pip:

xpip install xontrib-navi
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-navi

Usage

  1. 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

xontribs_load(xontribs) # actually load all xontribs in the list
  1. 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" # ...

Known issues

  • Bottom toolbar may temporary disappear on some invokations of the commands in this xonrib likely due to this xonsh issue
  • The match currently works only for the whole prompt, so git sta will get autofilled to its best navi match of git status, but git show; git sta will fail to find any match and do nothing

Credits

This package was created with xontrib template

Project details


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.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

xontrib_navi-0.0.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page