From 8f7419c9d00b180c88a4a37f084ba550c40b83c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B8rn=20Vatn?= Date: Wed, 16 May 2012 12:49:23 +0200 Subject: [PATCH] First go at adding clojure support --- snippets/clojure.snippets | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 snippets/clojure.snippets diff --git a/snippets/clojure.snippets b/snippets/clojure.snippets new file mode 100644 index 0000000..f476168 --- /dev/null +++ b/snippets/clojure.snippets @@ -0,0 +1,74 @@ +snippet comm + (comment + ${1} + ) +snippet condp + (condp ${1:pred} ${2:expr} + ${3}) +snippet def + (def ${1}) +snippet defm + (defmethod ${1:name} ${2:match} [${3:args}] + ${4}) +snippet defmm + (defmulti ${1:name} ${2:dispatch-fn}) +snippet defn + (defn ${1:name} ${2:"${3:doc-string}"}[${4:arg-list}] + ${5}) +snippet defp + (defprotocol ${1:name} + ${2}) +snippet defr + (defrecord ${1:name} [${2:fields}] + ${3:protocol} + ${4}) +snippet deft + (deftest ${1:name} + (is (= ${2:assertion}))) + ${3}) +snippet is + (is (= ${1} ${2})) +snippet defty + (deftype ${1:Name} [${2:fields}] + ${3:Protocol} + ${4}) +snippet doseq + (doseq [${1:elem} ${2:coll}] + ${3}) +snippet fn + (fn [${1:arg-list}] ${2}) +snippet if + (if ${1:test-expr} + ${2:then-expr} + ${3:else-expr}) +snippet imp + (:import [${1:package}]) + & {:keys [${1:keys}] :or {${2:defaults}}} +snippet let + (let [${1}]) +snippet letfn + (letfn [(${1:name) [${2:args}] + ${3})]) +snippet map + (map ${1:func} ${2:coll}) +snippet mapl + (map #(${1:lambda}) ${2:coll}) +snippet met + (${1:name} [${2:this} ${3:args}] + ${4}) +snippet ns + (ns ${1:name} + ${2}) +snippet dotimes + (dotimes [_ 10] + (time + (dotimes [_ ${1:times}] + ${2}))) +snippet pmethod + (${1:name} [${2:this} ${3:args}]) +snippet refer + (:refer-clojure :exclude [${1}]) +snippet req + (:require [${1:namespace} :as [${2}]]) +snippet use + (:use [${1:namespace} :only [${2}]])