Git Product home page Git Product logo

xontrib-fzf-widgets's Introduction

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.

License Pypi version

This extension will add some fzf widgets to your xonsh shell that you can bind and use as follows:

Screencast

Current widgets

  • ssh: Search in /etc/ssh/ssh_config or ~/.ssh/config items and issue ssh command on the chosen item.
  • history insert: Search in unique 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:

pip install xontrib-fzf-widgets

Enable it by adding fzf-widgets to your ~/.xonshrc file:

xontrib load fzf-widgets

And set your desired keybindings for each widget in ~/.xonshrc file or set it to None to disable it:

$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+G

You can find the names of various keys here in python-prompt-toolkit.

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

xontrib-fzf-widgets's People

Contributors

aszady avatar bovine3dom avatar couleeapps avatar cybrilla-rajaravivarma avatar deeuu avatar laloch avatar nh2 avatar re3turn avatar shahinism avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.