12

When typing/editing text, how do I delete the word at which the text cursor currently is?

I mean a "system-wide" solution that works in most programs (and is maybe offered by the OS), rather than hotkeys that are specific to certain text editors.

1
  • 1
    This is a good reason to use Vim: diw (= delete inner word)
    – iBug
    Jun 15, 2021 at 17:02

4 Answers 4

16

Ctrl+Backspace deletes the current word up until the text cursor.

Ctrl+Del deletes the end of the current word from the text cursor onward, as well as all spaces and tabs directly after the word.

Therefore, if you hold Ctrl and press (simultaneously or in any order) Del and Backspace, you'll delete the current word.

This works for example on Windows in Notepad and Google Chrome.

3
  • 7
    You may want to add information about Ctrl+Left/Right as a way to move to the beginning or end of a word.
    – jaskij
    Jun 14, 2021 at 19:43
  • 3
    I would also do Ctrl+--> and then Ctrl+Backspace. IMHO this is safer, because the first action does not modify the document yet and the last action can be undone in a single step. Jun 15, 2021 at 10:59
  • If the cursor is in the middle of a word and you press Ctrl+Backspace twice, the first action will delete the beginning of the word up to the cursor, the second, however, will delete the word before it. In other words, if the cursor is at the beginning of a word, pressing Ctrl+Backspace will delete the previous word (if there is one, of course).
    – Andriy M
    Jun 15, 2021 at 14:45
1

You have an answer for Windows, but for other readers, it's worth noting that the same solution applies to Mac, with some key substitutions.

⌥ Option + ⌫ Delete deletes the current word up until the text cursor.

+ ⌦ Delete (or for the shorter keyboards +fn+Delete) deletes the end of the current word from the text cursor onward (this does not delete spaces, or other characters directly after the word).

1
  • 3
    this question is actually tagged windows so if you want a mac answer it should be a different question
    – phuclv
    Jun 15, 2021 at 1:48
1

You may find this simpler, and give you more control over what you are doing: first do a double-click. This will mark the whole word. Then press delete.

0

The other answers are fairly good, but they miss an important problem: in some applications (try renaming a file in windows explorer), Ctrl+Backspace actually inserts a weird box character instead.

There are a few workarounds:
You can use Ctrl+ to go back to the beginning of the word, and then use Ctrl+Delete.
You can also select the text using Ctrl+Shift+←/→ after placing your cursor at the start of the word using Ctrl+, and then delete it using Backspace or Delete. This method also has the advantage of making it extremely clear what exactly you are deleting.

I believe both of these apply to mac as well, though you might not run into the issue there in the first place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.