nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.4k stars 46 forks source link

[Question] Is it possible to highlight matching part on buffer? #99

Open rieje opened 1 year ago

rieje commented 1 year ago

Is it possible to highlight matching part on buffer? For example, I think Emacs's Swiper plugin has the best implementation of fuzzy finder search:

It highlights matching part on the buffer "preview" itself. This is more inline with how vim's / for incremental search works--highlights are on actual buffer where the context of the line matched is so where your eyes are already looking.


Completely unrelated, but seeing the previews on the existing buffer like in the video seems much more intuitive and space efficient than as a previewer via a floating window interface. The problem with the latter which AFAIK is what all plugins like Telescope, fzf-lua, etc. uses is the previewer needs to be configured to match the actual buffer as much as possible. If e.g. bat is used as the previewer, you don't get proper treesitter highlighting, the colorscheme might not be exactly the same, and you must explicitly set settings like line numbers to replicate what the actual buffer looks like. Why not just use the existing buffer as the previewer like the Swiper plugin--is there a limitation with Neovim where it can't do this? IMO something as simple as searching shouldn't require interacting with floating windows (even if they are maximized--the point is that you're leaving a more persistent window and buffer layout that you interact with vim 100% of the time for a temporary interface when it shouldn't be necessary).