Closed nativerv closed 1 year ago
This is probably not possible with the current implementation. But it sounds like a reasonable feature, so I will try to come up with something. Unfortunately, I'm currently preoccupied with a few other things, so it can be a while.
@nativerv I've added a few lines of code to the dev branch and enabled the capability to show Cybu on auto commands. The API for this will probably change for the final feature (expect a breaking change).
It would be cool if you could test it a bit and give some feedback :)
Example auto command:
vim.api.nvim_create_autocmd('BufWinEnter', {
group = vim.api.nvim_create_augroup('cybu_show_on_buffer_switch', {}),
callback = function()
require('cybu').auto()
end,
})
You can change the view type to rolling or paging via the following config key:
behavior = {
mode = {
auto = {
view = "rolling", -- paging
},
},
},
The API function changed from auto
to autocmd
and it is also possible now to use the show_on_autocmd
config key like so:
behavior = {
show_on_autocmd = "BufEnter", -- can be any nvim event, default value: false
},
Option to show Cybu window on
<C-i>
.<C-o>
, Telescope jumps, as well as vanilla:bprev
/:bnext
etc, instead of hardcodedCybuPrev
/CybuNext
commands.Can i maybe hack that behavior somehow without changing the code? I've tried the following:
And it sort of works, but the current file displays incorrectly: if i switch between two files multiple times like with
<C-o><C-i><C-o><C-i>
the highlighted file cycles bottom-up indefinitely instead of highlighting two files back and forth. Jumping to a file with Telescope,gf
etc. also selects file incorrectly. And then if i open unusual buffer likehelp
or lsp hover, the error is thrown:init.lua:357: attempt to perform arithmetic on a nil value
.