Fzf: Preview file

Created on 1 Jun 2015  路  6Comments  路  Source: junegunn/fzf

Like in Sublime Text. This will be super useful. Especially in (neo)vim.

Most helpful comment

This is now (partly) possible with --preview option.

All 6 comments

I don't use sublime so I'm not sure what exactly you mean, maybe something like this?

https://github.com/dyng/ctrlsf.vim

Anyway, I believe the feature you suggested is beyond the scope of this repository which only provides basic building blocks for more complex features. fzf is a dumb unix filter and vim plugin for it is just a simple wrapper.

I think what OP means is to be able to see the file corresponding to the line that is highlighted by fzf on the vim window when typing (eg you don't have to press enter to see that buffer, it automatically shows you the file as you type).

Is they a way to access to the currently highlighted line inside fzf before fzf exits ?

Let's not forget that fzf is just a unix filter, an extended version of grep. fzf does not know at all if the input is a list of files or processes or urls or whatever.

Having said that, it might be possible with Neovim once it becomes stable. Partly related: https://github.com/junegunn/fzf/issues/216

i think this use case does not belong in fzf, but it would be lovely if there were a standardized way to integrate previewing into fzf. for instance i am currently writing https://github.com/dnhgff/vache, which would be even more amazing if it could preview the documentation you are selecting as you filter

maybe fzf can write information about current selection to a standard file and external processes can simply monitor that file for changes and update their own preview ui however they would like

@dnhgff

maybe fzf can write information about current selection to a standard file and external processes can simply monitor that file for changes and update their own preview ui however they would like

Even if it does, a vim plugin cannot take advantage of it as vim is inherently single-threaded. But as I mentioned above, I believe it's theoretically possible for Neovim to monitor the content of its :terminal buffer where fzf runs and trigger some action accordingly, like opening the file on a split for preview or resizing the terminal buffer.

This is now (partly) possible with --preview option.

Was this page helpful?
0 / 5 - 0 ratings