Skip to content

Commit f72814a

Browse files
committed
Improve clojure snippets.
1 parent fe0cbc1 commit f72814a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

neosnippets/clojure.snip

+13-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ options head
5555

5656
snippet use-strint-in-ns
5757
options head
58-
(:use [clojure.core.strint :only (<<)])
58+
(:require [clojure.core.strint :refer (<<)])
5959

6060
snippet dir-glob
6161
options head
@@ -73,18 +73,26 @@ options head
7373
:url "https://github.com/${2}"
7474
:license {:name "GNU GPL v3+"
7575
:url "http://www.gnu.org/licenses/gpl-3.0.en.html"}
76-
:dependencies [[org.clojure/clojure "1.6.0"]]
76+
:dependencies [[org.clojure/clojure "1.7.0"]]
7777
:main ^:skip-aot ${3:aaa.core}
7878
:target-path "target/%s"
7979
:min-lein-version "2.3.0")
8080

8181
snippet ns
8282
options head
83-
(ns ${1:`expand('%:p:h:t')`.`expand('%:p:t:r')`}
84-
(:use [clojure.pprint :only [pprint]])
85-
(:require [${2:clojure.string} :as ${3:s}]))
83+
(ns ${1:`substitute(substitute(substitute(expand('%:p:r'), '.*/\(src\|test\)/', '', ''), '/', '.', 'g'), '_', '-', 'g')`}
84+
(:require [${2:clojure.string} :as ${3:s}]
85+
[clojure.pprint :refer [pprint]]))
8686

8787
snippet bench
8888
(let [bench-before (System/currentTimeMillis)]
8989
${1:TARGET}
9090
(prn 'Took (- (System/currentTimeMillis) bench-before) 'msec))
91+
92+
snippet private
93+
options word
94+
@#'
95+
96+
snippet java-methods
97+
options head
98+
(:members (clojure.reflect/refrect ${1}))

0 commit comments

Comments
 (0)