|
1 | 1 | # Yasnippet official snippet collections
|
2 | 2 |
|
3 | 3 | [](https://gitter.im/AndreaCrotti/yasnippet-snippets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4 |
| -This repository contains the official snippets for [yasnippet](http://github.com/capitaomorte/yasnippet), as you can see from the git submodules link. |
| 4 | +This repository contains the official collection of snippets for [yasnippet](http://github.com/capitaomorte/yasnippet). |
5 | 5 |
|
6 | 6 | # How to install
|
7 | 7 |
|
8 |
| -There are two options, if you have checked out *yasnippet* already, the only thing you need to do is to run `git submodule update --init` |
9 |
| -and it will checkout automatically this repository, at the last version it was synchronized too. |
| 8 | +## From melpa |
10 | 9 |
|
11 |
| -Otherwise if you want the latest and greatest snippets collection proceed as follows: |
| 10 | +You can install this package from melpa, first by ensuring you have it source of your pacages. |
12 | 11 |
|
13 |
| -1. clone this repository |
14 |
| -2. add to your .emacs the following |
15 |
| - - `(add-to-list 'yas-snippet-dirs "$$DIRECTORY_WHERE_YOU_CLONED")` |
16 |
| - - and in case you want to enable yasnippet globally: `(yas-global-mode t)` |
| 12 | +```lisp |
| 13 | +(require 'package) |
| 14 | +(add-to-list 'package-archives |
| 15 | + '("melpa" . "http://melpa.milkbox.net/packages/") t) |
| 16 | +(package-initialize) |
| 17 | +``` |
17 | 18 |
|
18 |
| -3. `M-x yas-reload-all` to activate them |
| 19 | +Once that is done just refresh the packages andd install with. |
| 20 | + |
| 21 | +* <kbd>M-x package-refresh-contents</kbd> |
| 22 | +* <kbd>M-x package-install yasnippet-snippets</kbd> |
| 23 | + |
| 24 | +Once that is done all the snippets will load automatically as soon as yasnippet loads. |
19 | 25 |
|
20 | 26 | # Contributing
|
21 | 27 |
|
22 |
| -This repository has now become the default snippets repository (as a submodule) in yasnippet. |
23 |
| -So if you have any useful snippets for any language or framework please feel free to contribute. |
| 28 | +So if you have any useful snippets for any language or framework please feel free to contribute, by opening a PR or an issue if you have any suggestions. |
24 | 29 |
|
25 | 30 | To study the current snippets I suggest to use `M-x yas-describe-tables`
|
26 | 31 | which will gave a table representation of all the snippets available in the current mode.
|
|
0 commit comments