From 32a3fa118d187dc9c88f35a78e763a5b895b6227 Mon Sep 17 00:00:00 2001 From: saygo-png Date: Tue, 14 Oct 2025 21:26:30 +0200 Subject: [PATCH] plugins/nvim-osc52: remove module The plugin is obsolete as the feature provided by it has been added to Neovim itself. Signed-off-by: saygo-png --- modules/lazyload.nix | 1 + plugins/by-name/nvim-osc52/default.nix | 121 ------------------ plugins/deprecation.nix | 7 + .../plugins/by-name/nvim-osc52/default.nix | 31 ----- 4 files changed, 8 insertions(+), 152 deletions(-) delete mode 100644 plugins/by-name/nvim-osc52/default.nix delete mode 100644 tests/test-sources/plugins/by-name/nvim-osc52/default.nix diff --git a/modules/lazyload.nix b/modules/lazyload.nix index fc6185f4..b568e2eb 100644 --- a/modules/lazyload.nix +++ b/modules/lazyload.nix @@ -32,6 +32,7 @@ in # removed "packer" "rust-tools" + "nvim-osc52" "treesitter-playground" # renamed "surround" diff --git a/plugins/by-name/nvim-osc52/default.nix b/plugins/by-name/nvim-osc52/default.nix deleted file mode 100644 index 9552356f..00000000 --- a/plugins/by-name/nvim-osc52/default.nix +++ /dev/null @@ -1,121 +0,0 @@ -# TODO: As of nvim 0.10 this plugin is obsolete. -# warning added 2024-06-21, remove after 24.11. -{ - lib, - helpers, - pkgs, - config, - options, - ... -}: -with lib; -{ - options.plugins.nvim-osc52 = { - enable = mkOption { - type = types.bool; - default = false; - example = true; - description = '' - Whether to enable nvim-osc52, a plugin to use OSC52 sequences to copy/paste. - - Note: this plugin is obsolete and will be removed after 24.11. - As of Neovim 0.10 (specifically since [this PR][1]), native support for OSC52 has been added. - Check [`:h clipboard-osc52`][2] for more details. - - [1]: https://github.com/neovim/neovim/pull/25872 - [2]: https://neovim.io/doc/user/provider.html#clipboard-osc52 - ''; - }; - - package = lib.mkPackageOption pkgs "nvim-osc52" { - default = [ - "vimPlugins" - "nvim-osc52" - ]; - }; - - maxLength = helpers.defaultNullOpts.mkInt 0 "Maximum length of selection (0 for no limit)"; - silent = helpers.defaultNullOpts.mkBool false "Disable message on successful copy"; - trim = helpers.defaultNullOpts.mkBool false "Trim text before copy"; - - keymaps = { - enable = mkEnableOption "keymaps for copying using OSC52"; - - silent = mkOption { - type = types.bool; - description = "Whether nvim-osc52 keymaps should be silent"; - default = false; - }; - - copy = mkOption { - type = types.str; - description = "Copy into the system clipboard using OSC52"; - default = "y"; - }; - - copyLine = mkOption { - type = types.str; - description = "Copy line into the system clipboard using OSC52"; - default = "yy"; - }; - - copyVisual = mkOption { - type = types.str; - description = "Copy visual selection into the system clipboard using OSC52"; - default = "y"; - }; - }; - }; - - config = - let - cfg = config.plugins.nvim-osc52; - setupOptions = with cfg; { - inherit silent trim; - max_length = maxLength; - }; - in - mkIf cfg.enable { - warnings = lib.nixvim.mkWarnings "plugins.nvim-osc52" '' - This plugin is obsolete and will be removed after 24.11. - As of Neovim 0.10, native support for OSC52 has been added. - See `:h clipboard-osc52` for more details: https://neovim.io/doc/user/provider.html#clipboard-osc52 - Definitions: ${lib.options.showDefs options.plugins.nvim-osc52.enable.definitionsWithLocations} - ''; - - extraPlugins = [ cfg.package ]; - - keymaps = - with cfg.keymaps; - mkIf enable [ - { - mode = "n"; - key = copy; - action.__raw = "require('osc52').copy_operator"; - options = { - expr = true; - inherit silent; - }; - } - { - mode = "n"; - key = copyLine; - action = "${copy}_"; - options = { - remap = true; - inherit silent; - }; - } - { - mode = "v"; - key = copyVisual; - action.__raw = "require('osc52').copy_visual"; - options.silent = silent; - } - ]; - - extraConfigLua = '' - require('osc52').setup(${lib.nixvim.toLuaObject setupOptions}) - ''; - }; -} diff --git a/plugins/deprecation.nix b/plugins/deprecation.nix index 0eb40198..deb47254 100644 --- a/plugins/deprecation.nix +++ b/plugins/deprecation.nix @@ -23,6 +23,13 @@ let The `rust-tools` project has been abandoned. It is recommended to use `rustaceanvim` instead. ''; + + # Added 2025-10-14 + nvim-osc52 = '' + The `nvim-osc52` plugin is obsolete. + As of Neovim 0.10, native support for OSC52 has been added. + See `:h clipboard-osc52` for more details: https://neovim.io/doc/user/provider.html#clipboard-osc52 + ''; }; renamed.plugins = { # Added 2024-09-17 diff --git a/tests/test-sources/plugins/by-name/nvim-osc52/default.nix b/tests/test-sources/plugins/by-name/nvim-osc52/default.nix deleted file mode 100644 index 26a00fed..00000000 --- a/tests/test-sources/plugins/by-name/nvim-osc52/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -let - # This plugin is deprecated - warnings = expect: [ - (expect "count" 1) - (expect "any" "This plugin is obsolete and will be removed after 24.11.") - ]; -in -{ - empty = { - plugins.nvim-osc52.enable = true; - - test = { inherit warnings; }; - }; - - defaults = { - plugins.nvim-osc52 = { - enable = true; - - maxLength = 0; - silent = false; - trim = false; - - keymaps = { - silent = false; - enable = true; - }; - }; - - test = { inherit warnings; }; - }; -}