From aa6a54f5abc15915365fdc9ef06bfb1622eb7641 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 11 Dec 2024 14:58:17 -0500 Subject: [PATCH] feat: enhance previewers configuration for image formats --- lua/plugins/telescope.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 4c694a5..e1c21a3 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -196,7 +196,24 @@ end if require('data.func').check_global_var('use_fzf_lua', true, false) then table.insert(P, 1, { import = 'lazyvim.plugins.extras.editor.fzf' }) - table.insert(P, 2, { 'ibhagwan/fzf-lua', lazy = false, opts = {} }) + table.insert(P, 2, { + 'ibhagwan/fzf-lua', + lazy = false, + opts = { + previewers = { + builtin = { + extensions = { + -- neovim terminal only supports `viu` block output + ['png'] = { 'viu', '-b' }, + -- by default the filename is added as last argument + -- if required, use `{file}` for argument positioning + ['svg'] = { 'viu', '-b' }, + ['jpg'] = { 'viu', '-b' }, + }, + }, + }, + }, + }) end return P