<p align="center">
<a href="https://github.com/denisidoro/navi">navi</a> (interactive cli cheatsheet) integration into <a href="https://xon.sh/">xonsh</a> (shell)
</p>
<p align="center">
If you like the idea click ⭐ on the repo
</p>
## 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.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
```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" # ...
```
## Use
- Autoreplace the command without invoking any manual selection UI with `navi`'s best match:
<br/>`git sta` <kbd>⎈</kbd><kbd>g</kbd> `git status`
- or hit it again to invoke the manual seletion UI:
<br/>`git status` <kbd>⎈</kbd><kbd>g</kbd> navi UI
- but failed best match will do nothing:
<br/>`git stu` <kbd>⎈</kbd><kbd>g</kbd> `git stu`
- Split multiple commands and only autofill the one at the ‸cursor position:
<br/>`git sta‸; git show` <kbd>⎈</kbd><kbd>g</kbd> `git status‸; git show`
<br/>`ls -a‸ | rg 'txt'` <kbd>⎈</kbd><kbd>g</kbd> `ls -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](https://github.com/xonsh/xonsh/issues/5084)
## Credits
This package was created with [xontrib template](https://github.com/xonsh/xontrib-template)
Raw data
{
"_id": null,
"home_page": "https://github.com/eugenesvk/xontrib-navi",
"name": "xontrib-navi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "xontrib,xonsh",
"author": "Evgeny",
"author_email": "es.bugzilla@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c8/21/ecf67d3fbd5ece0ac9f8f6cfbf51dca3600dc500a3afffe9cd4fdb0dace8/xontrib_navi-0.0.3.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n<a href=\"https://github.com/denisidoro/navi\">navi</a> (interactive cli cheatsheet) integration into <a href=\"https://xon.sh/\">xonsh</a> (shell)\n</p>\n\n<p align=\"center\"> \nIf you like the idea click \u2b50 on the repo\n</p>\n\n\n## Install\n\n```xsh\nxpip install xontrib-navi\n# or: xpip install -U git+https://github.com/eugenesvk/xontrib-navi\n```\n\n## Configure\n\n- Add the following to your `.py` xontrib loading config and `import` it in your xonsh run control file (`~/.xonshrc` or `~/.config/rc.xsh`):\n```py\nfrom xonsh.xontribs \timport xontribs_load\nfrom xonsh.built_ins\timport XSH\nenvx = XSH.env\n\nxontribs = [ \"navi\", # Initializes navi (interactive cli cheatsheet)\n # your other xontribs\n] # \u2193 optional configuration variables (use `False` to disable a keybind)\nif 'navi' in xontribs: # Configure navi only if you're actually loading it\n # config var \t value\t |default|alt_cmd\u00a6 comment\n envx[\"X_NAVI_KEY\"]\t= \"\u2388g\" \t#|c-g| False\u00a6 Autofill existing command with navi's best match or launch navi if no good match found\n\nxontribs_load(xontribs) # actually load all xontribs in the list\n```\n\n- Or just add this to your xonsh run control file\n```xsh\nxontrib load navi # Initializes navi (interactive cli cheatsheet)\n# configure like in the example above, but replace envx['VAR'] with $VAR\n$X_NAVI_KEY\t= \"c-g\" # ...\n```\n\n## Use\n\n- Autoreplace the command without invoking any manual selection UI with `navi`'s best match:\n <br/>`git sta` <kbd>\u2388</kbd><kbd>g</kbd> `git status`\n - or hit it again to invoke the manual seletion UI:\n <br/>`git status` <kbd>\u2388</kbd><kbd>g</kbd> navi UI\n - but failed best match will do nothing:\n <br/>`git stu` <kbd>\u2388</kbd><kbd>g</kbd> `git stu`\n- Split multiple commands and only autofill the one at the \u2038cursor position:\n <br/>`git sta\u2038; git show` <kbd>\u2388</kbd><kbd>g</kbd> `git status\u2038; git show`\n <br/>`ls -a\u2038 | rg 'txt'` <kbd>\u2388</kbd><kbd>g</kbd> `ls -alt \u2038| rg 'txt'`\n\n\n## Known issues\n\n- 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)\n\n## Credits\n\nThis package was created with [xontrib template](https://github.com/xonsh/xontrib-template)\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Navi (interactive cli cheatsheet) integration",
"version": "0.0.3",
"split_keywords": [
"xontrib",
"xonsh"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "68e9cd5bbf19690d20fe308cc06abfe126fced634451330ecadb1419eabf537a",
"md5": "f848533d7fa6577562d5697bbf00973f",
"sha256": "057c80f9a0cf29e789cd5ce20908dce88a24f7e153757f31d36fd46ec8a9a1af"
},
"downloads": -1,
"filename": "xontrib_navi-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f848533d7fa6577562d5697bbf00973f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4892,
"upload_time": "2023-03-12T09:59:24",
"upload_time_iso_8601": "2023-03-12T09:59:24.339453Z",
"url": "https://files.pythonhosted.org/packages/68/e9/cd5bbf19690d20fe308cc06abfe126fced634451330ecadb1419eabf537a/xontrib_navi-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c821ecf67d3fbd5ece0ac9f8f6cfbf51dca3600dc500a3afffe9cd4fdb0dace8",
"md5": "83f999c53a380e222c94426545f98dc5",
"sha256": "aad3ba2bf1640cf767d1480b8ee23d9822707c8392a31fbbb554388399c3c656"
},
"downloads": -1,
"filename": "xontrib_navi-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "83f999c53a380e222c94426545f98dc5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4765,
"upload_time": "2023-03-12T09:59:25",
"upload_time_iso_8601": "2023-03-12T09:59:25.828480Z",
"url": "https://files.pythonhosted.org/packages/c8/21/ecf67d3fbd5ece0ac9f8f6cfbf51dca3600dc500a3afffe9cd4fdb0dace8/xontrib_navi-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-12 09:59:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "eugenesvk",
"github_project": "xontrib-navi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xontrib-navi"
}