added smooth scroll
This commit is contained in:
parent
1f41fc3018
commit
c7382646df
3 changed files with 53 additions and 0 deletions
17
flake.lock
generated
17
flake.lock
generated
|
@ -192,6 +192,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim_plugin-declancm/cinnamon.nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1722992123,
|
||||
"narHash": "sha256-kccQ4iFMSQ8kvE7hYz90hBrsDLo7VohFj/6lEZZiAO8=",
|
||||
"owner": "declancm",
|
||||
"repo": "cinnamon.nvim",
|
||||
"rev": "450cb3247765fed7871b41ef4ce5fa492d834215",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "declancm",
|
||||
"repo": "cinnamon.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim_plugin-folke/lazy.nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -862,6 +878,7 @@
|
|||
"nvim_plugin-b0o/schemastore.nvim": "nvim_plugin-b0o/schemastore.nvim",
|
||||
"nvim_plugin-catppuccin/nvim": "nvim_plugin-catppuccin/nvim",
|
||||
"nvim_plugin-chrisgrieser/nvim-early-retirement": "nvim_plugin-chrisgrieser/nvim-early-retirement",
|
||||
"nvim_plugin-declancm/cinnamon.nvim": "nvim_plugin-declancm/cinnamon.nvim",
|
||||
"nvim_plugin-folke/lazy.nvim": "nvim_plugin-folke/lazy.nvim",
|
||||
"nvim_plugin-folke/neodev.nvim": "nvim_plugin-folke/neodev.nvim",
|
||||
"nvim_plugin-folke/which-key.nvim": "nvim_plugin-folke/which-key.nvim",
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
"nvim_plugin-m4xshen/hardtime.nvim".url = "github:m4xshen/hardtime.nvim";
|
||||
"nvim_plugin-m4xshen/hardtime.nvim".flake = false;
|
||||
"nvim_plugin-declancm/cinnamon.nvim".flake = false;
|
||||
"nvim_plugin-declancm/cinnamon.nvim".url = "github:declancm/cinnamon.nvim";
|
||||
|
||||
"nvim_plugin-nvim-treesitter/nvim-treesitter-context".url = "github:nvim-treesitter/nvim-treesitter-context";
|
||||
"nvim_plugin-nvim-treesitter/nvim-treesitter-context".flake = false;
|
||||
|
|
34
lua/plugins/cinnamon_scroll.lua
Normal file
34
lua/plugins/cinnamon_scroll.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
"declancm/cinnamon.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- change default options here
|
||||
keymaps = { basic = true },
|
||||
mode = "cursor",
|
||||
step_size = {
|
||||
vertical = 3,
|
||||
horizontal = 4,
|
||||
},
|
||||
delay = 2,
|
||||
},
|
||||
config = function(_, opts)
|
||||
local cinnamon = require("cinnamon")
|
||||
cinnamon.setup(opts)
|
||||
|
||||
-- Centered scrolling:
|
||||
vim.keymap.set("n", "<C-U>", function()
|
||||
cinnamon.scroll("<C-U>zz")
|
||||
end)
|
||||
vim.keymap.set("n", "<C-D>", function()
|
||||
cinnamon.scroll("<C-D>zz")
|
||||
end)
|
||||
|
||||
-- LSP:
|
||||
vim.keymap.set("n", "gd", function()
|
||||
cinnamon.scroll(vim.lsp.buf.definition)
|
||||
end)
|
||||
vim.keymap.set("n", "gD", function()
|
||||
cinnamon.scroll(vim.lsp.buf.declaration)
|
||||
end)
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue