Questions tagged [smartparens]
The smartparens tag has no usage guidance.
53
questions
0
votes
0
answers
11
views
smartparens, to match only parens
In my Emacs, smartparens tries to match square bracket with parenthesis,
indicating a mismatch, as in the following expression:
(modify-syntax-entry ?[ ". 23" table)
^...
0
votes
1
answer
27
views
smartparens, remove wrapping parens and contents
How can I go from
((equal arg '(4))
(setq current-prefix-arg nil)
(spacemacs/helm-files-smart-do-search)
)
to here
(setq current-prefix-arg nil)
(spacemacs/...
0
votes
1
answer
14
views
smartparens, how to copy unbalanced () code blocks?
(defun ek/search-set-directory ()
....
)
Suppose I copy the first line which is not balanced,
then smartparen won't allow me to add ).
I can add it by using C-q )
Wonder if there's a better ...
0
votes
1
answer
37
views
prevent emacs deleting ")"
I don't want to turn off entire smartparens or similar mode
((([cursor]))
When I type ) at cursor location I expect it to be
((()))
but it becomes
((())
How to find out which mode is causing it?
0
votes
0
answers
12
views
smartparens face for enclosing parenthesis?
sp-show-pair-matching-face is the current matching face.
I think smartparens also has a face to the enclosing open parenthesis.
I can't find its name
related question is, can I find out the face of ...
1
vote
1
answer
25
views
smartparens, just disable automatic insertion of parentheis
I 'd like to try smartparens but don't like the automatic parenthesis insertion.
Can I turn it off that feature only?
Or is it meaningless to keep the mode after I disable the feature?
0
votes
1
answer
65
views
smartparens' (sp-pair "⟨" "⟩" :wrap "C-*") doesn't work
The following config:
(require 'smartparens)
(smartparens-mode t)
(smartparens-global-mode t)
(sp-pair "⟨" "⟩" :wrap "C-*")
doesn't work. Indeed:
running C-x C-e on the ...
1
vote
1
answer
94
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
39
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
132
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
165
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
122
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
66
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
930
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
240
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
39
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
44
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
454
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
153
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
152
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
114
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
598
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
139
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
459
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
666
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
649
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
502
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
467
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
92
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
840
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
622
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
557
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
249
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
885
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
224
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:
...
6
votes
1
answer
320
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
789
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-...
2
votes
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
198
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
87
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
200
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
653
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
6
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
157
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
743
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)...
15
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
573
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
263
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
951
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 ...