Is there an Emacs function to delete (forward or backwards) until the first whitespace? For example, I have the following line, and the cursor is marked by the caret:
someword ?(&)!* morewords
^
I want to delete the backwards the sequence of non-alphanumeric characters, but not the word someword
. Using backward-delete-word
will wipe out the word as well. The same is with the cursor before the weird characters and kill-word
.
emacs has the function zap-to-char
which will delete everything up to a specific character. So, this won't work for all whitespace but if your specific problem is everything up to a space you can use this function. Give the function a negative argument to zap backwards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With