Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
449 views
in Technique[技术] by (71.8m points)

ag - 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 what I want to do is for it to search only the target directory that I've typed out.

$ vi folder_name/ # Ctrl + T here

Currently, when I hit Ctrl+T it searches the current directory and not just the content of folder_name.

Installed via Plug and in .zshrc I have:

    source ~/.fzf.zsh
    export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -l -g ""'
    export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

I tried removing the export lines as I thought it might be its default behavior but no dice.

How can I achieve this?

question from:https://stackoverflow.com/questions/66060649/fzf-search-the-target-folder

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm not so familiar with Linux, but ctrl-t seems to just insert the result on the command line. Compare with the completion functions which seems to generate a prefix from the buffer and pass that as a path to the find command.

Try using the completion functions or use them as a guide


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...