Questions tagged [fzf]

fzf is a general-purpose command-line fuzzy finder written in Go.

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

How can I update content being piped to FZF?

I want to poll something and then pipe results to FZF, such that it gets updated there. Here is an example using CURL: while true; do curl google.com -s; sleep 2; done | fzf This stacks-up all the ...
  • 443
0 votes
1 answer
110 views

How to create custom find files command using fzf.vim?

I am using fzf.vim, I have set FZF_DEFAULT_COMMAND='fd' to improve search speed. But 'fd' default behavior will respect .gitignore, .ignore files, and filter hidden files. It's useful in most cases, ...
  • 2,733
0 votes
1 answer
55 views

Force fzf :Tags to use a specific file with vim

I'm using fzf for a few weeks now and it really changed my workflow. I'm working on a big project with multiple things interconnected. I'd like to use :Tags command to have an overview of all existing ...
0 votes
1 answer
103 views

How to run FZF in vim in a directory where the directory path comes from a function?

I'd like to run fzf file finder (inside vim) on a custom directory, but the directory name varies at runtime. For e.g., say, vim is started at the root of project directory. The subdirectories look ...
  • 3
1 vote
0 answers
18 views

fzf: how do I get fzf to _not_ store in history commands that have errored?

When I pass in inavlid args to a command, I would like fzf to not store that command in history. How do I do this?
  • 5,714
0 votes
0 answers
17 views

fzf: score certain filetypes higher

I have something like the following command: ag -g "" | fzf So, the Silver Searcher gives me a list of files and fzf filters them. I have .java and .ts files (among others) in the project, ...
  • 61
0 votes
1 answer
64 views

How do I remove Library and Music from searching with Ripgrep and FZF?

I'm trying to configure rg and fzf on my mac, but really cannot work out how to clear out lots of annoying files from search. I have a ~/.gitignore with the following: Library/* Music/* (and I also ...
  • 3,281
0 votes
0 answers
27 views

autocomplete query and add extra characters in fzf

Is posible to autocomplete the search and pass extra characters to a string? example: echo "https://stackoverflow.com/search?q=\\nhttps://github.com/search?q=" | fzf
0 votes
0 answers
81 views

Execute highlighted command with single keypress in fzf

I'm using fzf Ctrl+R binding to navigate the command line history. Now first Enter keypress selects the command, and the second one executes it. Is it possible to configure fzf to perform both of ...
  • 991
2 votes
1 answer
128 views

How to add a specific folder tree to the fzf search list?

I use fzf in bash on Gentoo Linux and configured it in the ~/.bashrc with if [ -x "$(command -v fzf)" ] then source /usr/share/fzf/key-bindings.bash fi export FZF_DEFAULT_OPTS=" --...
  • 6,682
1 vote
0 answers
100 views

Golang, FZF picks only first line, problem with logic?

I'm using fzf to select objects in a list, so i thought of passing the STDIN of Formcars(),and passed it to fzf as a buffer. code: func Formcars() { ..... //some code for _, res := range resp....
  • 319
1 vote
1 answer
121 views

Golang how would you pipe the stdout of a function to another function that executes fzf

Say we have a the following function: func example() { fmt.Println("January") fmt.Println("February") fmt.Println("March") } Now we need another function which ...
  • 319
1 vote
1 answer
297 views

Use fdfind and fzf to open files in mpv

kdialog-open-files.lua and zenity-open-files.lua are two projects that use KDE KDialog and Gnome's zenity respectively to open files in mpv. I wish to do the same using fdfind and fzf. As illustrated ...
1 vote
1 answer
529 views

Formatting fzf multi-select output for mpv

The following works: # play file1 and then file 2: mpv "file1" "file 2" # use fzf to select a file and play that file: mpv "$(fdfind . /path/to/Music | fzf)" Now fzf -...
0 votes
0 answers
180 views

reverse search history with fzf requires an extra enter to be printed on the prompt

I'm trying to write a zsh bindkey in order to reverse-search into the history with fzf: This is an excerpt of my loaded .zshrc: function _reverse_search() { local selected_command=$(fc -rl 1 | ...
  • 2,328
2 votes
1 answer
154 views

Bash function defined in .bashrc is not found within fzf calls

I'm setting up a bash command utility based on fzf. I use some functions defined in my .bashrc to provide input to the program, as well as to handle the preview window. The problem is that within fzf, ...
  • 1,571
0 votes
0 answers
87 views

How to serve a terminal app (using fzf) cross-platforms in python

