zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.68k stars 2.79k forks source link

Treat multiple spaces as separate word #14389

Open dtonda8 opened 2 months ago

dtonda8 commented 2 months ago

Check for existing issues

Describe the feature

I would like an option (if not already existing) to treat multiple spaces as single word, as opposed to treating the next/previous word as single word (that may include multiple spaces). I am more accustomed to this from my experience in VSCode and Sublime

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

Side by side comparison between Sublime (left) and Zed (right)

https://github.com/user-attachments/assets/48e1ac70-cfca-4237-878d-fc8e54d89d48

notpeter commented 2 months ago

I can reproduce this. cmd+delete (cmd+fn+backspace on Macbook keyboard) is bound to editor::DeleteToNextWordEnd. To match Sublime VScode that should be DeleteToNextStart (which doesn't yet exist).

Here's the similar thing in the other direction

thataboy commented 1 month ago

I agree with OP that it is not intuitive at all in the situation shown that any command should wipe out the self in the next sentence. Yes it is doing what the command says it does, but it is almost never what the user means to do in that situation, which is simply to quickly join the next line to current one. So there should at least be a command to do what the left window does, or the existing command should be changed to conform to the DWIM (Do what I mean) principle.

Note that if you really do mean to delete self, it's easy enough to mindlessly hit the key the second time. This is much faster than hitting delete repeatedly, probably after having to hit undo because you haven't learned zed's quirks yet.