Git Product home page Git Product logo

fzfx's Introduction

fzfX

fzfX multiplies the power of fzf by providing zero-configuration battle-tested applications to common use cases of fzf. It delivers the power of finding, previewing, editing and managing any file in few key strokes.

It is agnostic and does not require a specific terminal emulator, desktop environment or text editor. It will make use of improved utils that are becoming standard at Linux desktop environments, like rg, fd, bat, rga, grc and many others. But it will sensibly fallback to their classic UNIX counterparts like grep, cat and ls when they are not available.

Find files anywhere

asciicast

fzfx

By default it will use $HOME as the search path but that can be overrided or disabled entirely.

Optionally the search path can be inputted in the command. Which will also work for other modes.

fzfx <searchPath>

Find anything

asciicast

fzfx hidden

By default hidden files, cache/vendor directories like node_modules (see /usr/share/fzfx/ignore) are ignored and .gitignore files inside directories are followed.

Dynamically find a string inside files

asciicast

fzfx full

Note: Supports regular expressions.

Change directory

asciicast

fzfx cd

To change dir with ENTER create an alias:

alias fcd='cd "$(fzfx cd)"'

Note: Needed because a child shell can't act on its parent.

If you don't know how aliases work, try using this configuration as an example.

Note: Aliases must be put or be sourced in .profile or RC files like .bashrc so to work persistently.

Copy any file to current dir

asciicast

fzfx cp

Move any file to any dir

asciicast

fzfx mv

Manage processes

asciicast

fzfx ps

Find files with special cases

# markdown notes
fzfx md

# pdf, ps and eps
fzfx pdf

# pictures
fzfx pic

# audio and videos
fzfx av

Setup

Install through the AUR.

Configure

Edit $XDG_CONFIG_HOME/fzfx/config

  • Set searchPath to override the global search path.
  • Set searchLocal=true to always search locally.
  • Set editor to override the editor used by fzfx.
  • Set ignoreFile to override the default ignore file (.gitignore style).
  • Set defaultPreview, pdfView, avView, picView to whatever you prefer.

Note: All configurations are optional.

Note: $root is still supported but support will be dropped in next release. So update your config file.

fzfx's People

Contributors

danisztls avatar imlew avatar mbab avatar xphyro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

logix2 xphyro mbab

fzfx's Issues

Dynamic filtering

Instead of having multiple modes for fd (f, fhidden, fmd, fpdf, etc) I want to merge those in a single mode with a single query constructor supporting dynamic filtering. So user can just run f and then press a bind to include hidden files or another to filter for file type and even use more than one filter at the same time.

As I found file extension filtering is somewhat redundant as a .md on the query string would filter for files with that extension but miss those that might be named .MD or .markdown.

Additionally user should be able to filter for files or directories but that might be problematic to do in a single mode due to preview incompatibility between both.

This was inspired by some of the suggestions made by @se7en-x230 on #7.

Change delete bind to a safer alternative

As it can lead to tragic mistakes the trashing file shortcut should be renamed to some combination instead of just DEL.

^DEL aka ctrl-DEL, shift-DEL or any variation of DEL is not supported by Fzf.

^D is not a good alternative as it is the end of transmission bind used extensively on CLI.

So I'm thinking on using shift+alt+D.

Preview window remains open when searching for processes

When running fzfx ps, the preview window appears on the right which isn't very helpful. From the screenshots in the README I'm assuming this is not supposed to appear.

I have made no configuration changes from the default fzf package installed from Arch. I tried running the command after removing the fzf plugin from oh-my-zsh, deleting any relevant fzf lines in my .zshrc.

image

Open file

Hi, so I found the file I want and now I want modify it, how do I do that directly/quickly?

Zsh Plugin

This is a popular install method for Zsh users as myself.

This is trick because currently it's written in Bash. My goal is to make it OS/environment agnostic so Linux users with Bash only can use it and also Mac/Linux users with Zsh only. But I will not maintain multiple versions.

Support moving directories

Moving directories with fmv currently isn't practical as it's almost impossible to select one in the first place as the results would be polluted by all the files contained in it.

Hopefully #14 will solve it.

Preview images

Implement previewing images (if reasonably possible) using applications like catimg or a the native graphics protocol supported by the user term.

"fzfx cd" doesn't work if the root config option is set

I've got root="$HOME" configured in my fzfx config file. As a result of this however, fzfx cd no longer works as expected. Running fzfx cd and selecting the directory only results in the (relative) path printing to the console - it doesn't actually change the directory.

Example in bash - attempting to cd to ~/Games/Diablo2 via fzfx:

$ pwd
/home/dexter/Downloads
$ fzfx cd
Games/Diablo2
$ pwd
/home/dexter/Downloads

fzfx version: fzfx-git v1.1.3.r1.g7b862da-1
Bash version: 5.1.4(1)-release (x86_64-pc-linux-gnu)
OS: Arch Linux x64

Add suport for Uni

Uni is a tool to "query the Unicode database from the command line, with good support for emojis."

Switch between sources/modes

Switching between sources is not problematic as only the query would change and Fzf even have an example of it on the README.

FZF_DEFAULT_COMMAND='find . -type f' \
  fzf --bind 'ctrl-d:reload(find . -type d),ctrl-f:reload($FZF_DEFAULT_COMMAND)' \
      --height=50% --layout=reverse

But switching between modes like conventional file search to ps, cd, cp, mv is another story.

One difficulty is dealing with source/mode specifics. Having a complex spaghetti codebase that is difficult to maintain and improve is not desired.

Improvements

Is it possible to toggle on/off hidden files or at least make them default on?

  • most linux files to be edited are . files
    Would it be possible to add cp/mv maybe even cd to a F# keybinding as default editor clipboard ...?
  • That would make the tool more flexible.

very nice tool by the way.

Add folder to the ignore list

I would like to add Trash/ and pCloudDrive/ to the ignore list. I did add them to the end of the list but fzfx still shows them.
What am I doing wrong?

Hanging on Fulltext

Fulltext mode is hanging when opening a file. What is happening is that queries aren't getting aborted so Fzf hangs in the background waiting queries to finish. Bug is difficult to observe but I think I fixed it.

If it is observed again I can try to:

  • Use & to paralelize file opening
  • Terminate queries with killall
  • Report bug on upstream

Invoke actions on the run

Instead of having to run fmv or fcp to move and copy files user should be able to invoke a move or copy action for the selected file/directory when in the default mode file search mode.

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.