common-lisp-snippets

https://github.com/mrkkrp/common-lisp-snippets.git

git clone 'git://github.com/mrkkrp/common-lisp-snippets.git'
8

Yasnippets for Common Lisp

License GPL 3 MELPA

This is a collection of Yasnippets for Common Lisp. It mainly includes snippets for top-level forms and (as a bonus) headers for popular free-software licenses: GNU GPL and MIT License.

Installation

To use these snippets you need to install Yasnippet package. Once you have Yasnippet installed, place contents of this repository on your load path, so Emacs can see it and add the following to your configuration file:

(require 'common-lisp-snippets)

It's now available via MELPA: M-x package-install RET common-lisp-snippets RET — and you are done!

Usage

To insert a snippet, type its name and press ↹ Tab or C-i, for example:

defsystem
⇒
(asdf:defsystem :system-name
  :version      "0.1.0"
  :description  "description"
  :author       "user-full-name <user-mail-address>"
  :serial       t
  :license      "GNU GPL, version 3"
  :components   ((:file "file.lisp"))
  :depends-on   (#:alexandria))

…you can move through the fields pressing ↹ Tab and edit or delete them, some fields, like :author try to guess their values. Also, snippets are especially useful when learning some language ;-)

As a special bonus, there are snippets to insert headers of files that contain information about the software license (gnugpl and mitlic), they are smart too.

Contributions

Yes, please contribute! There are some stylistic conventions:

  1. Name files without any extensions;

  2. Start every file with this preamble:

# -*- mode: snippet -*- # contributor: your name # name: readable name of the snippet # key: what user needs to enter # --

The first line is needed to activate mode for snippet editing in Emacs, Yasnippet ships with it.

  1. Make sure your files don't have empty line at the end. This is important, because it will be inserted too when your snippet is expanded. snippet-mode takes care of this, setting require-finall-newline to nil, just make sure you haven't put it there manually.

License

Copyright © 2015 Mark Karpov

Distributed under GNU GPL, version 3.