bartste / fzf-help Goto Github PK
View Code? Open in Web Editor NEWUse fzf to select command line options from `--help`
License: MIT License
Use fzf to select command line options from `--help`
License: MIT License
The search list does not populate when I trigger fzf-help, though the preview panel shows as expected.
Environment: macbook with zsh shell from homebrew. kitty terminal.
Notes: I installed things slightly differently than in the readme. I cloned the repo locally then appended to my zshrc:
FZF_HELP_OPTS="--preview-window=right,68%,nowrap --height 80% "
FZF_HELP_OPTS+="--bind ctrl-h:change-preview-window(down,75%,nowrap|right,75%,nowrap)"
source <path-to-cloned-repo/src>fzf-help.zsh
zle -N fzf-help-widget
bindkey "^H" fzf-help-widget
my config includes fzf-tab, fzf-tab-source, and jeffreytse/zsh-vi-mode. I use the ^H binding to avoid a conflict with ^A
Hello,
I am trying to bind fzf-help to another keybind, for example C-q, but it seems I am unable to.
I have added the following exports in my shell but nothing happens when i prewss C-q:
FZF_HELP_OPTS+="--bind ctrl-q:change-preview-window(down,75%,nowrap|right,75%,nowrap)"
bind -x '"\C-q": fzf-help-widget'
Can you please suggest if I am doing smth wrong.
Thank you
PS: This is a great utility ๐
batcat 0.19 is the version that is currently used by ubuntu. This version does not support --language=help
. We need a workaround for this.
fzf-help: 2.1.0
MacOS: 14.2.1
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
mktemp: option requires an argument -- t
usage: mktemp [-d] [-p tmpdir] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-p tmpdir] [-q] [-u] -t prefix
The changelog mentions bat-cli-.options but that does not exist. bat complains that syntax=help does not exist
I want to install this on my work computer.
Is there a way to install the zsh plugin in another directory?
Info:
Issue:
For some distributions like ubuntu 22.04 the bat executable is installed as batcat instead of bat. Therefore we get a bat execution error.
Solution
It can be solved by making a simlink. But it would be better if the script supports bat and batcat instead.
When running fzf-help on the command pip
(using a keybind), and scrolling down the options, the wrong row is highlighted in the preview window.
I think the pip --help
command is wrapped (at 80 chars) before the line numbers are retrieved. The preview window is not wrapped at 80 chars, so the line numbers do not match.
fzf-help uses the default fzf ordering which puts the option list in reverse order. This means that you need to scroll up to move through the options, and the preview window scrolls down as you do. It's confusing to have the list and the preview moving in opposite directions. Maybe consider adding --reverse
to the default FZF_HELP_OPTS
in fzf-select-option. This makes it behave the same as fzf-file-widget where you start at the top and scroll down.
Any chance this could be supported on fish shell as well? I am pretty sure the changes are minimal and mostly around the install script.
trying fd<C-a>
results in this error
fd /Users/chrisgrieser/.config/zsh/plugins/fzf-help/cli-options: line 59: h: command not found
When trying to run the installer and/or the cli, I got an error that bash
was not found. I looked into it, and it seems the shebang is the cause of that issue.
Not sure which macOS versions this concerns, but on my macOS version, which bash
results in /bin/bash
, not usr/bin/bash
.
Consequently, replacing all shebangs with #!/usr/bin/env bash
did fix the issue for me.
You may want to use bat --language help
for some syntax highlighting
To make installation as smooth as possible, add fzf-help to package managers. Start by making a pkgbuild for AUR.
it seems like the script finds all mentions of an option so if the help has a comment like "see also -f for more info" then it will show -f twice in the list. The options for ls command is a good example of this.
Maybe run the options list through uniq and maybe even sort it to get a more fitting list.
I have "php artisan" aliased to "art", this fails to recognise "art" as a command.
My aliases are defined in .zshrc, in case that's relevant.
More of a question than an issue per se, but would this work on Windows Terminal running Ubuntu 22.04 and Oh-my-zsh?
During installation, the repo is cloned and the install script is executed. During cloning, the demo is also downloaded, which is not needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.