Code Monkey home page Code Monkey logo

fzf-widgets's Introduction

fzf-widgets - ZLE widgets of fzf

Overview | Installation | Requirements | Usage | Configuration | License

license-badge release-badge

Overview

This repository manage ZLE widgets of fzf. Available widgets can check here.

screenshot

Pros

  • Can map widgets to whatever key you like
  • Can easily install with plugin manager
  • Can use with zsh-autosuggestions
  • Show error messages with $POSTDISPLAY
  • All widgets are autoloaded function

Installation

You can install with plugin manager. If use zplug, add the following to your .zshrc:

zplug 'ytet5uy4/fzf-widgets'

Requirements

zsh: version 5.0.2 or higher

Usage

  1. Map widgets to key with bindkey command
  2. Execute widget with mapped key

Configuration

You can map widgets to key and specify options of fzf to widgets. For example, add the following to your .zshrc:

if zplug check 'ytet5uy4/fzf-widgets'; then
  # Map widgets to key
  bindkey '^@'  fzf-select-widget
  bindkey '^@.' fzf-edit-dotfiles
  bindkey '^@c' fzf-change-directory
  bindkey '^@n' fzf-change-named-directory
  bindkey '^@f' fzf-edit-files
  bindkey '^@k' fzf-kill-processes
  bindkey '^@s' fzf-exec-ssh
  bindkey '^\'  fzf-change-recent-directory
  bindkey '^r'  fzf-insert-history
  bindkey '^xf' fzf-insert-files
  bindkey '^xd' fzf-insert-directory
  bindkey '^xn' fzf-insert-named-directory

  ## Git
  bindkey '^@g'  fzf-select-git-widget
  bindkey '^@ga' fzf-git-add-files
  bindkey '^@gc' fzf-git-change-repository

  # GitHub
  bindkey '^@h'  fzf-select-github-widget
  bindkey '^@hs' fzf-github-show-issue
  bindkey '^@hc' fzf-github-close-issue

  ## Docker
  bindkey '^@d'  fzf-select-docker-widget
  bindkey '^@dc' fzf-docker-remove-containers
  bindkey '^@di' fzf-docker-remove-images
  bindkey '^@dv' fzf-docker-remove-volumes

  # Enable Exact-match by fzf-insert-history
  FZF_WIDGET_OPTS[insert-history]='--exact'

  # Start fzf in a tmux pane
  FZF_WIDGET_TMUX=1
fi

License

Copyright (c) 2017 ytet5uy4

Released under the MIT License, see LICENSE.md.

fzf-widgets's People

Contributors

kba avatar popstas avatar ytet5uy4 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

Watchers

 avatar  avatar  avatar  avatar  avatar

fzf-widgets's Issues

Add git-log

git log --oneline | fzf-tmux --multi --preview 'git show {+1}'

Simple question.....

What on earth does ^@ mean?

Is it "ESC" + @ ?

It can't be googled and I can't find an explanation anywhere. In KDE it brings up a activity window.

Please could you update the readme with the answer?

CTRL + R is no longer working in zsh

Environment

  • zsh --version: zsh 5.4.2 (x86_64-ubuntu-linux-gnu)
  • uname -a: Linux saturn 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Actual behaviour

^R is throwing empty line "above" prompt

Expected behaviour

^R shows history prompt

Expansion of ~ isn't happening for cache directory

Looks like the expansion of ~ when setting the default cache directory isn't happening correctly

russell at sparky in ~/projects/dotfiles on master
± find \~
~
~/.cache
~/.cache/fzf-widgets

russell at sparky in ~/projects/dotfiles on master
± export FZF_WIDGET_CACHE="${XDG_CACHE_HOME:-~/.cache}/fzf-widgets"

russell at sparky in ~/projects/dotfiles on master
± echo $FZF_WIDGET_CACHE
~/.cache/fzf-widgets

I think perhaps using $HOME might be a better option.

command not found: private

Hello, I'm trying to include widgets with antigen. Widgets loads on macOS, but on Ubuntu outputs many errors begins with:

command not found: private
$ private
zsh: command not found: private

fzf-git-add outputs incorrect paths

Widget outputs paths like:

 MtREADME.md
??tzsh.yml

If i replace

git status --porcelain | \
  sed "s/^\(..\) /\1\t${base_path}/" | \
  grep "^.[MD?]" | \
  selector-select -m

to

git status --porcelain | \
  grep "^.[MD?]" | \
  cut -c 4- | \
  selector-select -m

Script output paths correct.

But I cannot understand purpose of $base_path.

Add widgets for github

  • fzf-github-show-issue
  • fzf-github-open-issue
  • fzf-github-close-issue
  • fzf-github-edit-issue

Support fzy (or user defined fuzzy finder)

fzy does smarter matching than fzf.

Would you consider supporting user selectable finders (eg fzy, fzf, peco, percol, selecta) via a variable?

Ideally, this variable could have a value like: fzy:fzf:peco:percol:selecta.

fzf-git-add don't execute git add after select

When I select files and press Enter, i see git add -- in command line.
demo

Plugin load with antigen, theme bira, other plugins disabled, macOS.

git add $(git status --porcelain | grep "^.[MD?]" | cut -c 4- | fzf -m)

works fine.

git 2.12.0
zsh 5.3.1

Add docker widgets

  • fzf-select-docker-widget
  • fzf-docker-kill-containers
  • fzf-docker-logs-container
  • fzf-docker-remove-containers
  • fzf-docker-remove-images
  • fzf-docker-remove-volumes
  • fzf-docker-start-containers
  • fzf-docker-stop-containers

FZF_WIDGET_OPTS: assignment to invalid subscript range

Environment

  • zsh --version: zsh 5.6.2 (x86_64-pc-linux-gnu)
  • uname -a: Linux Leonidas 4.19.12-arch1-1-ARCH #1 SMP PREEMPT Fri Dec 21 13:56:54 UTC 2018 x86_64 GNU/Linux

Actual behaviour

On starting a new terminal I get this error:

/home/me/.zshrc:109: FZF_WIDGET_OPTS: assignment to invalid subscript range

On line 109 I have the example configuration you give in your readme:

FZF_WIDGET_OPTS[insert-history]='--exact'

Expected behaviour

I don't know. I've never seen it work and don't know what it does.

Attempts to fix

  • Googled FZF_WIDGET_OPTS and found it only mentioned in your example.
  • Changed insert-history to fzf-insert-history and insert-history-line

Paste from fzf history don't replace command but append

Environment

  • zsh --version: zsh 5.1.1 (x86_64-ubuntu-linux-gnu)

  • uname -a: Linux popstas-server 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

  • fzf --version: 0.16.11 (ecb6b23)

  • antigen, oh-my-zsh

When I begin input command and complete it with ctrl+R:
df<ctrl+R>

Actual behaviour

dfdf -h (append to input)

Expected behaviour

df -h (replace input)

Unfortunally, this bug appears about 4-5 months ago, but I forgot to tell about this. Please tell if you cannot reproduce this.

Rename widgets

Why

The following widgets name is not clear.

  • fzf-git-add
  • fzf-git-checkout

What

Rename as follows.

  • fzf-git-add-file
  • fzf-git-checkout-branch

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.