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:
(defvar xah-brackets '("āā" "()" "[]" "{}" "<>" "ļ¼ļ¼" "ļ¼ļ¼" "ļ¼»ļ¼½" "ļ½ļ½" "ā¦ ā¦" "ćć" "ā¦ā¦" "ā¹āŗ" "Ā«Ā»" "ćć" "ćć" "ćć" "ćć" "ćć" "ā¦ā¦" "ćć" "ćć" "ćć" "ļ½¢ļ½£" "ā¦ā§" "āØā©" "āŖā«" "ā®āÆ" "ā¬ā" "āā" "āā" "ā¦ā¦" "ā¦ā¦" "āā" "āā" "āØā©" "āŖā«" "ā“āµ" "ā¬ā" "ā®āÆ" "ā°ā±" "ā²ā³" "ā©āŖ" "ā¦ā¦" "ā§¼ā§½" "ļ¹ļ¹" "ļ¹ļ¹" "ļ¹ļ¹" "ā½ā¾" "āā" "ā¦ā¦" "ā¦ā¦" "ā¦ā¦" "ā ā" "āø¢āø£" "āø¤āø„" "ā ā" "ā¦ā¦" "ā¦ā¦" "āø¦āø§" "āøØāø©" "ļ½ļ½ ") "A list of strings, each element is a string of 2 chars, the left bracket and a matching right bracket. Used by `xah-select-text-in-quote' and others. Version 2023-07-31") (defconst xah-left-brackets (mapcar (lambda (x) (substring x 0 1)) xah-brackets) "List of left bracket chars. Each element is a string.") (defconst xah-right-brackets (mapcar (lambda (x) (substring x 1 2)) xah-brackets) "List of right bracket chars. Each element is a string.") (defun xah-select-text-in-quote () "Select text between the nearest left and right delimiters. Delimiters here includes QUOTATION MARK, GRAVE ACCENT, and anything in `xah-brackets'. 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' Version: 2020-11-24 2023-07-23 2023-11-14" (interactive) (let ((xskipChars (concat "^\"`" (mapconcat #'identity xah-brackets "")))) (skip-chars-backward xskipChars) (push-mark (point) t t) (skip-chars-forward xskipChars)))
Emacs, Work with Brackets
- 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 š¦