1
0
Fork 0
mirror of synced 2024-11-26 18:55:34 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/clojure.snippets

88 lines
1.8 KiB
Text
Raw Normal View History

2012-08-16 23:41:25 -04:00
snippet comm
(comment
2015-01-18 07:58:28 -05:00
${0})
2012-08-16 23:41:25 -04:00
snippet condp
(condp ${1:pred} ${2:expr}
2015-01-18 07:58:28 -05:00
${0})
2012-08-16 23:41:25 -04:00
snippet def
(def ${0})
2012-08-16 23:41:25 -04:00
snippet defm
(defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet defmm
(defmulti ${1:name} "${2:doc-string}" ${0:dispatch-fn})
2012-08-16 23:41:25 -04:00
snippet defma
(defmacro ${1:name} "${2:doc-string}" ${0:dispatch-fn})
2012-08-16 23:41:25 -04:00
snippet defn
(defn ${1:name} "${2:doc-string}" [${3:arg-list}]
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet defp
(defprotocol ${1:name}
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet defr
(defrecord ${1:name} [${2:fields}]
2015-01-18 07:58:28 -05:00
${3:protocol}
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet deft
(deftest ${1:name}
2015-01-18 07:58:28 -05:00
(is (= ${0:assertion})))
2012-08-16 23:41:25 -04:00
snippet is
(is (= ${1} ${0}))
2012-08-16 23:41:25 -04:00
snippet defty
(deftype ${1:Name} [${2:fields}]
2015-01-18 07:58:28 -05:00
${3:Protocol}
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet doseq
(doseq [${1:elem} ${2:coll}]
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet fn
2020-12-04 16:15:32 -05:00
(fn [${1:arg-list}] ${0:code})
2012-08-16 23:41:25 -04:00
snippet if
(if ${1:test-expr}
2015-01-18 07:58:28 -05:00
${2:then-expr}
${0:else-expr})
2013-07-17 19:06:05 -04:00
snippet if-let
2012-08-16 23:41:25 -04:00
(if-let [${1:result} ${2:test-expr}]
(${3:then-expr} $1)
(${0:else-expr}))
2012-08-16 23:41:25 -04:00
snippet imp
(:import [${1:package}])
2015-01-18 07:58:28 -05:00
& {:keys [${1:keys}] :or {${0:defaults}}}
2012-08-16 23:41:25 -04:00
snippet let
(let [${1:name} ${2:expr}]
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet letfn
2015-01-18 07:58:28 -05:00
(letfn [(${1:name}) [${2:args}]
2020-12-04 16:15:32 -05:00
${0:code})])
2012-08-16 23:41:25 -04:00
snippet map
(map ${1:func} ${0:coll})
2012-08-16 23:41:25 -04:00
snippet mapl
(map #(${1:lambda}) ${0:coll})
2012-08-16 23:41:25 -04:00
snippet met
(${1:name} [${2:this} ${3:args}]
2020-12-04 16:15:32 -05:00
${0:code})
2012-08-16 23:41:25 -04:00
snippet ns
2015-01-18 07:58:28 -05:00
(ns ${0:name})
2012-08-16 23:41:25 -04:00
snippet dotimes
(dotimes [_ 10]
2015-01-18 07:58:28 -05:00
(time
(dotimes [_ ${1:times}]
2020-12-04 16:15:32 -05:00
${0:code})))
2012-08-16 23:41:25 -04:00
snippet pmethod
(${1:name} [${2:this} ${0:args}])
2012-08-16 23:41:25 -04:00
snippet refer
(:refer-clojure :exclude [${0}])
2012-08-16 23:41:25 -04:00
snippet require
(:require [${1:namespace} :as [${0}]])
2012-08-16 23:41:25 -04:00
snippet use
(:use [${1:namespace} :only [${0}]])
2012-08-16 23:41:25 -04:00
snippet print
(println ${0})
2012-08-16 23:41:25 -04:00
snippet reduce
(reduce ${1:(fn [p n] ${3})} ${2})
snippet when
(when ${1:test} ${0:body})
2012-08-16 23:41:25 -04:00
snippet when-let
(when-let [${1:result} ${2:test}]
${0:body})