Emacs: Select Text Between Quotes š
Select Text between Quotes/Brackets
Select text inside quotes is one of the most frequently needed operation in programing languages code.
put this in your Emacs Init File:
(defun xah-select-text-in-quote () "Select text between the nearest left and right delimiters. Delimiters here includes QUOTATION MARK, GRAVE ACCENT, and most commonly used Unicode matching brackets. Does not include APOSTROPHE. This command ignores nesting. For example, if text is ć(a(b)cā®)ć the selected char is ćcć, not ća(b)cć. URL `http://xahlee.info/emacs/emacs/emacs_select_quote_text.html' Created: 2020-11-24 Version: 2026-07-09" (interactive) (let ((xskipChars "^`\"āā()[]{}<>ļ¼ļ¼ļ¼ļ¼ļ¼»ļ¼½ļ½ļ½ā¦ ā¦ććā¦ā¦ā¹āŗĀ«Ā»ććććććććććā¦ā¦ćććććć「」ā¦ā§āØā©āŖā«ā®āÆā¬āāāāāā¦ā¦ā¦ā¦āāāāāØā©āŖā«ā“āµā¬āā®āÆā°ā±")) (skip-chars-backward xskipChars) (push-mark (point) t t) (skip-chars-forward xskipChars)))
(defun xah-cut-text-in-quote () "Cut text between the nearest left and right delimiters. See `xah-select-text-in-quote' URL `http://xahlee.info/emacs/emacs/emacs_select_quote_text.html' Created: 2023-07-23 Version: 2026-07-09" (interactive) (let ((xskipChars "^`\"āā()[]{}<>ļ¼ļ¼ļ¼ļ¼ļ¼»ļ¼½ļ½ļ½ā¦ ā¦ććā¦ā¦ā¹āŗĀ«Ā»ććććććććććā¦ā¦ćććććć「」ā¦ā§āØā©āŖā«ā®āÆā¬āāāāāā¦ā¦ā¦ā¦āāāāāØā©āŖā«ā“āµā¬āā®āÆā°ā±") xbeg xend) (skip-chars-backward xskipChars) (setq xbeg (point)) (skip-chars-forward xskipChars) (setq xend (point)) (kill-region xbeg xend)))
Emacs, Work with Brackets
- Emacs: How to Edit Lisp Code
- emacs init: Highlight Brackets
- emacs init: Auto Insert Closing Bracket (electric-pair-mode)
- Emacs: Insert Brackets by Pair š
- Emacs: Delete Brackets by Pair š
- Emacs: Move Cursor to Bracket š
- Emacs: Jump to Matching Bracket š
- Emacs: Change Brackets š
- Emacs: Navigate Lisp Code as Tree
- Emacs: Select Text Between Quotes š
- Emacs: Xah Elisp Mode š¦