Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eugenesvk/xontrib-navi
Navi (interactive cli cheatsheet) integration into xonsh
https://github.com/eugenesvk/xontrib-navi
cli command-line navi terminal xonsh xontrib
Last synced: about 2 months ago
JSON representation
Navi (interactive cli cheatsheet) integration into xonsh
- Host: GitHub
- URL: https://github.com/eugenesvk/xontrib-navi
- Owner: eugenesvk
- License: mit
- Created: 2023-03-10T14:10:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-20T13:22:33.000Z (6 months ago)
- Last Synced: 2024-10-24T15:38:48.896Z (2 months ago)
- Topics: cli, command-line, navi, terminal, xonsh, xontrib
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- Changelog: Changelog.md
- License: License
Awesome Lists containing this project
README
navi (interactive cli cheatsheet) integration into xonsh (shell)
If you like the idea click ⭐ on the repo## Install
```xsh
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`):
```py
from xonsh.xontribs import xontribs_load
from xonsh.built_ins import XSH
envx = XSH.envxontribs = [ "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
```xsh
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](https://github.com/xonsh/xonsh/issues/5084)
## Credits
This package was created with [xontrib template](https://github.com/xonsh/xontrib-template)