-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot preview terminal buffers with bat_native previewer #354
Comments
Buffers that do not have a corresponding file on disk cannot be viewed with fzf native previewers ( If you need unnamed and terminal buffer previews change the previewer for :FzfLua buffers previewer=builtin
-- or:
:lua require'fzf-lua'.buffers({ previewer = 'builtin' })
-- can also be configured in setup:
require'fzf-lua'.setup({
buffers = { previewer = 'builtin' },
}) |
Btw, looking at your config, you can it make it much more compact now since you can "bulk" configure all files/bufers actions under the global
fzf-lua configurationrequire('fzf-lua').setup({
winopts = {
split = 'belowright new',
fullscreen = false,
preview = {
default = 'bat_native',
horizontal = 'right:50%',
vertical = 'down:50%',
layout = 'horizontal'
-- layout = 'flex',
-- flip_columns=utils.truncation_limit_s_terminal
},
on_create = function()
vim.opt_local.buflisted = false
vim.opt_local.bufhidden = 'wipe'
vim.opt_local.signcolumn = 'no'
-- vim.opt_local.statusline = require('statusline').StatusLine('FZF')
end
},
keymap = {
fzf = {
['ctrl-a'] = 'select-all',
['ctrl-d'] = 'deselect-all',
['ctrl-f'] = 'half-page-down',
['ctrl-b'] = 'half-page-up'
}
},
actions = {
files = {
["default"] = actions.file_edit,
["ctrl-x"] = actions.file_split,
["ctrl-v"] = actions.file_vsplit,
["ctrl-t"] = actions.file_tabedit,
['ctrl-q'] = require('utils').qf_populate
},
buffers = {
["default"] = actions.buf_edit,
["ctrl-x"] = actions.buf_split,
["ctrl-v"] = actions.buf_vsplit,
["ctrl-t"] = actions.buf_tabedit,
}
},
fzf_opts = { ['--layout'] = 'default' },
previewers = {
bat = {
cmd = "bat",
args = "--style=numbers,changes --color always",
theme = 'Coldark-Dark',
}
},
files = {
cmd = 'rg --files --follow --smart-case --hidden --no-ignore -g "!{.DS_Store,.cache,venv,.git,.clangd,.ccls-cache}" 2> /dev/null',
},
buffers = {
actions = { ['ctrl-q'] = { actions.buf_del, actions.resume } }
},
grep = {
rg_opts = "--hidden --column --line-number --no-heading --color=always --smart-case -g '!{.DS_Store,.cache,venv,.git,.clangd,.ccls-cache}'",
actions = { ['ctrl-q'] = require('lib/misc').fzf_to_qf }
},
lsp = {
actions = { ['ctrl-q'] = require('lib/misc').fzf_to_qf },
icons = {
['Error'] = { icon = utils.symbol_config.indicator_error, color = 'red' },
['Warning'] = { icon = utils.symbol_config.indicator_warning, color = 'yellow' },
['Information'] = { icon = utils.symbol_config.indicator_info, color = 'blue' },
['Hint'] = { icon = utils.symbol_config.indicator_hint, color = 'magenta' }
}
}
}) |
aah I see, thanks for the tips! I will just remap the buffers keymap to use the built in previewer for now! |
That's because when using You can play with different numbers for the size (try What is your |
changing the size didn't help the alignment much, so ill just continue using the bat preview, I rarely need to see what the terminal contents are as I am usually using only one terminal buffer frequently, which is mapped to toggle. thanks for ur help tho :) |
When I have more time I’ll take another crack at it and see if I can match the Fzf border width code 1-to-1. |
Good news I was able to solve it, the misalighment happened due to the You can now use the |
yup, this works. Thanks for the amazing work as always, @ibhagwan :) |
Info
nvim --version
: HEADfzf --version
: 0.29.0fzf-lua configuration
Description
this is what I see when I try to preview a terminal buffer when using FzfLua Buffers picker:
[bat error] invalid digit found in string
The text was updated successfully, but these errors were encountered: