A simple utility providing parentheses auto-pairing and wrapping
Emacs Lisp
Pull request Compare This branch is 8 commits behind snosov1:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.org
dummyparens.el

README.org

About

Dummyparens is a simple utility providing parentheses auto-pairing and wrapping.

When you press an opening parenthesis key it inserts the closing one for you. If a region is selected when you press the key, the region will be wrapped. If you wrap with { it will also indent the wrapped region (convenient for C and the like).

This is similar to electric-pair minor mode, but with wrapping.

It’s intended to be minimalistic and non-invasive as you would expect such simple functionality to be.

For more sophisticated features, like HTML tags or LaTeX environments handling, consider looking at smartparens.

Configuration

Initialization

  • Create folder ~/.emacs.d if you don’t have it
  • Go to it and clone dummyparens there
    git clone https://github.com/snosov1/dummyparens.git
        
  • Put this in your ~/.emacs file
    (add-to-list 'load-path "~/.emacs.d")
    (when (require 'dummyparens nil t)
      (global-dummyparens-mode))
        

Customization

You can customize dp-pairs variable to add or remove symbols that have to be paired. E.g.

(setq dp-pairs '(
                 ("(" ")" nil)
                 ("[" "]" nil)
                 ("{" "}" dp-brace-post-handler)
                 ("\"" "\"" nil)
                 ))