Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [smartparens]

The tag has no usage guidance.

2
votes
0answers
23 views

Automatically wrap text with smartparen

Using smartparen, if I have some text I can select it then press ( { or [ and the text is wrapped in those braces. How can I extend this functionality so that (in Latex for example) if I press $ the ...
1
vote
0answers
49 views

smartparens with LaTeX to deal with \begin \end environment and markup commands

How can I configure smartparens to treat \begin ...\end environments, and commands, e.g., \textbf, delimiters so that I can navigate them, e.g., using sp-forward-sexp.
5
votes
2answers
127 views

Remove extra braces

I have some text like this This is a {{text}} with { { {some {extra} unneeded { {and ugly}} braces }}}. Is there a way to remove the extra unneeded parenthesis so that the result is This is a {...
1
vote
0answers
34 views

smartparen-latex with delete-selection-mode

In my emacs setup, if I have smartparens-mode enabled with smartparens-latex and I open a latex document, type some text then select it and type any latex special command (such as $, ", \{, etc...) ...
1
vote
1answer
218 views

Is there a way to highlight the (s) expression you are in?

I currently have (paren-set-mode 'paren) in my init.el, and it does a good job of highlighting the area between parentheses. However, I was wondering if there was a way to highlight the expression I ...
3
votes
2answers
422 views

automatically close type parens in C++

Does anybody know of a way or a package that can recognize < and > when occuring in template contexts and automatically writes a > either right after the < or after the selected region ...
2
votes
1answer
244 views

how to make smartparens insert “` and ”' instead of ``'' in latex-modes

Smartparens is quite useful, but I just do not understand its documentation. How do I make smartparens insert "` and "' instead of `` and '' when pressing " in latex-mode? Remark (because formating ...
0
votes
1answer
201 views

smartparens with strict mode in javascript

I am trying to configure smartparens to work with javascript, my config looks like this: (use-package smartparens :ensure t :diminish smartparens-mode :commands (smartparens-mode ...
3
votes
1answer
229 views

smartparens NOT insert pair of LaTeX quotes?

Q: how do I get smartparens not to insert a pair of ``LaTeX'' quotes? The goal I set up smartparens to insert a pair of quotation marks unless point is just before a word or just after it, where * ...
2
votes
1answer
59 views

Chomp whitespace when autoclosing with smartparens?

electric-pair has an electric-pair-skip-whitespace config that accepts 'chomp to delete any whitespace between point and the matched closing delimiter. Does smartparens have something like that? I ...
4
votes
2answers
547 views

Always remove brackets by pairs - fix hungry-delete-mode and smartparens-strict-mode conflict

Enabling smartparens-strict-mode breaks hungry-delete-mode as it overrides the hungry-delete remaps for C-d and C-h with smartparens specific functions. Hence, I have disabled smartparens-strict-mode ...
0
votes
2answers
256 views

Configure smartparens wrapping to work in evil-visual-state?

I've been migrating from Vim to Emacs in evil mode, and I'd like to use smartparens. I know there's a port of surround.vim, but I've always found surround.vim awkward to use, so I'd like to explore an ...
1
vote
1answer
231 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 \...
1
vote
1answer
115 views

Smartparens strict mode C-w kill line if no active region

I'm using smartparens-strict-mode and trying to get it so that C-w kills a region if selected and the whole line that point is on if not (like this but working with smartparens strict mode). This is ...
3
votes
1answer
299 views

Error running timer “show-paren-function” when displaying matching line in message/mini buffer

I want to display the line contains matching bracket in the message/mini buffer at the bottom of emacs. I found some code on emacs Wiki, after put it in init file, emacs do show the maching line in ...
1
vote
1answer
115 views

What is disabling the dash package?

I'm trying to install the smartparens package, but I'm having trouble. When I go to M-x list-packages, mark smartparens for installation, and hit x (execute) y (yes), I get the error message: ...
4
votes
1answer
221 views

How to disable $ pairing in latex-mode in Spacemacs?

When I click $ I get another matching $ thanks to smartparens. I would like to disable this behavior but keep all other matching pairs like () enabled. I tried adding this to the Spacemacs config but ...
3
votes
2answers
355 views

Smartparens: do not insert parenthesis pair when point is at the beginning of word

How can I make smartparens not to insert a parenthesis pair when the point is at the beginning of a word? I only want it to insert the opening parenthesis. This is my setup: (use-package smartparens-...
0
votes
2answers
780 views

smartparens strict mode insert single quote before variable

I'm using smartparens-global-strict-modeand having issues quoting variables. How do I get something like 'varname? My current strategy, which seems ridiculous, is to do: '|' (sp inserts both pairs) '...
8
votes
1answer
134 views

Is there a command for tidying trailing parentheses?

When editing lisp code, I often end up with trailing parentheses scattered around (assuming | is point): (defun example-function () (let ((x (+ 1 1))) (when x (message x)| ) )) ...
3
votes
1answer
66 views

How do I set up smartparens for use with Mathematica comments?

I've been trying to get smartparens to recognize Mathematica's comments, which have delimiters (* and *), while keeping the default behavior for ordinary parens ( and ). The following configuration ...
0
votes
0answers
72 views

lisp code not indenting after paredit slurping, etc

When I use smartparens-mode or paredit-mode to shift parens around (e.g. paredit-forward-slurp-sexp) the effected forms are not being indented appropriately. For example if I add a let and then slurp ...
1
vote
0answers
479 views

How can I make Spacemacs stop deleting my parentheses?

I've recently switched from emacs to spacemacs (develop branch), and I'm still getting used to the new defaults. I added smartparens to my excluded-packages in my config file, because I don't like ...
11
votes
5answers
2k views

Disable smartparens in spacemacs

The smartparens-mode doesn't suit my style of editing. If I attempt to disable it globally in spacemacs, however, the mode is re-enabled: (smartparens-global-mode -1) How do I disable smartparens-...
2
votes
1answer
119 views

Smartparens generates nested quotes instead of overwriting final quote if backspace used in between quotes

The relevant section in my .emacs file looks as follows: (require 'smartparens) (smartparens-global-mode t) (require 'smartparens-config) ;; for erb (sp-pair "%" "%" :wrap "C-%") I am often getting ...
3
votes
1answer
415 views

Smartparens and web-mode conflict to add extra angular bracket

I am fairly new to customizing my emacs, so please be gentle. I did try to find a solution for this, but all I found was a page on git where someone asked a similar question but (as far as I can tell)...
11
votes
1answer
2k views

How do I jump out of enclosing parentheses?

I'm using spacemacs to edit Python code. When I type an opening parentheses, the closing parentheses is automatically inserted for me and the cursor is put in the middle for further typing. But: ...
1
vote
1answer
322 views

How to get html tag completion working with smartparens in emacs?

I've installed the smartparens package, and features involving the normal pairs (parenthesis, brackets, curly braces, etc...) work fine; however, none of the features around tags (html tags for ...
1
vote
0answers
226 views

Unable to get backtrace for error

I have installed paredit & need to turnoff smartparens. I checked this answer and I have added (advice-add #'smartparens-mode :before-until (lambda (&rest args) t)) to my prelude starter ...
7
votes
2answers
592 views

smartparens insert single versus paired character?

Q: how can I tweak smartparens's decision rules for when to insert a paired or single character? smartparens seems to be mostly smart when inserting single quotes (e.g., in text-mode or org-mode). ...
3
votes
2answers
765 views

How do I turn-off smartparens when using prelude?

I find smartparens awkward. It's easier for me to type the matching paren/quote than to arrow over or C-f over. I want to turn off smartparens everywhere. I'm using prelude though and I can see that ...
8
votes
4answers
2k views

Automatically formatting brackets

I'm trying to create a function that places/aligns/indents curly brackets according to Allman-style formatting (for coding in C). Generally speaking, I am fan of Smartparens' interface available to ...
7
votes
2answers
1k views

What are the differences between autopair and smartparens?

Both autopair and smartparens provide functionality for inserting matching pairs of delimiters automatically. How do they differ from each other in practice (if at all)? What are some use cases that ...
5
votes
2answers
239 views

Detect when a key is rebound to another command

First, some context: I am in the process of debugging a strange interaction between smartparens and Org Speed Keys: After editing an .org file for a while, specific speed keys for navigating the ...