• @[email protected]
    link
    fedilink
    34 days ago

    Is there an emacs key to ‘delete this entire word’?

    like if I’m using ls to look for a file, then I want to cat a file, I press up to get the previous command, ctrl+a to go to the beginning of the line and then spam d to delete letters. It’s be much better if there was a ‘delete until whitespace’ button.

    • pine
      link
      fedilink
      3
      edit-2
      3 days ago

      M-d, aka alt+d

      Generally in emacs ctrl+whatever operates on characters, while alt+whatever operates on words. For example, you can do ctrl+f/b to go forward/backword a character, and alt+f/b to go forward/backward a word.

      • @[email protected]
        link
        fedilink
        23 days ago

        Oh yeah, that’s way better. Thanks!

        I’m using zsh and trying the emacs mode, that alt operates on words is the secret sauce I was looking for.