diff --git a/flake.lock b/flake.lock index cadcc97..3981302 100644 --- a/flake.lock +++ b/flake.lock @@ -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", diff --git a/flake.nix b/flake.nix index 02dc047..32f5130 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/lua/plugins/cinnamon_scroll.lua b/lua/plugins/cinnamon_scroll.lua new file mode 100644 index 0000000..6cdeacc --- /dev/null +++ b/lua/plugins/cinnamon_scroll.lua @@ -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", "", function() + cinnamon.scroll("zz") + end) + vim.keymap.set("n", "", function() + cinnamon.scroll("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, +}