Questions tagged [smartparens]
The smartparens tag has no usage guidance.
46
questions
1
vote
1
answer
61
views
How to prevent smartparens slurp from slurping item separator?
I am looking into Erlang support for smartparens and would like to be able to slurp a string into the current list without including the Erlang statement termination colon in the list.
In an erlang-...
1
vote
0
answers
23
views
Automatically TeX-fold paragraph after "}" + SPC
I have defined the following smartparens pair:
(sp-pair "\\textit\{" "\}"
:trigger "ital "
:wrap "C-S-k")
Now, when I write &...
0
votes
0
answers
86
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 ...
1
vote
0
answers
92
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
1
answer
63
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
1
answer
46
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 ...
3
votes
1
answer
666
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
1
answer
204
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
0
answers
31
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
0
answers
39
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
2
answers
365
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
1
answer
115
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
0
answers
91
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
0
answers
104
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
2
answers
462
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
0
answers
121
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
1
answer
410
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
2
answers
624
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
1
answer
587
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
1
answer
451
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
1
answer
425
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
1
answer
83
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
2
answers
778
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
2
answers
553
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
1
answer
501
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
1
answer
228
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
1
answer
738
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
1
answer
196
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
1
answer
309
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 ...
4
votes
2
answers
736
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
3
answers
2k
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
1
answer
179
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
1
answer
86
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
0
answers
160
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
0
answers
607
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
5
answers
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
1
answer
150
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 ...
5
votes
1
answer
695
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)...
13
votes
2
answers
4k
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
1
answer
521
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
0
answers
257
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
2
answers
915
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
3
answers
1k
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
4
answers
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
2
answers
2k
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
2
answers
307
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 ...