Supposing I have my cursor resting somewhere in a bunch of text within quotes, is there a key binding that will mark or highlight just the text within the quotes so I can delete it?

This would be ideal for web-mode. Perhaps, if there's not already an emacs way of doing this, then maybe there's a way of doing in web-mode.

2 Answers 2


You can use the expand-region or emacs-surround packages to select the text and then delete it.

Watch an intro to expand-region on: Emacs Rocks.

Or take a look at the examples of emacs-surround on its README file.

(defun select-text-in-delimiters ()
  "Select text between the nearest left and right delimiters."
  (let (start end)
    (skip-chars-backward "^<>([{\"'")
    (setq start (point))
    (skip-chars-forward "^<>)]}\"'")
    (setq end (point))
    (set-mark start)))

Your Answer

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

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