-
I'm wondering what the differences are between these two previewer settings. The wiki page reads:
I would assume that Aside from speed, are there any other things to consider when deciding between these two settings? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The “native” as its name suggests sets fzf’s preview command directly to The non native version uses a Both technically are a separate process with the non-native doing a bit more work on neovim’s main thread as opposed to the native version but the perf difference is probably not that big.
|
Beta Was this translation helpful? Give feedback.
-
Btw, if you want to see this in action, use
--preview 'bat --color=always --style=numbers,changes "$(VIMRUNTIME='\''/usr/share/nvim/ru
ntime'\'' '\''/usr/bin/nvim'\'' -n --headless --clean --cmd '\''lua vim.g.did_load_filetypes=1; loadfile([[/home/bhagwan/Sources/nvim/fzf-lua/lua/fzf-lua/shell_helper.lu
a]])().rpc_nvim_exec_lua({fzf_lua_server=[[/run/user/1000/fzf-lua.1712038571.10020.1]], fnc_id=5 , debug=true})'\'' -- {})"'
--preview 'VIMRUNTIME='\''/usr/share/nvim/runtime'\'' '\''/usr/bin/nvim'\'' -n --headless -
-clean --cmd '\''lua vim.g.did_load_filetypes=1; loadfile([[/home/bhagwan/Sources/nvim/fzf-lua/lua/fzf-lua/shell_helper.lua]])().rpc_nvim_exec_lua({fzf_lua_server=[[/run
/user/1000/fzf-lua.1712038571.10020.1]], fnc_id=6 , debug=true})'\'' -- {})"' |
Beta Was this translation helpful? Give feedback.
The “native” as its name suggests sets fzf’s preview command directly to
bat <args> <filename>
, however for filename is then replaced with aneovim --headless --cmd <lua>
command in order to properly extract the filename from the entry (strip icons, etc) - this approach has obvious limitations with tags for example where the entry doesn’t have a line number and other issues with Windows where the files index for the line number differs between relative paths and absolute paths (due to the extraC:
prefix when our delimiter is:
).The non native version uses a
neovim --headless …
directly as fzf’s--preview
argument and then spawns bat using libuv’s spawn and streams the data over named pi…