Questions tagged [smartparens]
The smartparens tag has no usage guidance.
44
questions
0
votes
0answers
41 views
How to unbind the key for a specific map?
I use org, smartparens and use-package altogether. Sometimes I need to delete a heading and its subheadings. Without smartparens package I use the C-k key and it allows me to delete the heading itself ...
0
votes
0answers
22 views
keybinding behavior and smartparens
I am using a german keyboard layout and because it is very annoying to type curly brackets I have remapped them to C-7 and C-0 in addition to the default binding AltGr-7 and AltGr-0. I also want to ...
0
votes
1answer
37 views
Expand parentheses with smartparens
I want to expand else {|} (second parentheses generated by smartparens) into
else {
|
}
which is the best sequence of keys or options?
1
vote
1answer
34 views
I would like to add a shortcut to sp-wrap-square in spacemacs
I would like to extend the lisp editing shortcuts so SPC k [ and SPC k { would wrap the current form in [] and {} respectively.
I don't know what I need to write in my spacemacs config to enable this ...
1
vote
1answer
314 views
smartparens does not work well in orgmode
First, let me say I am new to orgmode and emacs. I am sure I am not providing all the relevant information for the problem, so please let me know what can I add here.
I am using emacs 26.3, and I use ...
2
votes
1answer
130 views
Web-mode left arrow without the right closing angle bracket
When using Elixir html template (.eex) in web-mode, I sometimes need to type code like <%= for bid <- @bids do %> . At the moment because the opening left angled bracked is closed immediately ...
0
votes
0answers
21 views
Smartparens slurping across fluent call chains in php-mode
I have not been able to find a solution to this frustrating problem. Here is the situation and my questions are at the end:
Given code that looks similar to this:
$this->hello()->wootFluent()-&...
0
votes
0answers
32 views
Use arrows keys to call Lispy functions
In lispy-mode, I want to use control + the arrow keys instead of lispy's defaults (h, j, k, l).
But if I run the obvious code
(define-key lispy-mode-map [C-up] 'lispy-up)
then C-up always ...
1
vote
2answers
231 views
Rebinding smartparens keys using Evil
I use vanilla Emacs with evil. I did not install smartparens but it is present and enabled on my system as a dependency of something.
I need to rebind the M-s keys to something other than the default ...
0
votes
1answer
95 views
smartparens how to stop behaviour of inserting backslash \ before I type a single quote '
I'm in C major mode, editing source files. Whenever I want to type a single quote ' smartparens automatically gives me the following: \'|\' , where | is the cursor position.
What I want exactly is ...
2
votes
0answers
52 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 ...
2
votes
0answers
88 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
358 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 {...
3
votes
0answers
97 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
360 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
567 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
484 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
372 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
...
2
votes
1answer
360 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
70 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 ...
3
votes
2answers
701 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
437 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
388 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
199 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
530 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
171 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:
...
5
votes
1answer
295 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
611 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-...
1
vote
3answers
1k 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
162 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
77 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
114 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
580 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 ...
12
votes
5answers
4k 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
142 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 ...
4
votes
1answer
610 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)...
12
votes
2answers
3k 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
413 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
245 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 ...
8
votes
2answers
860 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
3answers
932 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 ...
9
votes
4answers
4k 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
288 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 ...