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`.

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.

31 questions
9
votes
4 answers

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.
Ben
  • 587
  • 4
  • 11
6
votes
7 answers

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: delete the opening or closing quote type the…
Sean
  • 929
  • 4
  • 13
5
votes
3 answers

YASnippet: Avoid electric pairs at expansion time

I am used to bind my YASnippet trigger keys to sequences that start with < (e.g. when I type
Giuseppe
  • 455
  • 2
  • 14
5
votes
2 answers

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 select for some reason, this adds another keystroke…
bright-star
  • 839
  • 9
  • 17
4
votes
1 answer

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 that into wrapped(someFunction()); It comes out…
Shaun
  • 177
  • 8
3
votes
1 answer

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 way, when I try to insert $ the pair \( \) are…
Tohiko
  • 1,589
  • 1
  • 10
  • 22
3
votes
1 answer

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: {{}} , and hit space to start typing my code , it becomes {{ }}}} here is what I did…
Ayed
  • 185
  • 5
3
votes
3 answers

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), electric-pair mode inserts matching brackets: if…
3
votes
1 answer

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) (modify-syntax-entry ?= "(=" org-mode-syntax-table) …
Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
2
votes
1 answer

How to make `electric-pair-mode` always generate matching delimiters &parens in html/sgml/mhtml modes?

When I type a single {, it will auto insert right } But when I type a { again, it won't auto insert right } How can I set up electric-pair-mode so that it always generates matching delimiters and parenthesis?
jilen
  • 121
  • 4
2
votes
1 answer

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 opening one, it also deletes the closing one for…
Omar
  • 4,732
  • 1
  • 17
  • 32
2
votes
1 answer

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 found here. Can anyone help me with this issue?
Tim Hilt
  • 297
  • 1
  • 11
2
votes
1 answer

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?
premopie
  • 378
  • 2
  • 11
2
votes
1 answer

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-pair-mode can do it. I tried this without…
Name
  • 7,689
  • 4
  • 38
  • 84
2
votes
2 answers

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 \left and \right commands. For these commands in…
jjokella
  • 45
  • 4
1
2 3