Git Product home page Git Product logo

fzf-scripts's Introduction

fzf-scripts

This is a collection of scripts I've written that use fzf

Almost all of them require various tools from coreutils like awk sed cut, and probably make use of GNU extensions.

an interactive wrapper around some docker commands

Lists or searches for files and opens them with a command, defaults to vim. Kind of a shortcut for vim $(ag 'foo' | fzf), lists files if no search string is given.

Interactive git wrapper. Very much still a work in progress, but it has some very cool functions already.

depends on git and perl

A small wrapper around buku to search bookmarks

Lists and searches for songs in an MPD library by artist, album, or playlist. I wrote a blog post about writing this script.

depends on mpc

Interactively move files. It was originally just an experiment to see what it would be like to make a file explorer with fzf.

runs stdin against programs like sed, awk, jq and shows the result in the preview window

A wrapper around ddgr to search the web using DuckDuckGo. Accepts all ddgr command line arguments. For example, to search Wikipedia for "hello world":

ddgsearch \!w hello world

depends on jq and ddgr

Interactive grep/rg wrapper

Uploads files to ix.io and allows listing and editing of uploads.

depends on curl

Searches npmjs.com and installs packages with yarn if available or npm.

depends on npm and jq

Searches repos and installs multiple packages. Currently works with Debian, Ubuntu and Arch, and experimental support for Fedora and Void.

Lists and removes packages, optionally sorts by size.

depends on pacman

Lists files from remote servers and rsyncs them to the current directory

List and connect to wifi networks

depends on nmcli

Install

Currently there's no installation script, but if you clone the repo you can easily symlink the scripts here with something like:

cd /path/to/repo/fzf-scripts
find -maxdepth 1 -executable -type f -exec ln -s -t $HOME/.local/bin $PWD/fzf-scripts/{} \;

Notable Mentions

  • forgit - a better version of fzgit
  • fzf-tab - use fzf to tab-complete everything in your shell

Legal

Copyright (C) 2023 Ronald Joe Record [email protected] Copyright (C) 2016 Daniel F Gray [email protected]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

fzf-scripts's People

Contributors

danielfgray avatar doctorfree avatar pvonmoradi avatar vijaymarupudi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

fzf-scripts's Issues

screenshots?

Some screenshots or gifs showing the scripts in action would probably be helpful

asciinema might be ideal

[fzmp] Queuing "Greatest hits" queues ALL albums with same name,

grim-193346

I queued up 1 album, in this case Nevermore/Greatest Hits, and it subsequently queued up all the "greatest hits" I have from all artists.

Steps to reproduce:

  • Have the same album name by multiple artists
  • F3 to artists, navigate to album, ctrl-space to add to playlist

no install script

needs an install script (or perhaps a Makefile) that will symlink specified scripts (or all scripts) to a specified location

[fzmp] unmatched `

grim-220838

Not a massive bug, I can live with it tbh, but listing artist view, if it has a character like ` then it throws up this error in preview. Outside of the album view it is fine, just soon as you "go into" the artist and view as in screenshot...

[fzmp] Use double click to activate same as enter.

Still using this, it's great. might sound odd for a TUI based tool but my workflow sometimes is I have fzmp open in floating window via middle-click waybar mpris, then I do what I need to do, but I've setup my WM (sway) to use mouse a lot when I'm ultra lazy, so I'd like to at least be able to open it up, scroll and double click. This can be as simple as play the media, or can be expanded maybe with right click multi-selector, and depending what context it is, play media or add to playlist. What do you think?

fzmp - playlists menu and 'clear playlist' key

First off, this is brilliant. I've not touched ncmpcpp since. Only thing I would like to request is to have a menu (an F key same as rest) to list the users playlists, with the ability to select/load it.

Also, the option to quickly clear the currently playing playlist. With fzf -m I can select multiple entries which is nice, but a quicker clear all option (other than a terminal mpc clear) would be welcome.

edit: Just thought of 1 more. Like ctrl-space adds to playlist in 'artists' view, maybe have ctrl-enter to queue tagged (using fzf -m) / selected entries in 'songs' and 'artists' view ?

I modified your interactive ripgrep, here is the new version

thank you so much for sharing your awesome igr script on the web.
igr really helped me when i was dealing with bugs setting stuff up.

in the spirit of your LICENSE, here is the modified version of your code:

function irg() {
  declare preview='bat --color=always --style=header,numbers -H {2} {1} | grep -C3 {q}'

  while getopts ':l' x; do
    case "$x" in
      l) list_files=1
        preview='bat --color=always --style=header,numbers {1} | grep -C3 {q}'
        ;;
    esac
  done
  shift $(( OPTIND - 1 ))
  unset x OPTARG OPTIND

  rg --color=always -n ${list_files:+-l} "$1" 2> /dev/null |
  fzf -d: \
  --ansi \
  --query="$1" \
  --phony \
  --bind="change:reload:rg -n ${list_files:+-l} --color=always {q}" \
  --bind='enter:execute:echo "code -rg {1}:{2}" && code -rg {1}:{2}' \
  --preview="[[ -n {1} ]] && $preview" 
}

TLDR:

  1. I made it into a function and renamed it irg to match interactive ripgrep in my brain.
  2. I changed what happens when you hit "enter":
    --bind='enter:execute:echo "code -rg {1}:{2}" && code -rg {1}:{2}' \
    this just opens the relevant file in VS Code in your active window, and jumps to the relevant line.
    before it does so, it echos the command to the terminal just so you can see later what file and line you opened

-r -> --reuse-window
-g -> --goto <file:line[:character]>

[fzmp][request] Allow file deletion.

mpc doesn't have the function itself I don't think, but could a keybind, or maybe dedicated menu for listing filenames, to let me delete the files?

fzfrepl

Hi @DanielFGray , fzrepl is fantastic, but I thought of several ways it could be improved:

  • use the selections window for selecting lines of history or prestored lines
  • keybindings for viewing the entire input or output
  • keybindings for viewing the commands manpage or other help notes

I've made these changes (and more) in fzfrepl. Since it involved rewriting a large proportion of the code I've made it into a seperate project rather than issueing a pull request. Hope you don't mind too much.

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.