syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Globally turn off smartparens paren matching (2018 edition) #10858

Closed Profpatsch closed 5 years ago

Profpatsch commented 6 years ago

There are a few issues asking how to turn off smartparens without crippling spacemacs (like this one or this one, but they mention functions like spacemacs/toggle-smartparens-off which don’t exist anymore.

Personally I am very allergic to “smart” heuristics that try to insert or delete characters while I’m typing, so how do I turn this off globally?

I found this snippet which removes a few pairings, but maybe there’s a better way?

syl20bnr commented 6 years ago

Excluding smartparens should enough. If not then we need to fix the bugs.

Le 12 juin 2018 à 11:26, Profpatsch notifications@github.com a écrit :

There are a few issues asking how to turn off smartparens without crippling spacemacs (like this one or this one, but they mention functions like spacemacs/toggle-smartparens-off which don’t exist anymore.

Personally I am very allergic to “smart” heuristics trying to insert or delete characters while I’m typing, so how do I turn this off in a global way?

I found this snippet which removes a few pairings, but maybe there’s a better way?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Profpatsch commented 6 years ago

Okay, I excluded it and will reopen if I find that it causes bugs.

vatrat commented 5 years ago

Does (remove-hook 'prog-mode-hook #'smartparens-mode #'show-smartparens-mode) not do it for you? It seems that stops it from being enabled on buffers. Someone from the last issue said that smartparens as a package adds some other features like SPC j n sp-newline, so perhaps it's better to just disable the offending functionality (and I agree, I really hate the automatic insertion as well).

Profpatsch commented 5 years ago
   dotspacemacs-excluded-packages '(
     smartparens

seems to have done the trick.

chshersh commented 5 years ago

Adding smartparens to excluded packages doesn't work for me. But the snippet given by @Profpatsch works like magic! I've been suffering too long from automatic addition of closing parenthesis, square brackets, curly brackets, single quotes, double quotes and backtics. Thank you, @Profpatsch for the link to this snippet!

dgealow commented 3 years ago

The initial snippet mentioned has been working for me for a few years, but I recently started coding in Python with spacemacs and, to my horror, my parentheses are automatically closing themselves again in python mode. (Not, however, in any other mode I've tried, e.g. lisp or c.) I don't know if smartparens is the culprit, or if it's some other package that python mode is using.

dgealow commented 3 years ago

Update: it is indeed smartparens. Workaround: add (add-hook 'python-mode-hook 'spacemacs/toggle-smartparens-off) to my dotspacemacs/user-config.