I've been building a tool that heavily relies on fzf (a text application) as the UI. To make it work multi-platform I'm kind of supporting different terminal GUIs for each platform (Mac, Linux). I ...
0 votes
1 answer
803 views

How can I use Telescope.nvim to complete a path in insert mode?

Fzf.vim implements a fuzzy finder in insert mode, extending the native ins-completion functionality. For example: in insert mode, we can map <c-x><c-f> to enable Fzf.vim to fuzzy find and ...
3 votes
1 answer
373 views

How to copy the fzf query to the command line?

I'm wondering if there is a way to make the fuzzy search tool "fzf" copy the query to the command line to be able to edit it, in case there is no satisfactory match. Thanks.
0 votes
1 answer
139 views

piping zsh functions to another shell command

I'm trying to apply this approach in a more generic way. I adopted the code in ~/.zshrc as follows: 27 │ irg() { 28 │ RG_PREFIX="rg --column --line-number --no-heading --color=always --...
  • 49
2 votes
0 answers
137 views

How to preserve the order of the output of the command when piping to fzf

I have bash function that allows me to copy a line from history. Here's the function history_cp() { history | sort --reverse --numeric-sort | fzf | awk '{ $1=""; print }' | ...
1 vote
1 answer
627 views

fzf keybindings doesn't work with zsh vi mode

fzf ctrl+r doesn't work anymore after I started to use zsh vi-mode. My zshrc file is here: function zvm_config() { ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT ZVM_VI_INSERT_ESCAPE_BINDKEY=jk } source /opt/...
0 votes
0 answers
264 views

How to launch fzf text search with context preview?

When I pipe text into fzf how can I make it display search preview which includes context around the search match so that it works like live grep -C5 text command?
  • 16.8k
1 vote
0 answers
305 views

Zsh completion with fzf-tab doesn't work with dotnet command

I enabled zsh completion and added fzf-tab via zinit. It works as expected. I added some custom/extra completions e.g., aws cli and it also worked as expected. However, when I tried to enable the ...
0 votes
0 answers
130 views

Fzf script to cd into directr with spaces [duplicate]

Hi i was trying to make a script with fzf to cd into a dir by searching name of a file in that directory fcd(){ cd $(find | fzf ) } but it will throw error when filename contains space, as it ...
1 vote
0 answers
241 views

Use fzf to search for history commands run in current directory only

Is it possible to use fzf to search for history commands run in current directory only? If it is not possible using fzf, is there any functionally similar tool that allows this?
  • 18.6k
2 votes
1 answer
615 views

fzf not workign with git bash (installation via scoop)

