Fzf: How to apply fzf search on specific dir without going there

Created on 8 Sep 2017  路  1Comment  路  Source: junegunn/fzf

  • Category

    • [ ] fzf binary

    • [ ] fzf-tmux script

    • [ ] Key bindings

    • [ ] Completion

    • [ ] Vim

    • [x] Neovim

    • [ ] Etc.

  • OS

    • [ ] Linux

    • [x] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [ ] bash

    • [x] zsh

    • [ ] fish

I have this function in my zshrc :

fe() {
  local files
  IFS=$'\n' files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0))
  [[ -n "$files" ]] && nvim "${files[@]}"
}

It lets me search for contents of the current directory I am in and then edit that file. However I wish to modify this function so that it searches only a specific directory (~/.dotifles/ in my case) from wherever I am.

I first thought to cd ~/.dotfiles and then run the remaining of the command but I wish to avoid that.

Thank you for any help.

question

Most helpful comment

fzf is a unix filter, so you can feed in any input like so

# You can use any command you find fit as the source
find ~/.dotfiles | fzf-tmux

I hope this answers your question.

>All comments

fzf is a unix filter, so you can feed in any input like so

# You can use any command you find fit as the source
find ~/.dotfiles | fzf-tmux

I hope this answers your question.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firedev picture firedev  路  3Comments

jan-warchol picture jan-warchol  路  3Comments

chrisamow picture chrisamow  路  3Comments

sassanh picture sassanh  路  3Comments

ahmedelgabri picture ahmedelgabri  路  3Comments