Questions tagged [fzf]

Use for questions specific to the command-line fuzzy finder, fzf : https://github.com/junegunn/fzf

41 questions
12
votes
3 answers

fzf: ctlr-r not triggering history search on command line

I've installed fzf on debian 11 (bullseye). When I type in ctrl-r to trigger a history search, nothing happens. Works fine on my mac. I'm using zsh. UPDATE: tried adding bindkey '^r' fzf-history-widget to .zshrc but I just get a "no such widget"…
StevieD
  • 855
  • 2
  • 10
  • 23
9
votes
2 answers

Auto trigger history search in terminal using fzf (fuzzy finder)

Is it possible to trigger fzf history search automatically in zsh shell? In this video, the user clicks "Ctrl+r" to start the history search and then starts typing. Is it possible to start the history search automatically when I start typing…
kvs
  • 91
  • 1
  • 1
  • 2
6
votes
3 answers

How to get a fuzzy xdg-open with fzf in zsh?

THE QUESTION I've been trying to use fzf to bind a shortcut (preferebly Ctrl + o) to interactively search a file and pipe it to xdg-open in zsh. Many shortcuts are already part of the fzf utility, as long as you source the file located in…
pesader
  • 81
  • 4
6
votes
2 answers

How may I use regular expressions with fzf?

In vim for example, you search names like test1, test2 or test9 if you press /\. I'd like to have this "feature" like finding filesnames which have the word test in their filename. I tried it out: But it doesn't work, as you can…
TornaxO7
  • 167
  • 6
3
votes
0 answers

How to add the expanded version of commands involving fzf to history?

Say I would like to edit a file ./long/path/to/my/file/test.py with Vim, but I do not remember the path to the file. In this case, I would run vim `fzf` to use fuzzy search to find and edit the file. What gets stored in my ~/.zsh_history is vim…
Matt
  • 161
  • 6
3
votes
2 answers

Mapfile not removing trailing newline

Sample Data: Tab separated tsv file a.1.58 fadado/CSV https://github.com/fadado/CSV a.1.63 jehiah/json2csv https://github.com/jehiah/json2csv a.1.80 stedolan/jq https://github.com/stedolan/jq/issues/370 Following selects one record using…
Porcupine
  • 1,680
  • 2
  • 19
  • 45
3
votes
0 answers

How to have the results of an `fzf` selection enter my bash history?

FZF is a lovely tool, the main issue I have is that the commands I end up running with it don't end up in my bash history. Let's say I do this history | fzf And I choose a command I ran recently, say echo "hello". When I then go through my bash…
John Allard
  • 1,318
  • 1
  • 14
  • 23
3
votes
1 answer

Using fzf in a zle key binding

I have the following function in my .zshrc function foo() { filename="$(fzf)" } zle -N foo bindkey '^X' foo now if I call foo by typing it, it works as expected, but if I call it via the key-binding with ^X, the fzf buffer is empty. Can anyone…
noibe
  • 387
  • 3
  • 15
3
votes
1 answer

How to use fzf to search within all lines of files (ignore newlines)?

The fzf examples wiki page describes how fzf can be used to fuzzy search within the content all the files of a directory. But in the examples from the wiki page, e.g. with ag --nobreak --nonumbers --noheading . | fzf the files are split up by their…
Chris
  • 31
  • 3
2
votes
0 answers

Replicate backward search with fzf in zsh

I've been struggling to find a simple answer to this and it seems like it is not trivial to customise the default integration of fzf/zsh (would like to understand if I'm wrong here). I am looking for the following behaviours: The thing I'm…
rbhalla
  • 121
  • 1
2
votes
1 answer

Cannot source file using find, fzf, and xargs

I am trying to use fzf to select and activate different virtual environments. However, I am receiving the follow error: xargs: source: No such file or directory My command comprises three parts: find | fzf | xargs (1) find locates my virtual…
user2514157
  • 195
  • 9
2
votes
1 answer

zsh function with fzf selection requires Enter

I wrote a simple zsh function which allows me to select from the dirs-stack via fzf. My .zshrc looks like DIRSTACKSIZE='99' setopt PUSHD_IGNORE_DUPS # change to directory from the dirs stack fzf-change-dirstack () { cd "$(dirs -lv | cut -f2…
abu_bua
  • 251
  • 1
  • 11
2
votes
1 answer

How can I launch fzf inside vim and open the selected file on a split window?

How can I launch fzf inside vim and open the selected file on a split window? I don't want to install any plugin. I tried :!a=$(ls | fzf) && vsplit $a
testoflow
  • 117
  • 8
2
votes
1 answer

How to use terminal as program runner with FZF

I have a thought. Can I use a terminal as program runner? Instead of dmenu / rofi I was thinking to list all the programs with FZF, run the selection, and then close the terminal after it runs. I tried this but it's not working. termite -e run.sh or…
Nora
  • 21
  • 1
2
votes
1 answer

fzf: How to return "ID" / line numbers?

I have a set of lines (item + description) which I want to run through fzf -m. For example: item1: Some description item1: Another description item2: Yet another description After selection I would like fzf to return the line numbers (e.g. 1 3)…
Budiman Snowman
  • 113
  • 1
  • 6
1
2 3