Skip to content

srsudar/fzf-complete-flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

fzf-complete-flags

This script uses fzf to complete flags from your history by typing <c-q>.

demo

Installation

This relies on fzf, so make sure you have that installed.

The script assumes that you have gawk and rg (i.e. ripgrep) installed and on your path.

Also, normally <c-q> is already bound to a command. It is the counterpart to <c-s>, which I wouldn't be surprised if at some point you've accidentally entered and then wondered why your terminal was frozen. I've disabled <c-s> by putting this in my zshrc:

stty -ixon

If you want to keep default <c-q> behavior, you'll need a different trigger.

After all the dependencies are out of the way, source fzf-complete-flags.zsh. I have this block in my zshrc:

# Make sure you clone this first on new installations:
# git clone https://github.com/srsudar/fzf-complete-flags ~/.zsh/fzf-complete-flags
if [ ! -f ~/.zsh/fzf-complete-flags/fzf-complete-flags.zsh ]; then
  echo "fzf-complete-flags.zsh not found--did you clone the repo?" >&2
else
  source ~/.zsh/fzf-complete-flags/fzf-complete-flags.zsh
fi

Background

This began as an issue on the main fzf repo. This blog post describes what the script does.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages