Disable Smartparens or parenthesis completion

When you type some opening characters, like an opening parenthesis ( or square bracket [, the smartparens package is configured to automatically add a closing one immediately after the cursor.

If you don’t like this behavior you can disable it by:

  • Disabling smartparens-mode globally: (remove-hook 'doom-first-buffer-hook #'smartparens-global-mode)
  • Or disabling it in a particular major mode: (add-hook 'python-mode-hook #'turn-off-smartparens-mode)

(Add either to ~/.doom.d/config.el)


Some outdated sources may tell you to do this, but it is no longer correct :

(after! smartparens
  (smartparens-global-mode -1))

:warning: The package itself cannot be disabled with package! , because it is a core package. This may change one day, but not in the near future.

1 Like