Indentation Lines with Animations for Neovim
Thought about naming this animeline.nvim but that might have been a little to cringe This is my first attempt at creating neovim plugins and more importantly, my quest on creating useless plugins.
Warning
Highly experimental.
Only tested in neovide and neovim inside terminal
Super buggy
Screen.recording.2023-02-27.152534.mp4
Note: cursor animation comes from Neovide
Use the package manager of your choice
require('lazy').setup({
{
'huy-hng/anyline.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter' }
config = true,
event = 'VeryLazy',
},
})
require('anyline').setup()
Or just put config = true
in lazy as shown above.
Lazy loading should work. I use event = 'VeryLazy'
as shown above.
There are the commands AnylineEnable
and AnylineDisable
to disable anyline.
{
-- visual stuff
indent_char = '▏', -- character to use for the line
highlight = 'NonText', -- color of non active indentation lines
context_highlight = 'ModeMsg', -- color of the context under the cursor
-- animation stuff / fine tuning
animation = 'from_cursor', -- 'from_cursor' | 'to_cursor' | 'top_down' | 'bottom_up' | 'none'
debounce_time = 30, -- how responsive to make to make the cursor movements (in ms, very low debounce time is kinda janky at the moment)
fps = 30, -- changes how many steps are used to transition from one color to another
fade_duration = 200, -- color fade speed (only used when lines_per_second is 0)
length_acceleration = 0.02, -- increase animation speed depending on how long the context is
lines_per_second = 50, -- how many lines/seconds to show
trail_length = 20, -- how long the trail / fade transition should be
-- other stuff
max_lines = 1024, -- if the buffer exceeds this number of lines, anyline will be disabled
priority = 19, -- extmark priority
priority_context = 20,
ft_ignore = {
'NvimTree',
'TelescopePrompt',
'alpha',
},
}
- add user opts to setup function
- create showcase demos for different animations
- nice api for animation, so anyone can create dope looking animations
- update context in chunks instead of entire buffer
- disable indentline on condition (example: buffer has too many lines)
- async update cache
- enable / disable anyline per buffer