• FauxLiving@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      1 day 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@pawb.social
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        edit-2
        24 hours 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.

        • FauxLiving@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          6 hours 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.