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

"Hungry backspace" option #5056

Open
1 task done
widersky opened this issue Jan 6, 2023 · 2 comments
Open
1 task done

"Hungry backspace" option #5056

widersky opened this issue Jan 6, 2023 · 2 comments
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] setting Feedback for preferences, configuration, etc

Comments

@widersky
Copy link

widersky commented Jan 6, 2023

Check for existing issues

  • Completed

Describe the feature

One of the things I like about JetBrains' IDEs is the option that is most often called "Hungry backspace / delete". This consists in the fact that when we no longer have any content behind the cursor in a given line, the cursor instead of "regressing" to the first column of the empty line, jumps the line higher instead.

This is best seen on the gifs from the "Hungry Delete" extension page to VSCode below.

It would be great to have the option to enable this cursor behavior :)

If applicable, add mockups / screenshots to help present your vision of the feature

Without "hungry delete":

With "hungry delete":

@widersky widersky added feature [core label] triage labels Jan 6, 2023
@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc setting Feedback for preferences, configuration, etc and removed triage labels Jan 6, 2023
@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@biblicabeebli
Copy link

I think in their screen cap @widersky is attempting to visually represent a Hungry Delete operation in Zed with multiple keypresses. It is intended to be a single action.

This is the video in the Hungry Delete VSCode extension:
image

IMHO the breakdown of delete options (in both directions, for backspace and del) are the following:

These already exist in Zed:

  • single character delete that also contextually consumes one level of indentation when it is all whitespace
  • word delete that also contextually acts as a hungry whitespace delete up to a line break
  • subword delete that also contextually acts as a hungry whitespace delete up to a line break
  • delete all characters up to the next/previous line break.
  • delete a single line

Don't exist in Zed (and are reasonable):

  • delete up to the current indentation level
    • This exists in text section options as ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true }]
  • delete until you hit a non-whitespace character - e.g. a hungry whitespace delete.
  • single character delete.
    • This might exist, but I couldn't work it out.

These exist elsewhere, but are insane in a code editor:

  • hungry whitespace delete, and then do a word delete -- makes sense in a word processor.
  • hungry combined whitespace and punctuation wtaf delete, and then do a word delete.*

Also,


*I'm looking at you, Xcode.

@dswbx

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] setting Feedback for preferences, configuration, etc
Projects
None yet
Development

No branches or pull requests

4 participants