Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Separate Clipboard Handling #237

Open
Celve opened this issue Apr 25, 2024 · 4 comments
Open

Feature Request: Separate Clipboard Handling #237

Celve opened this issue Apr 25, 2024 · 4 comments

Comments

@Celve
Copy link

Celve commented Apr 25, 2024

Overview

I am proposing a new feature for kindaVim, aiming to enhance the clipboard management functionalities by providing a separate clipboard for Vim operations or adding an option to prevent deleted content in Vim mode from being added to the system clipboard.

Problem Statement

Presently, any cut (delete) operations in Vim mode implemented by kindaVim directly affect the macOS system clipboard. This automatic management of clipboard data leads to detrimental effects as it overwrites existing clipboard content and adds numerous unwarranted entries to clipboard management apps, potentially causing significant clipboard pollution.

Proposed Feature

I suggest adding one of the following features to kindaVim:

  1. Separate Clipboard for Vim Operations: Introduce a dedicated clipboard that exclusively holds content deleted using Vim operations. This would prevent interference with the system clipboard and allow users to manage their Vim and non-Vim clipboards independently.

  2. Option to Disable Clipboard Overwrite: Provide a setting that allows users to disable the automatic overwriting of system clipboard content with deleted content from Vim operations. When enabled, deleted data in Vim mode would not affect the system clipboard.

@godbout
Copy link
Owner

godbout commented Apr 27, 2024

will come back to you on that a bit later.

@godbout
Copy link
Owner

godbout commented May 2, 2024

so. yeah. when starting kV i had the idea/try to implement registers. but 1) it's harder than expected 2) the priority was to "wrap" macOS into Vim motions. if you deal with Vim itself or nvim etc., they own their own buffers, so they're in control of everything. not for kV. kV needs to rely on macOS's buffer. this, plus the fact that different types of apps do different kind of shit. native apps are golden to work with, but Java are a nightmare, Electron also, Catalyst a bit shit, etc. etc. so not just for motions, but even for copy/pasting, kV has to wrap everything so that it's smooth for the user. for example even for Electron there's difference code depending on how slow that Electron app is (lol, getting sick just thinking about it). so yeah, the priority when onto the moves, including the copying/pasting, rather than handling registers.

that being said, it's still in the pipeline. the goal of kV ultimately is to not having to think about whether you're using macOS or Vim/nvim. you just use your hard-earned muscle/brain memory.

that being said bis:

Separate Clipboard for Vim Operations: Introduce a dedicated clipboard that exclusively holds content deleted using Vim operations. This would prevent interference with the system clipboard and allow users to manage their Vim and non-Vim clipboards independently.

is there any app that does this? bypass the macOS clipboard at all? coz from my research (from maybe two years ago) this is not possible. if you wanna paste something you always have to go through the macOS clipboard. (ok, not always. like if the app supports the macOS AX, then you can insert text within the text buffer. but again because kV handles all types of apps, we can do that ONLY with the apps that support the AX, not with Electron apps etc. so going only through insert text through text buffers is not a viable option).

Option to Disable Clipboard Overwrite: Provide a setting that allows users to disable the automatic overwriting of system clipboard content with deleted content from Vim operations. When enabled, deleted data in Vim mode would not affect the system clipboard.

but how would that work in terms of UX? people rely on dd and p to move lines around. or x and p to transpose. or do you want some moves to stop copying the deleting and some others not to? that would be super arbitrary.

@Celve
Copy link
Author

Celve commented May 2, 2024

Seems like both two methods are impractical... Currently I have no ideas.

@godbout
Copy link
Owner

godbout commented May 3, 2024

there's still some research to do. i'm kinda surprised that there's no namespaces for the clipboard. i mean, you can of course save your own stuff in your own app, but it seems you need to go through the only clipboard to paste into macOS. can't even think of a short term solution because even if i backup the previous clipboard content, i still need to have the current kV delete into it. restoring after a paste would still also fill whatever clipboard management app you're using 🤔️

so yeah. not sure what's the best here. need some more thinking and research. please update me if/when you have something in mind on your side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants