yasnippet-snippets/README.md

57 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2015-02-24 17:17:26 +01:00
# Yasnippet official snippet collections
2015-05-01 22:33:36 +02:00
[![MELPA Stable](https://stable.melpa.org/packages/yasnippet-snippets-badge.svg)](https://stable.melpa.org/#/yasnippet-snippets)
2017-08-14 10:48:55 +02:00
[![MELPA](https://melpa.org/packages/yasnippet-snippets-badge.svg)](https://melpa.org/#/yasnippet-snippets)
2015-05-01 22:33:36 +02:00
[![Join the chat at https://gitter.im/AndreaCrotti/yasnippet-snippets](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AndreaCrotti/yasnippet-snippets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2017-08-15 16:51:01 +02:00
2017-08-14 10:48:30 +02:00
This repository contains the official collection of snippets for [yasnippet](http://github.com/capitaomorte/yasnippet).
2013-11-29 14:41:28 +01:00
2019-03-09 10:49:37 +01:00
You can see [here](http://andreacrotti.github.io/yasnippet-snippets/snippets.html) a big HTML page with all the available snippets grouped by mode.
2019-03-09 10:48:18 +01:00
2015-02-24 17:17:26 +01:00
# How to install
2013-11-29 14:41:28 +01:00
2017-08-14 10:48:30 +02:00
## From melpa
2017-08-20 12:41:46 +02:00
You can install this package from melpa, by first ensuring that you have the melpa source in your package-archives.
2017-08-14 10:48:30 +02:00
```lisp
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
```
2015-02-24 17:17:26 +01:00
2017-08-20 12:41:46 +02:00
Once that is done, then just refresh the packages and install it with.
2017-08-14 10:48:30 +02:00
* <kbd>M-x package-refresh-contents</kbd>
* <kbd>M-x package-install yasnippet-snippets</kbd>
2017-08-20 12:41:46 +02:00
Now all the snippets will load automatically, as soon as yasnippet loads.
2015-02-24 17:17:26 +01:00
## On Debian ≥10 and derivatives such as Ubuntu ≥ 18.10
`sudo apt install elpa-yasnippet-snippets`
2013-11-29 14:41:28 +01:00
# Contributing
2017-08-20 12:41:46 +02:00
If you have any useful snippets for any language or framework, then please feel free to contribute, by opening a PR or an issue if you have any suggestions.
2013-11-29 14:41:28 +01:00
2017-08-20 12:41:46 +02:00
To study the current snippets, I suggest that you use `M-x yas-describe-tables`,
which will show a table representation of all the snippets that are available in the current mode.
2013-11-29 14:41:28 +01:00
# Guidelines
Snippets need to be generic enough to be useful for everyone, and not contain anything specific to your own system.
# Various notes
## HTML snippets
2017-08-20 12:41:46 +02:00
Until September 1st 2014 there were a lot of HTML snippets in the repository, which sometimes were useful, but I came to the conclusion that yasnippet was not the right tool for them, so they were removed in this pull request:
https://github.com/AndreaCrotti/yasnippet-snippets/pull/49
To everyone writing a lot of HTML I suggest using [emmet mode](https://github.com/smihica/emmet-mode) instead, which is a much more powerful mode for writing HTML tags.