GithubHelp home page GithubHelp logo

chmouel / fzf-select-file Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 43 KB

Select Files with FZF is a ZSH plug-in letting you selects files on the command line with fzf and eza

License: Apache License 2.0

Shell 100.00%
exa fzf zsh-plugin shell zsh

fzf-select-file's Introduction

FZF select file zsh plugin

A simple plugin to let you select some files on the command line with fzf and eza

Install

Using zplug

zplug 'chmouel/fzf-select-file'

Or any ZSH plugin manager (I use this own made one vtplug)

You can as well simply git clone this repository and source the fzf-select-file.plugin.zsh file if you want to do this just manually.

Requirements

You need to have those tools installed:

  • fzf (for selection)
  • eza (for listing)
  • bat (for preview)

Usage

C-x C-f (or control-x followed by control-f) will launch fzf with a listing from eza, you can select one or multiple files (with the tab keys) and it will be added to the command line. If you have a word on the command line it will be used as the initial query for fzf and replaced with the results.

By default it will show the files without the 'hidden' files (the ones starting with a dot) if you want to include them you can use the C-x C-a (or control-x followed by control-a) keybinding to show them.

While in selection it will show a preview with bat for files or eza for directories (may fail on unknown files to bat) press control-v to hide the preview.

Demo

recording-20230911-18h46.mp4

Configuration

You can customize some variables

  • ZSH_FZF_SELECT_FILE_FZF_ARGS: The arguments to fzf.
  • ZSH_FZF_SELECT_FILE_EZA_BINARY: The binary to use for eza, default to eza.
  • ZSH_FZF_SELECT_FILE_EZA_COLORS: The eza colors to use default to da=00.
  • ZSH_FZF_SELECT_FILE_EZA_ARGS: The arguments to eza.
  • ZSH_FZF_SELECT_FILE_BIND: The keybinding to use default to "^x^f".
  • ZSH_FZF_SELECT_ALL_FILES_BIND: The keybinding to use default when selecting all files including the dot files, default to ^x^a.
  • ZSH_FZF_SELECT_FILE_FZF_PREVIEW: The preview shell command (see source for default).

TIPS

If you want to make Control-x Control-f select all you just need to set this in your config file before loading the plugin:

ZSH_FZF_SELECT_ALL_FILES_BIND="^x^f"

Copyright

Apache-2.0

Blog

Authors

Chmouel Boudjnah

Alternative

You can as well use the FZF ZSH Plugin to get everything selected with fzf in zsh but no pretty eza listing in there...

Thanks

fzf-select-file's People

Contributors

chmouel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fzf-select-file's Issues

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.