oae / gnome-shell-pano

Next-gen Clipboard Manager for Gnome Shell
https://extensions.gnome.org/extension/5278/pano/
GNU General Public License v2.0
987 stars 52 forks source link

Pano misbehaves with (Neo)vim #207

Open Vikareaj opened 11 months ago

Vikareaj commented 11 months ago

Description

Whenever a deletion is performed in vim, Pano will register it as a copy action.

Problem Explanation

Any type of deleting action will trigger it. Typing x in normal mode triggers it, d triggers it, dd triggers it, etc. Afterwards, Pano is populated with myriad single letters. (Every single deleted character gets its own place in the deletion history.)

Expected Behavior

A clear and concise description of what you expected to happen, and how the actual outcome differs:

Reprodution

Install Pano. Install Neovim. You may need to also set the nvim option "unnamedplus" for integration with the system clipboard. To be clear, said options has never confused the system clipboard into recording vim deletion events, or other clipboard extesions.

Details

Mark with [ ] all that applies:

It happens with any application?

It happens only on one computer?

It happens only with some specific gnome configuration?

It happens only with some specific extension installed?

Diagnostics

Under what conditions does it happen?

Fill in all information that applies:

Environment

brunolpsousa commented 9 months ago

Not a bug, that's exactly what unnamedplus does:

unnamedplus A variant of the "unnamed" flag which uses the
            clipboard register "+" (quoteplus) instead of
            register "*" for all yank, delete, change and put
            operations which would normally go to the unnamed
            register.  When "unnamed" is also included to the
            option, yank and delete operations (but not put)
            will additionally copy the text into register
            "*". See clipboard.

And in Providers:

To ALWAYS use the clipboard for ALL operations (instead of interacting with the "+" and/or "*" registers explicitly):

set clipboard+=unnamedplus

See 'clipboard' for details and options.

If you only want to sync yank and paste operations with the system clipboard, I suggest a custom keymap for this:

local keymap = vim.keymap.set
keymap({ "n", "v" }, "y", '"+y', { desc = "Yank to clipboard" })
keymap({ "n", "v" }, "p", '"+p', { desc = "Paste from clipboard" })
keymap({ "n", "v" }, "P", '"+P', { desc = "Paste from clipboard" })