From 1ac4dd7d98eed76cc569e309eaa82639f8caac43 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 4 Feb 2023 00:20:20 +0300 Subject: [PATCH] feat(visuals): cinnamon smooth scrolling --- flake.lock | 57 +++++++++++++++++++++++++-- flake.nix | 21 ++++++++++ modules/modules.nix | 1 + modules/notifications/default.nix | 5 +++ modules/notifications/nvim-notify.nix | 23 +++++++++++ modules/telescope/default.nix | 4 +- modules/visuals/visuals.nix | 15 +++++++ 7 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 modules/notifications/default.nix create mode 100644 modules/notifications/nvim-notify.nix diff --git a/flake.lock b/flake.lock index 5605662..fcf38a4 100644 --- a/flake.lock +++ b/flake.lock @@ -48,6 +48,22 @@ "type": "github" } }, + "cinnamon-nvim": { + "flake": false, + "locked": { + "lastModified": 1670143364, + "narHash": "sha256-JglXQhoPgN9sQ3yuv0+VQxmKMvoQTu5lbGLSRaQkytI=", + "owner": "declancm", + "repo": "cinnamon.nvim", + "rev": "c406ffda3a0302f32c23b24ab756ea20467d6578", + "type": "github" + }, + "original": { + "owner": "declancm", + "repo": "cinnamon.nvim", + "type": "github" + } + }, "cmp-buffer": { "flake": false, "locked": { @@ -128,6 +144,22 @@ "type": "github" } }, + "codewindow-nvim": { + "flake": false, + "locked": { + "lastModified": 1674040274, + "narHash": "sha256-TBoMpFD5MQHZwv/6TxbMNrVp2m2ATw8hbD1mDzU4Nf8=", + "owner": "gorbit99", + "repo": "codewindow.nvim", + "rev": "94d84e1a15b94248f205b854e70cb95f0b615b38", + "type": "github" + }, + "original": { + "owner": "gorbit99", + "repo": "codewindow.nvim", + "type": "github" + } + }, "crates-nvim": { "flake": false, "locked": { @@ -497,11 +529,11 @@ "nvim-cmp": { "flake": false, "locked": { - "lastModified": 1674731450, - "narHash": "sha256-53ubj39XyXep+AyWMU7Vxs9uTvIVZkctl6/M9LLpock=", + "lastModified": 1675440540, + "narHash": "sha256-BgI0dR7ss+pClGIu3EWXV7r5mMpo6Xt3QMVAxeWm++E=", "owner": "hrsh7th", "repo": "nvim-cmp", - "rev": "e7e2ef7031db8e0cfad7ad9916ec766ddd9dbb3b", + "rev": "cfafe0a1ca8933f7b7968a287d39904156f2c57d", "type": "github" }, "original": { @@ -606,6 +638,22 @@ "type": "github" } }, + "nvim-notify": { + "flake": false, + "locked": { + "lastModified": 1674034105, + "narHash": "sha256-zPSlenKjuZ8Xygu/KuU9+bSf5uUjSDK9HOTWnpUk1jo=", + "owner": "rcarriga", + "repo": "nvim-notify", + "rev": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7", + "type": "github" + }, + "original": { + "owner": "rcarriga", + "repo": "nvim-notify", + "type": "github" + } + }, "nvim-tree-lua": { "flake": false, "locked": { @@ -743,11 +791,13 @@ "alpha-nvim": "alpha-nvim", "bufdelete-nvim": "bufdelete-nvim", "catppuccin": "catppuccin", + "cinnamon-nvim": "cinnamon-nvim", "cmp-buffer": "cmp-buffer", "cmp-nvim-lsp": "cmp-nvim-lsp", "cmp-path": "cmp-path", "cmp-treesitter": "cmp-treesitter", "cmp-vsnip": "cmp-vsnip", + "codewindow-nvim": "codewindow-nvim", "crates-nvim": "crates-nvim", "dashboard-nvim": "dashboard-nvim", "flake-utils": "flake-utils", @@ -773,6 +823,7 @@ "nvim-lightbulb": "nvim-lightbulb", "nvim-lspconfig": "nvim-lspconfig", "nvim-neoclip": "nvim-neoclip", + "nvim-notify": "nvim-notify", "nvim-tree-lua": "nvim-tree-lua", "nvim-treesitter-context": "nvim-treesitter-context", "nvim-ts-autotag": "nvim-ts-autotag", diff --git a/flake.nix b/flake.nix index c90edae..9cc2865 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,7 @@ enable = true; nvimWebDevicons.enable = true; scrollBar.enable = true; + smoothScroll.enable = true; lspkind.enable = true; indentBlankline = { enable = true; @@ -120,11 +121,15 @@ vim.minimap = { # FIXME: this plugin has a dependency that needs to be installed minimap-vim.enable = false; + codewindow.enable = true; }; vim.dashboard = { dashboard-nvim.enable = false; alpha.enable = true; }; + vim.notify = { + nvim-notify.enable = true; + }; }; }; @@ -413,6 +418,11 @@ flake = false; }; + cinnamon-nvim = { + url = "github:declancm/cinnamon.nvim"; + flake = false; + }; + indent-blankline = { url = "github:lukas-reineke/indent-blankline.nvim"; flake = false; @@ -455,5 +465,16 @@ url = "github:wfxr/minimap.vim"; flake = false; }; + + codewindow-nvim = { + url = "github:gorbit99/codewindow.nvim"; + flake = false; + }; + + # Notifications + nvim-notify = { + url = "github:rcarriga/nvim-notify"; + flake = false; + }; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 4c10917..70e4d19 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -23,6 +23,7 @@ ./git ./minimap ./dashboard + ./notifications ]; pkgsModule = {config, ...}: { diff --git a/modules/notifications/default.nix b/modules/notifications/default.nix new file mode 100644 index 0000000..e978f42 --- /dev/null +++ b/modules/notifications/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./nvim-notify.nix + ]; +} diff --git a/modules/notifications/nvim-notify.nix b/modules/notifications/nvim-notify.nix new file mode 100644 index 0000000..90bd0c0 --- /dev/null +++ b/modules/notifications/nvim-notify.nix @@ -0,0 +1,23 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.notify.nvim-notify; +in { + options.vim.notify.nvim-notify = { + enable = mkOption { + type = types.bool; + description = "Enable animated notifications"; + }; + }; + + config = + mkIf cfg.enable + { + vim.startPlugins = ["nvim-notify"]; + }; +} diff --git a/modules/telescope/default.nix b/modules/telescope/default.nix index 67bde16..90961ba 100644 --- a/modules/telescope/default.nix +++ b/modules/telescope/default.nix @@ -54,7 +54,8 @@ in { ); vim.luaConfigRC.telescope = nvim.dag.entryAnywhere '' - require("telescope").setup { + local telescope = require('telescope') + telescope.setup { defaults = { vimgrep_arguments = { "${pkgs.ripgrep}/bin/rg", @@ -72,6 +73,7 @@ in { }, } } + telescope.load_extension('notify') ''; }; } diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index 456e0b8..b00b408 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -29,6 +29,11 @@ in { description = "enable scrollbar [scrollbar.nvim]"; }; + smoothScroll.enable = mkOption { + type = types.bool; + description = "enable smooth scrolling [cinnamon-nvim]"; + }; + cursorWordline = { enable = mkOption { type = types.bool; @@ -98,6 +103,11 @@ in { then "scrollbar-nvim" else null ) + ( + if cfg.smoothScroll.enable + then "cinnamon-nvim" + else null + ) ]; vim.luaConfigRC.visuals = nvim.dag.entryAnywhere '' @@ -154,6 +164,11 @@ in { }" else "" } + ${ + if cfg.smoothScroll.enable + then "require('cinnamon').setup()" + else "" + } ''; }; }