declancm / cinnamon.nvim

Smooth scrolling for ANY command 🤯. A Neovim plugin written in Lua!
MIT License
363 stars 6 forks source link

Relative line jumps and integrating with a modified movement plugin like Leap. #15

Open ZacharyRizer opened 2 years ago

ZacharyRizer commented 2 years ago

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.

declancm commented 1 year ago

Hi! Sorry I didn't get to this earlier, I've been busy with a new job. If you enable the extended keymaps in the plugin config you can have smooth scrolling with [count]j and [count]k :). I'll definitely look into integrating with a plugin like sneak!

simonmandlik commented 5 months ago

Also, integration with https://github.com/folke/flash.nvim would be amazing!

declancm commented 4 months ago

Integration with flash.nvim is now possible with a config like this:

local cinnamon = require('cinnamon')
local flash = require('flash')
local jump = require('flash.jump')

cinnamon.setup()

flash.setup({
  action = function(match, state)
    cinnamon.scroll(function()
      jump.jump(match, state)
      jump.on_jump(state)
    end)
  end,
})

I might be able to make this a builtin feature enabled with a config option but for now I'll add snippets like this to the docs