Search code examples
emacseditorspacemacs

In Emacs, How do I configure to delete matching bracket just pressing delete key?


I'm currently using Emacs(Spacemacs) in coding.

Spacemacs are using smartparens as a plugin, so close brackets are automatically inserted when I write open brackets.

But, when I delete open brackets using delete button, the close brackets remain there.

Other editor, like Atom or Sublime text, the matching bracket is automatically deleted when I delete open bracket, just pressing delete key. How do I configure this feature in Emacs?

Here are the examples.

Emacs:

emacs

Atom:

atom

Thank you for your advise.


Solution

  • You could install the autopairs package.

    After installing, you can enable it globally by having this in your .emacs

    (require 'autopair) (autopair-global-mode 1)