Questions tagged [electric-pair-mode]

Electric Pair mode, a global minor mode, provides a way to easily insert matching delimiters. Whenever you insert an opening delimiter, the matching closing delimiter is automatically inserted as well, leaving point between the two. To toggle Electric Pair mode, type `M-x electric-pair-mode`.

Filter by
Sorted by
Tagged with
3
votes
1answer
54 views

Automatically replace “$” by “\(” in latex-mode

In latex mode, using \( ... \) is preferred over $ ... $, so in my configuration I have the following (sp-local-pair modes "$" nil :actions :rem) (sp-local-pair modes "\\(" "\\)" :trigger "$") This ...
0
votes
0answers
24 views

Electric pair hyper-aggression in org-mode file

I've got this section in my init: (setq electric-pair-pairs '( (?\{ . ?\}) (?\( . ?\)) (?\[ . ?\]) ...
2
votes
1answer
80 views

Electric pair mode's delete adjacent pairs functionality not working in Slime REPL

Part of Emacs's electric-pair-mode functionality (controlled by a variable called electric-pair-delete-adjacent-pairs) is that when the point is between an empty set of delimiters and you delete the ...
2
votes
1answer
29 views

Add expressions to LaTeX-electric-left-right-brace

I would want to "electrically" insert | or \right| when typing | or \left| in AucTeX and can't quite figure out how to add characters to AucTex-electric. A list of already defined completions can be ...
1
vote
1answer
171 views

Electric behavior of dollar sign using AUCTeX

I'm trying to turn $...$ into an electric pair, just as say (...). So I tried this solution, and it works fine on my older machine, running Emacs 24.3.1 and AUCTeX 11.87. However, on a newer ...
5
votes
7answers
757 views

Easily changing matching quotes

Not infrequently, I want to change the delimiters of a string from single quotes to double quotes, or vice versa. This is so annoying a process I wonder if there's an easier way. What I do now is: ...
2
votes
1answer
121 views

web-mode disable auto pairing mode does not work

I am having little issues with web-mode. I am trying to disable the pairing which is done automatically when I try to insert double curly braces like this: {{<CURSOR>}} , and hit space to ...
1
vote
0answers
146 views

How to debug a(n) .emacs that doesn't work correctly, but also doesn't throw any errors? [closed]

I currently have an Emacs/AucTeX setup where emacs --debug-init doesn't throw any errors, but things still don't work as expected. This being the case, I don't really know how to debug my .emacs file ...
2
votes
1answer
151 views

Is it possible to define multi-character pair for electric-pair-mode?

Is it possible to define multi-character pairs (like LaTeX displayed equation pair \[ ... \] or markdown bold ** ... **) for electric-pair-mode?
1
vote
1answer
253 views

Electric/smart parentheses: allow wrapping in a nontransient way

I like smart parentheses as much as the next person, but there is one situation in which I often get frustrated. Suppose I have a TeX line reading: Lorem ipsum dolor sit amet Now I wish to \...
0
votes
1answer
294 views

electric pair of any length, using AUCTex

According to https://www.emacswiki.org/emacs/AutoPairs the package smartparens supports an electric pair of any length for example \{. My question about the possibility that the built-in electric-...
7
votes
3answers
1k views

Don't pair quotes in electric-pair-mode

How can I get electric-pair-mode to not pair quotation marks (single or double)? I still want it to pair everything else (brackets, braces, etc.), just not quotes.
1
vote
0answers
41 views

How to mark / cursor inside of curly braces when opening set of curly braces

I am using js2-mode as well as electric-pair-mode and autocomplete. When I create a function using function () { and press enter the second curly brace is made on the next line but my cursor is ...
4
votes
1answer
287 views

Smarter Electric Pair

I like electric pairing for things like... someJavascript(function() { }); Where it automatically pairs { with {) etc. However, it infuriates me when I have someFunction(); and I want to turn ...
1
vote
0answers
59 views

Electric pairs, working in Emacs 24.3, but not in 24.4

In 24.3, I have this in my .emacs, and it works: (electric-pair-mode 1) (setq electric-pair-pairs '( (?\" . ?\") (?\{ . ?\}) (?\( . ?\) ) ) Normally I use this in org-mode. All of them worked ...
3
votes
3answers
155 views

Matching spacing around electric pairs

In c-mode, rust-mode, and similar major language modes, I frequently type something such as the following Rust: if some_bool { Some(foo) } else { None } As I enter this (| represents my cursor), ...
3
votes
1answer
231 views

Adding tilde to electric pairs in org mode

I am trying to add the verbatim character ~ (tilde) as an electric-pair character in org-mode. Here is my attempt: (with-eval-after-load 'org (modify-syntax-entry ?/ "(/" org-mode-syntax-table) (...
1
vote
2answers
91 views

delete-c-electric-paren deletes active region in CC mode with delete-selection-mode enabled

I've the delete-selection-mode enabled. In programming modes like Python and Lua, or in general modes like Fundamental or Text, when there's an active region, pressing ( rightly wraps the region with ...
1
vote
3answers
118 views

Using electric-pair on apple keyboards

BACKGROUND: I have started to use emacs with a macbook and the first difficulty was that the meta keys are used for emacs things, where there would otherwise be used for special characters, such as: [...
2
votes
2answers
338 views

AucTeX: Disable electric-pair-mode in minibuffer during Macro definition?

I use Emacs 24.3.1 and AUCTeX. I switched on the electric-pair-mode in LaTeX-buffers. The only time I would really like to disable it in the minibuffer while inserting math-mode parentheses via the \...
5
votes
2answers
388 views

Getting electric-pair mode to behave more nicely around existing strings

Electric-pair-mode always tries to insert a closing delimiter after the opening one if nothing is selected. However, if you're placing delimiters around an existing something that you don't want to ...