Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

Fuco1/smartparens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Join the chat at https://gitter.im/smartparens/LobbyMELPADocumentation StatusMELPA StableDocumentation StatusBuild StatusCoverage StatusPaypal logoPatreon

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 25 and newer, however,everything should work mostly fine on anything newer than version 24.

You can install smartparens fromMELPA. Onceinstalled, enable thedefault configuration:

(require'smartparens-config)

You can now use smartparens withM-x smartparens-mode. Toautomatically enable smartparens in a programming mode:

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

You may want to trysmartparens-strict-mode. This enforces thatpairs are always balanced, so commands likekill-line keep your codewell-formed.

You can also useuse-package to install and setupsmartparens. An example config is:

(use-package smartparens:ensure smartparens;; install the package:hook (prog-mode text-mode markdown-mode);; add `smartparens-mode` to these hooks:config;; load default config  (require'smartparens-config))

Usage

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

There's also agreat article demonstrating movement and editing in smartparensandextensive documentation in the wiki.

Contributing

We love pull requests. Please include tests. Smartparens usesert-runner for testing. Torun all the tests, run:

$ cask exec ert-runner

Alternatively, you can open the individual files in Emacs, thenM-x eval-bufferM-x ert.

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

Language Support

Smartparens has a default configuration that works well for mostlanguages. For language-specific behaviour, smartparens has a separatesmartparens-FOO.el file for every language andsmartparens-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 andwill benefit this project, feel free to implement it and submit apull request. If you have any concerns whether your contributionwill be accepted, ask beforehand. You can email the author orstart an issue onthe tracker.

  • Contribute ideas. Even if you can't code Emacs Lisp, you can stillcontribute valuable ideas for other programmers to implement. Simplystart new issueon the tracker and submit your suggestion.

  • You can make a financial donation throughPayPalorPatreon. If youlike smartparens and can spare a modest amount on a donation, feelfree to do so. These donations are expressions of your gratitudeand are used for my personal "rewards" (books, games, music etc.).You can also gift me a game onSteamor buy something onAmazon.Regardless of the donations, smartparens will always be free both asin 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 allprogramming languages.


[8]ページ先頭

©2009-2025 Movatter.jp