GithubHelp home page GithubHelp logo

Comments (5)

yuki-yano avatar yuki-yano commented on May 25, 2024

It seems to work in my environment.
Can you give an example of failure using this repository?
11

from fzf-preview.vim.

abenz1267 avatar abenz1267 commented on May 25, 2024

Hi,

using it that way works. I put this in my init.vim

let g:fzf_preview_grep_cmd = 'rg --line-number --no-heading -w'
nmap <silent> <A-p> :FzfPreviewProjectGrep<CR>

When i alt+p i got the error straight away. Weirdly now i don't get an error, but it isn't working either.

Regards

from fzf-preview.vim.

yuki-yano avatar yuki-yano commented on May 25, 2024

If no argument is given, FzfPreviewProjectGrep executes a command with a dot after g:fzf_preview_grep_cmd and searches for the project.
Thus, when run without arguments, rg -w . is run.
https://github.com/yuki-ycino/fzf-preview.vim/blob/master/autoload/fzf_preview/command.vim#L21-L27

Adding the -w option seems to require passing the argument each time the command is executed, or specifying the -w option at runtime instead of writing g: fzf_preview_grep_cmd.

Not yet documented, but if necessary, you can easily create new resources using the fzf_preview#parameter and the fzf_preview#runner.
https://github.com/yuki-ycino/fzf-preview.vim/blob/master/autoload/fzf_preview/parameter.vim#L82-L91
https://github.com/yuki-ycino/fzf-preview.vim/blob/master/autoload/fzf_preview/runner.vim

from fzf-preview.vim.

abenz1267 avatar abenz1267 commented on May 25, 2024

-w option at runtime instead of writing g: fzf_preview_grep_cmd

What do you mean? Typing '-w ' in the preview window doesn't work. Or do you mean directly running FzfPreviewGrep -w <search> as you did? Yes, that works.

Btw: is it possible to remove the files list when the input is empty?

Regards

from fzf-preview.vim.

yuki-yano avatar yuki-yano commented on May 25, 2024

Sorry for not good at english.

fzf narrows the candidates from the list passed at startup.
Therefore, you need to create a candidate list first.
It is possible to use the -w option at that time.
However, after the candidate is passed to fzf, rg is not relevant, so the -w option cannot be used.

FzfPreviewProjectGrep uses . without arguments to use all lines of the project, which is necessary to pass candidates to fzf.

from fzf-preview.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.