• Stars
    star
    1,788
  • Rank 25,025 (Top 0.6 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated 18 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.

Smartparens

Join the chat at https://gitter.im/smartparens/Lobby MELPA Documentation Status MELPA Stable Documentation Status Build Status Coverage Status Paypal logo Patreon

Table of Contents

Smartparens is a minor mode for dealing with pairs in Emacs.

It can automatically insert pairs:

smartparens insert

wrap, unwrap and rewrap pairs:

smartparens wrapping

expand and contract pairs:

smartparens slurping

navigate pairs:

smartparens navigating

and much more!

Getting Started

We generally target GNU Emacs version 24.3 and newer, however, everything should work mostly fine on anything newer than version 24.

You can install smartparens from MELPA. Once installed, enable the default configuration:

(require 'smartparens-config)

You can now use smartparens with M-x smartparens-mode. To automatically enable smartparens in a programming mode:

;; Always start smartparens mode in js-mode.
(add-hook 'js-mode-hook #'smartparens-mode)

You may want to try smartparens-strict-mode. This enforces that pairs are always balanced, so commands like kill-line keep your code well-formed.

Usage

Inside Emacs, M-x sp-cheat-sheet will show you all the commands available, with examples.

There's also a great article demonstrating movement and editing in smartparens and extensive documentation in the wiki.

Contributing

We love pull requests. Please include tests. Smartparens uses ert-runner for testing. To run all the tests, run:

$ cask exec ert-runner

Alternatively, you can open the individual files in Emacs, then M-x eval-buffer M-x ert.

You can learn more about how we test on the testing wiki page.

Language Support

Smartparens has a default configuration that works well for most languages. For language-specific behaviour, smartparens has a separate smartparens-FOO.el file for every language and smartparens-config.el loads these automatically.

Supporting Smartparens

If you want to support this project, you can:

  • Contribute code. If you have an idea that is not yet implemented and will benefit this project, feel free to implement it and submit a pull request. If you have any concerns whether your contribution will be accepted, ask beforehand. You can email the author or start an issue on the tracker.

  • Contribute ideas. Even if you can't code Emacs Lisp, you can still contribute valuable ideas for other programmers to implement. Simply start new issue on the tracker and submit your suggestion.

  • You can make a financial donation through PayPal or Patreon. If you like smartparens and can spare a modest amount on a donation, feel free to do so. These donations are expressions of your gratitude and are used for my personal "rewards" (books, games, music etc.). You can also gift me a game on Steam or buy something on Amazon. Regardless of the donations, smartparens will always be free both as in beer and as in speech.

Related Projects

Other Emacs projects that deal with pairs include:

Smartparens aims to provide a superset of these features, in all programming languages.

More Repositories

1

dired-hacks

Collection of useful dired additions
Emacs Lisp
782
star
2

litable

On-the-fly evaluation/substitution of emacs lisp code
Emacs Lisp
317
star
3

clippy.el

Show tooltip with function documentation at point
Emacs Lisp
203
star
4

org-timeline

Add graphical view of agenda to agenda buffer
Emacs Lisp
160
star
5

free-keys

Show free keybindings for modkeys or prefixes
Emacs Lisp
108
star
6

org-pretty-table

Replace org-table characters with box-drawing unicode glyphs.
Emacs Lisp
94
star
7

org-clock-budget

Budget your time with org!
Emacs Lisp
69
star
8

.emacs.d

My emacs config
Emacs Lisp
63
star
9

emacs-cats

Functors, Monads, Categories for Emacs
Emacs Lisp
52
star
10

orgba

Better APIs for org mode
Emacs Lisp
48
star
11

justify-kp

Paragraph justification for emacs using Knuth/Plass algorithm
Emacs Lisp
46
star
12

flow-js2-mode

[UNMAINTAINED] Support for flow for js2-mode
Emacs Lisp
46
star
13

indicators.el

Display the buffer relative location of line in the fringe.
Emacs Lisp
37
star
14

fontify-face

Fontify symbols representing faces with that face.
Emacs Lisp
37
star
15

org-radiobutton

[SEMI-DEPRECATED] Radiobutton for org-mode lists.
Emacs Lisp
31
star
16

emacs-lgr

A fully featured logging framework for Emacs
Emacs Lisp
20
star
17

sphinx-mode

Minor mode providing sphinx support.
Emacs Lisp
19
star
18

eshell-bookmark

Eshell and bookmark.el integration
Emacs Lisp
19
star
19

sallet

A type of light spherical helmet
Emacs Lisp
18
star
20

achievements-mode

Achievements for emacs!
Emacs Lisp
16
star
21

blablabla

A follower to litable
Emacs Lisp
15
star
22

sql-workbench

SQL client for Emacs
Emacs Lisp
13
star
23

elisp-docstring-mode

Major mode for editing elisp docstrings
Emacs Lisp
12
star
24

autobookmarks

Automatic bookmarks
Emacs Lisp
12
star
25

find-local-executable

Find locally installed executables by npm, composer, gem, pip, stack, ...
Emacs Lisp
12
star
26

elwm

Lightweight window manager for emacs
Emacs Lisp
11
star
27

better-jump

Better ace-jump-mode
Emacs Lisp
11
star
28

banana.el

Monads for elisp
Emacs Lisp
10
star
29

org-inline-image

Image inliner for org.
Emacs Lisp
9
star
30

xmonad-config

XMonad config powered by stack & cabal
Haskell
9
star
31

ETable

An implementation of JTable for emacs.
Emacs Lisp
8
star
32

Fuco1.github.io

https://fuco1.github.io/
CSS
8
star
33

dotfiles

Dotfiles
Shell
7
star
34

compile-eslint

compilation-error-regexp-alist rules for eslint
Emacs Lisp
7
star
35

php-refactor

Php refactoring for emacs
PHP
5
star
36

yafmp

Yet another fuzzy matching program
C
5
star
37

org-velocity

Fork of org-velocity from org-contrib
Emacs Lisp
5
star
38

org-node-graph

Emacs Lisp
5
star
39

tridactyl-mode

Major mode for tridactyl configuration file
Emacs Lisp
4
star
40

flash-region

Flash a region
Emacs Lisp
4
star
41

mpris

Haskell interface for MPRIS protocol.
Haskell
4
star
42

org-mode

org-mode fork
Emacs Lisp
4
star
43

zathura-build

zathura + plugins built and run inside docker
Shell
3
star
44

find-test

Simple package for jumping between implementations and tests.
Emacs Lisp
3
star
45

wiktionary-translate

Translate words using wiktionary
Emacs Lisp
3
star
46

nave-mode

not-a-vim-emulation-mode for emacs
3
star
47

keyadvice.el

Advice keybindings to run additional user defined code (see also advice.el)
Emacs Lisp
3
star
48

org-cookbook

Manage your recipes with org!
Emacs Lisp
3
star
49

docker-tunnel

Passwordless-root-login box running sshd - ideal for bridging connections into docker networks.
2
star
50

whitaker

Comint client for Whitaker's words
Emacs Lisp
2
star
51

orgpath

An xpath for org!
Emacs Lisp
2
star
52

petulant-dangerzone

Emacs Lisp
2
star
53

monadic-parser

Monadic parser for elisp
Emacs Lisp
2
star
54

ob-php

Fork of https://framagit.org/steckerhalter/ob-php.git
Emacs Lisp
2
star
55

xmonitor

Simple utility to run scripts when monitors attach or detach
C
2
star
56

pulsemixer

alsamixer clone for pulseaudio
Haskell
2
star
57

mql-mode

Major mode for MetaTrader 4.
Emacs Lisp
2
star
58

workman-layout

The Workman Keyboard Layout ( http://www.workmanlayout.com ) for emacs
Emacs Lisp
2
star
59

interval-tree

Interval tree implementation in emacs lisp
Emacs Lisp
1
star
60

b.el

Collection of useful functions operating on buffers
Emacs Lisp
1
star
61

neon-mode

Simple major mode for editing neon files
Emacs Lisp
1
star
62

borg-build

Borg backup inside docker
Shell
1
star
63

sudoku-cpp

Efficient propagating sudoku solver
C++
1
star
64

conkeror

JavaScript
1
star
65

dollar-if

Anaphoric if macro
Emacs Lisp
1
star
66

letcheck

Minor mode to check let forms in emacs for erroneous assignments
Emacs Lisp
1
star
67

puppet-ws

Personal workstation configuration with puppet
Puppet
1
star
68

json-log-mode

Filter and transform streams of json objects
Emacs Lisp
1
star
69

stocklist

Track stocks with Emacs!
Emacs Lisp
1
star
70

gallery

Simple php gallery
PHP
1
star
71

diakritika

Apply diacritics to slovak text.
Emacs Lisp
1
star
72

prognth

Return value of nth form.
Emacs Lisp
1
star
73

slovak-holidays

Adds a list of slovak holidays to Emacs calendar
Emacs Lisp
1
star