emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-surround ee19b598ca 019/175: Merge pull request #8 fr


From: ELPA Syncer
Subject: [nongnu] elpa/evil-surround ee19b598ca 019/175: Merge pull request #8 from cofi/master
Date: Mon, 9 Oct 2023 13:01:00 -0400 (EDT)

branch: elpa/evil-surround
commit ee19b598caace997bc4b6c5e90e08830e220fd9e
Merge: b40d2b6542 9f2917cfe2
Author: Tim Harper <timcharper@gmail.com>
Commit: Tim Harper <timcharper@gmail.com>

    Merge pull request #8 from cofi/master
    
    Mention the new buffer local surround pairs in the readme
---
 README.md | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/README.md b/README.md
index b1f5e97043..7c069a7782 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,35 @@ or this (trigger char and calling a function):
 You can add new by adding them to `surround-pairs-alist`.
 For more information do: `C-h v surround-pairs-alist`.
 
+`surround-pairs-alist` is a buffer local variable, which means that you can 
have
+different surround pairs in different modes.
+By default `<` is used to insert a tag, in C++ this may not be useful - but
+inserting angle brackets is, so you can add this:
+
+    (add-hook 'c++-mode-hook (lambda ()
+                               (push '(?< . ("< " . " >")) 
surround-pairs-alist)))
+
+Don't worry about having two entries for `<` surround will take the first.
+
+Or in Emacs Lisp modes using ` to enter ` ' is quite useful, but not adding a
+pair of ` (the default behavior if no entry in `surround-pairs-alist` is
+present), so you can do this:
+
+    (add-hook 'emacs-lisp-mode-hook (lambda ()
+                                      (push '(?` . ("`" . "'")) 
surround-pairs-alist)))
+
+without affecting your Markdown surround pairs, where the default is useful.
+
+To change the default `surround-pairs-alist` you have to use `setq-default`, 
for
+example to remove all default pairs:
+
+    (setq-default surround-pairs-alist '())
+
+or to add a pair that surrounds with two ` if you enter ~:
+
+    (setq-default surround-pairs-alist (cons '(?~ ("``" . "``"))
+                                             surround-pairs-alist))
+
 ## Usage examples ##
 
 Here are some usage examples (taken from



reply via email to

[Prev in Thread] Current Thread [Next in Thread]