Add hy-mode snippets

This commit is contained in:
Kevin van Rooijen 2018-08-25 18:56:04 +02:00
parent 48e9f3c182
commit a509a8c667
15 changed files with 105 additions and 0 deletions

8
snippets/hy-mode/class Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name:class
# key:class
# binding: direct-keybinding
# --
(defclass ${1:ClassName} [${2:BaseClass}]
${3: (defn --init-- [${4:arg}]
(setv $0))})

9
snippets/hy-mode/cond Normal file
View File

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name:cond
# key:cond
# binding: direct-keybinding
# --
(cond
[${1:condition} ${result:2}]
[${3:condition} ${result:4}]
${5:[True $6]})

7
snippets/hy-mode/def Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: def
# key: def
# binding: direct-keybinding
# --
(defn ${1:function-name} [${2:arg}]
$0)

7
snippets/hy-mode/defm Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name:defm
# key:defm
# binding: direct-keybinding
# --
(defmacro ${1:macro-name} [${2:arg}]
${3:`($0)})

6
snippets/hy-mode/do Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name:do
# key:do
# binding: direct-keybinding
# --
(do $0)

6
snippets/hy-mode/for Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: for
# key: for
# binding: direct-keybinding
# --
(for [${1:item items}] $0)

8
snippets/hy-mode/if Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name:if
# key:if
# binding: direct-keybinding
# --
(if ${1:condition}
${2:result-true}
${3:result-false})

8
snippets/hy-mode/ifn Normal file
View File

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name:ifn
# key:ifn
# binding: direct-keybinding
# --
(if-not ${1:condition}
${2:result-false}
${3:result-true})

6
snippets/hy-mode/imp Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name:import
# key:import
# binding: direct-keybinding
# --
(import [${1:module-name} [${2:exposing}]])

7
snippets/hy-mode/let Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: let
# key: let
# binding: direct-keybinding
# --
(let [${1:arg}]
$0)

7
snippets/hy-mode/main Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name:main
# key:main
# binding: direct-keybinding
# --
(defmain [&rest ${1:args}]
$0)

6
snippets/hy-mode/req Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name:req
# key:req
# binding: direct-keybinding
# --
(req [${1:module-name} [${2:exposing}]])

6
snippets/hy-mode/s Normal file
View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: s
# key: s
# binding: direct-keybinding
# --
(setv $0)

7
snippets/hy-mode/unless Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name:unless
# key:unless
# binding: direct-keybinding
# --
(unless ${1:condition}
$0)

7
snippets/hy-mode/when Normal file
View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name:when
# key:when
# binding: direct-keybinding
# --
(when ${1:condition}
$0)