I installed fzf via scoop on windows 10 but unfortunately it works well on cmd but impossible to make it work on git bash. I found a similar topic here: Is it possible to use fzf (command line fuzzy ...
1 vote
1 answer
250 views

Is there a way to copy a word under the cursor and paste it in fzf line search in vim?

I want to put a word under my cursor like CACHED_VALUE, and I want to put it in fzf line search :Lines or :GFiles, is there a way to achieve this?, because sometimes the variable name is big and ...
  • 355
1 vote
0 answers
135 views

Show whole lines while piping live logs to fzf

I'm trying to pipe logs to fzf so that I'll be able to filter them live, as my program spits a lot of logs out. However, I've noticed the long lines get truncated and I have no way to show the whole ...
  • 2,878
0 votes
0 answers
114 views

Chinese characteres are not properly rendered in CMD/Powershell

I have this rendering issue on Chinese characters on multiple console app: fzf, lazygit and vim (when running fzf). I have set the chcp to 65001 as default, using the correct font for Chinese (so the ...
0 votes
2 answers
770 views

zsh fzf search path is strange on Mac

I installed fzf for the zsh on my Mac I usecd ** <Tab> , instead of getting a list of directories which can get into I always get a long list of directories,such as How to solve this problem? ...
2 votes
0 answers
141 views

How does fzf manage stdin?

fzf fuzzily searches for a needle in a haystack. Consider the following snippet: (sleep 5 && printf "this is some\ninput") | fzf During the sleep, I'm still able to type things to ...
0 votes
1 answer
366 views

Broken terminal after piping fzf + xargs + less on Kitty + Bash

I'm trying to combine fzf output with a command launched through xargs whose output needs to be paginated with less. The simplest example using basic commands is the following: echo test | fzf | xargs ...
2 votes
1 answer
4k views

How to use fzf to search for directories only?

Here is a use case: I use fzf to search for a list of directories, which then used with the cd command: cd $(fzf) However, the fzf command only displays files, not directories. Is there a way to ...
  • 36.6k
0 votes
1 answer
755 views

Make fzf `**<TAB>` completion only return files for specific command (caveat inside!)

I'm trying to make fzfs autocompletion invoked on cat **<TAB> return only files (directories does not make sense for cat). According to docs it's the matter of defining _fzf_complete_cat(), so ...
  • 278
3 votes
1 answer
255 views

FZF VIM: removing leading portion of absolute path

I am using the following to search my project: let g:fzf_directories = join( \ [ \ "/some/long/path/to/project/dir", \ "more paths here..." \ ], ' ') let $...
  • 2,761
3 votes
1 answer
2k views

Search text inside all files in all directories (and subdirectories) in project with SpaceVim

So I just started using Neovim/Spacevim, and it's so awesome! I am still getting used to everything, since I have never used Vim or anything like that before. My question revolves around searching for ...
  • 412
0 votes
0 answers
521 views

FZF not finding dirs

I have a ~/GitHub dir, which I can locate with find GitHub. I have a default installation of fzf, which uses find. When I run fzf on the home dir, fzf doesn't find GitHub dir. If I pipe so: find ...
  • 1,081
0 votes
1 answer
2k views

How can I specify that fzf --preview should only find files within the current directory?

fzf --preview 'cat {}' gives me a two-pane terminal window of (left) a fzf fuzzy search for files and (right) a preview of said files. When called, it starts out showing me /Users/tomnorway/Downloads, ...
  • 2,405
1 vote
1 answer
208 views

pipe fzf selection to text manipulation to zsh prompt (without executing)

Here's a function that executes a selected alias using fzf: fa() { eval $(alias | fzf | cut -d'=' -f2 | sd -p "'" '') } The problem is that sometimes you want to add more arguments to ...
  • 160
0 votes
1 answer
115 views

How can i use pipe with argument in Linux/Unix-like

i want do something like that: $ ( foo1.sh $1 | foo2.sh | bar.sh |) arg sometime pipe is fast than write function, but i can pass parameters/args between pipe now: I'm triad to search for package ...
  • 147
2 votes
0 answers
242 views

How to keep search window?

Disclaimer: I don't know all the correct terminology here. When I say "window" it might be "quickfix modal dialog" or something. I am using Neovim (through Neovide) and have these ...
  • 2,960
4 votes
2 answers
2k views

preview not working on neovim 0.5 on windows 10 with fzf

i'm running neovim 0.5 with fzf-vim on windows 10 and can't seem to make preview to work. my init.vim per below: call plug#begin('~/AppData/Local/nvim/plugged') Plug 'junegunn/fzf', { 'do': { -&...
1 vote
0 answers
160 views

How to pass nested parameters to fzf in vim?

How can I make the function Function1 fzf pass var1 to the function Function2? I know you can do this "function ('s: Function2', [a: var1])", the problem is that it will no longer pass the ...
3 votes
3 answers
2k views

How to close FZF without select any result in VIM

I use fzf.vim to quickly find files in my projects in neovim. Sometimes either because I can't find what I'm looking for or because I forgot to do something before open the new file, I need to cancel ...
  • 169
11 votes
3 answers
6k views

How to start fzf from a different directory than the current working directory?

I often use fzf to navigate the filesystem, especially the Alt-c key binding. When invoked, fzf generates a list from the current working directory. Is it possible to make fzf generate a list from a ...
  • 10.7k
1 vote
2 answers
779 views

FZF - Search the target folder

I've been using fzf for a while now and finding it really great, however there is one thing I want it to do but I don't think I'm Googling the correct words. I use it with neovim on a zsh terminal and ...
  • 827
0 votes
1 answer
1k views

How do I cleanly remove fzf integration from fish?

I installed fzf (https://github.com/junegunn/fzf#fish-shell) using brew on Mac. The other day I removed it using brew. Now I get the following message whenever I open a fish shell: fish: ...
  • 18.6k
1 vote
1 answer
1k views

Some .zshrc settings aren't loaded

I have a MacBook with Iterm2 with Zshell (zsh) and one of the add-ons I have is the command line fuzzy finder (fzf), but despite being added to my .zshrc it doesn't work. If I manually load it with ...
  • 690
0 votes
1 answer
936 views

NerdTree or FZF ignores .env files

Either nerdtree or fzf ignores .env, I have a .env in my working folder, but I can't find it with fzf nor in nerdtree. Here's my vimrc: https://github.com/dipzera/nvim
  • 75