declancm / cinnamon.nvim Goto Github PK
View Code? Open in Web Editor NEWSmooth scrolling for ANY movement command ๐คฏ. A Neovim plugin written in Lua!
Smooth scrolling for ANY movement command ๐คฏ. A Neovim plugin written in Lua!
I don't have trouble with that, I just want to say that!!!
Thank you for doing that, hh :)
First of all, thank you for a very cool plugin! I tried other similar plugins, but none of them can map j and k effectively, which I use a lot (I map J = 10j
and K = 10k
for vertical movement instead of <C-d
and <C-u
).
So far, so good. Just one thing I feel a bit "missing" is the ability to scroll through folds (and still smooth!). Currently, it feels slow and sticky when going through folds. I would really appreciate it if this issue could be solved.
Thanks again, and have a good day ๐
I don't want my jump list to collect all the 'n' motions, so this is what i had in Vim:
nnoremap n :execute "keepjumps norm! " . v:count1 . "nzz"
nnoremap N :execute "keepjumps norm! " . v:count1 . "Nzz"
Would be nice to control which motions in this plugin are or are not passed to the jumplist.
Hey! I've been playing around with the plugin and it feels really nice and snappy, thanks!
One problem I have is that if the scrolling happens over a large number of lines, then the animation can take quite a while to finish. For example, with a default_delay
of 3ms, it looks fine when scrolling with <C-d>
or similar, but using gg
or other methods to go 100 lines downwards takes quite a while. 0.5ms or 1ms feels like a better number for such cases.
But it's not really possible to configure "if scrolling is over 20 lines, use 3ms, if over 90, use 0.5ms, etc.".
I'm thinking that a solution might be to have a "total delay" so that I could say that the total scrolling time should be 60ms and then the plugin would calculate the per-line delay automatically. Also, it could even skip scrolling every other line in some extreme cases (although I'm not sure how smooth that would look like ๐). With such a solution, we might be able to set the scroll_limit
to a very high number and still have snappy scrolling (or even not have a limit at all).
What do you think of such an idea?
it seems to happen with any call to Scroll(). I would visit a long file and hold down the key (ctrl d/u) in my case. Sometimes I would reach the end of the file, but I could get it crashing every time.
below are my plugin setup options using lazy.nvim:
{
'declancm/cinnamon.nvim',
opts = {
default_delay = 1,
extra_keymaps = true,
},
},
Hi. I have encountered a weird issue where cinnamon will not scroll if I am on the top 2 lines and the bottom 2 lines.
If I go to the topmost line on my screen and try <Page-up>
it would instead just send my cursor to the 2nd line and not scroll.
Is this intended? Or am I doing something wrong?
My setup is
require("cinnamon").setup({
extra_keymaps = true,
default_delay = 15,
scroll_limit = 150
})
So I know cinnamon scrolls with [count]G, but is it possible to have it scroll with relative line jumps as well, i.e. [count]j or [count]k?
I was also curious if it is possible to integrate cinnamon with a plugin like Leap (https://github.com/ggandor/leap.nvim)
Leap is always activated (like Sneak) with 's', 'S', 'gs', and 'gS'. And then you can hop around the page. Is there a way to integrate a plugin like this to have smooth scrolling from cinnamon?
Thanks.
When I have only one window open moves smooth and is responsive, but once I open a window splitted vertically the cursor slow down a lot.
This is my configuration:
require("cinnamon").setup({
-- KEYMAPS:
default_keymaps = true, -- Create default keymaps.
extra_keymaps = true, -- Create extra keymaps.
extended_keymaps = true, -- Create extended keymaps.
override_keymaps = false, -- The plugin keymaps will override any existing keymaps.
-- OPTIONS:
always_scroll = true, -- Scroll the cursor even when the window hasn't scrolled.
centered = false, -- Keep cursor centered in window when using window scrolling.
default_delay = 10, -- The default delay (in ms) between each line when scrolling.
hide_cursor = false, -- Hide the cursor while scrolling. Requires enabling termguicolors!
horizontal_scroll = true, -- Enable smooth horizontal scrolling when view shifts left or right.
max_length = 200, -- Maximum length (in ms) of a command. The line delay will be
-- re-calculated. Setting to -1 will disable this option.
scroll_limit = 100, -- Max number of lines moved before scrolling is skipped. Setting
-- to -1 will disable this option.
})
This bug occurs with any types of buffer, even empty ones.
Nice plugin ๐
It would be perfect if you could add the functionality for the cursor to hide when scrolling. This would make the scrolling experience more enjoyable.
calling the setup function in /plugin
seems not really useful to me.
Users should call the setup function.
Normally this wouldn't be a big deal but in this case it creates keymaps before I call the setup function where I disable default keymaps.
Thanks for the awesome plugin! One small issue, I use cmdheight=0
and when pressing C-d/u, statusline and lualine flashes which is impossible to not see. Hoping there's a solution, thanks.
First of all this plugin is amazing really love this. Now the problem is that I would like the plugin when scrolling with n, N in the search results to print the number of results and what number of results I am in, for example 17/36
Hi,
I've noticed when using hide_cursor = true
that my cursor is hidden but, it is never put back when the scrolling is completed. I faced a similar issue using neoscroll
a while back which the author eventually fix so, cribbing that solution might be applicable here.
I found this in init.lua
utils.create_keymap({ 'n', 'x' }, 'gg', "<Cmd>lua Scroll('gg', 0, 0, 5)<CR>")
utils.create_keymap({ 'n', 'x' }, 'G', "<Cmd>lua Scroll('G', 0, 1, 5)<CR>")
Is it possible for gg and G to use default delay like others?
Hello,
Thanks for this great plugin !
Sill, how can we use a count before a command ? (ex: 42G
goes right at the bottom even if there are more than 42 lines, where G is mapped this way: keymap('n', 'G', "<Cmd>lua Cinnamon.Scroll('G', 0, 0, 3)<CR>", opts)
)
Regards.
When I use muren on a lengthy file in a global scope for example, it keeps scrolling from top down on every keystroke
For example, the file is very long, and with this plugin enabled, press 'G' will trigger animated scrolling and bring view to the bottom, which is very nice.
I wonder if it would stop the scrolling once I press a key like <ESC>
, so i can stop at somewhere, so I don't have to keep pressing <C-d>
or 'j' to scroll to a place.
Please add an example in the readme so people can see how it looks after installint and configure this plugin
Is there a setting / function to toggle the smooth scrolling? I would like to toggle the smooth scrolling on my need. Thank's!
Hi, thanks for such great plugin!
{
default_keymaps = true,
extra_keymaps = true,
extended_keymaps = true,
always_scroll = true,
scroll_limit = 64,
}
Hi,
So I want to preface this by saying that I realise that I can remap the mouse scroll wheel commands, and I've been doing that for years with various smooth scroll plugins.
So why does this need a different solution?
<c-u>
and <c-d>
are too aggressive for a touch bad where depending on how much force you use you could end up scrolling a huge amount which was unintended.<c-e>
and <c-y>
are too small and adding a count helps slightly, but currently in this plugins once you hit the top or bottom plus/minus the scroll off the cursor line begins to jitter wildly.mousescroll
option and use that to control how much scrolling happens?There might be other ways to handle this, but I wonder if a dedicated command might not give a better result. One that can be sufficiently granular for mouse scrolling? Perhaps not, I have never properly looked into this sort of thing so no idea what's possible.
Good day to you!
is it possible to do window horizontal scrolling?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.