Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laloch/xontrib-fzf-widgets
Set of fzf widgets for xonsh
https://github.com/laloch/xontrib-fzf-widgets
fzf xonsh xontrib
Last synced: 3 months ago
JSON representation
Set of fzf widgets for xonsh
- Host: GitHub
- URL: https://github.com/laloch/xontrib-fzf-widgets
- Owner: laloch
- License: gpl-3.0
- Fork: true (shahinism/xontrib-fzf-widgets)
- Created: 2018-07-23T16:04:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T11:07:25.000Z (6 months ago)
- Last Synced: 2024-07-06T00:00:46.209Z (4 months ago)
- Topics: fzf, xonsh, xontrib
- Language: Python
- Homepage:
- Size: 252 KB
- Stars: 33
- Watchers: 2
- Forks: 18
- Open Issues: 19
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-xontribs - fzf-widgets - Adds some fzf widgets to your xonsh shell. (Plugins / Prompt tweaks)
README
`FZF `_ Widgets for `Xonsh `_
======================
Based on (`now archived `_) work of `@shahinism `_. Thank you!The official home of `xontrib-fzf-widgets` is now at https://github.com/laloch/xontrib-fzf-widgets.
.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
:alt: License
:target: http://www.gnu.org/licenses/gpl-3.0.. image:: https://img.shields.io/pypi/v/nine.svg
:alt: Pypi version
:target: http://pypi.python.org/pypi/xontrib-fzf-widgetsThis extension will add some fzf widgets to your xonsh shell that you can bind and use as follows:
.. figure:: https://raw.githubusercontent.com/shahinism/xontrib-fzf-widgets/master/docs/cast.gif
:alt: ScreencastCurrent widgets
----------------- **ssh:** Search in `/etc/ssh/ssh_config` or `~/.ssh/config` items and issue `ssh` command on the chosen item.
- **history insert:** Search in all history entries and insert the chosen command to the prompt.
- **find file:** Find one or more files in the current directory and its sub-directories.
- **find directory:** Similar to the previous one, but intended to only search for directories.How to use it
----------------Install the package:
.. code-block:: sh
pip install xontrib-fzf-widgets
Enable it by adding `fzf-widgets` to your `~/.xonshrc` file:
.. code-block:: python
xontrib load fzf-widgets
And set your desired keybindings for each widget in `~/.xonshrc` file or set it to `None` to disable it:
.. code-block:: python
$fzf_history_binding = "c-r" # Ctrl+R
$fzf_ssh_binding = "c-s" # Ctrl+S
$fzf_file_binding = "c-t" # Ctrl+T
$fzf_dir_binding = "c-g" # Ctrl+GYou can find the names of various keys here_ in ``python-prompt-toolkit``.
.. _here: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/keys.py
Other configuration variables:
- ``$fzf_find_command``: A command used by `fzf` to search for files.
- ``$fzf_find_dirs_command``: A command used by `fzf` to search for directories... code-block:: python
$fzf_find_command = "fd"
$fzf_find_dirs_command = "fd -t d"Troubleshooting
----------------
- If `fzf` shows garbled file names like ``[1;38;5;63maur[0m``, those extra characters are terminal control codes. That most probably means your file finder is set up to produce colorized output. You can either change your ``$fzf_find_command`` and ``$fzf_find_dirs_command`` to remove the coloring or add ``--ansi`` switch to your ``$FZF_DEFAULT_OPTS`` environment variable if you want to preserve the colors. See ``man 1 fzf`` for details.