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

Should commands which delete (e.g. x, dd) also yank? #50

Open
jparoz opened this issue Jan 24, 2024 · 0 comments
Open

Should commands which delete (e.g. x, dd) also yank? #50

jparoz opened this issue Jan 24, 2024 · 0 comments

Comments

@jparoz
Copy link
Contributor

jparoz commented Jan 24, 2024

In vim, commands which delete text also yanks (copies) it into the unnamed register, ready to be put (pasted) back into the document with p. This enables neat sentences such as ddp to swap two lines at the cursor, xp to swap two characters, and generally e.g. ddjjjp to move a line further down in the document.

In sheetkeys, deleting commands currently don't copy the deleted text in any way.

  • On one hand, this makes sense; there's not any concept of multiple registers/pasteboards in Sheets, and it might be considered aggressive for sheetkeys to clobber the system clipboard all the time.
  • On the other hand, copying the contents of deleted cells/rows would be mightily convenient in certain workflows, enabling such sentences as described above.

I personally find myself reaching for this functionality particularly when I want to take the contents of a cell and move it lower down in the document. My vim-brain tells me to use x to grab the cell, move to the target location, and p to pop the cell back down. (This is similar behaviour to cut, i.e. ctrl+x or cmd+x.) However, this doesn't work, because the deleted cell isn't copied. My vim-brain also expects this to work with a visual selection.

@philc, Is this something that would fit the design goals of sheetkeys, or is this overstepping? Because the behaviour may be confusing to some, is it something we would gate within a user setting?

I would be interested in implementing this feature one way or another, if there's an acceptable way to fit the feature in. It should be technically fairly trivial to implement. If a setting-gate is desired, I'd be happy to try to implement the settings page (also mentioned in #38) as well.

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

1 participant