1
0
Fork 0
mirror of synced 2024-12-23 07:20:42 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/racket.snippets

132 lines
1.8 KiB
Text
Raw Normal View History

2020-05-10 10:24:38 -04:00
# Languages
2018-09-24 20:40:17 -04:00
snippet #r
#lang racket
snippet #tr
#lang typed/racket
snippet #rg
#lang racket/gui
snippet #sb
#lang scribble/base
snippet #d
#lang datalog
snippet #wi
#lang web-server/insta
2020-05-10 10:24:38 -04:00
# Defines
2018-09-24 20:40:17 -04:00
snippet def
(define ${1} ${0})
snippet defun
(define (${1})
${0})
2020-05-10 10:24:38 -04:00
snippet defv "define-values"
(define-values (${1}) (${0}))
snippet defm "define/match"
(define/match (${1})
[(${2}) ${3}]
${0})
snippet defs "define-syntax"
(define-syntax (${1})
${0})
# Conditionals
2018-09-24 20:40:17 -04:00
snippet if
(if ${1} ${2} ${0})
snippet ifn
2020-05-10 10:24:38 -04:00
(if (not ${1}) ${2} ${0})
2018-09-24 20:40:17 -04:00
snippet ifl
(if ${1}
2020-05-10 10:24:38 -04:00
(let (${2})
${3})
2018-09-24 20:40:17 -04:00
${0})
snippet ifnl
(if (not ${1})
2020-05-10 10:24:38 -04:00
(let (${2})
${3})
${0})
snippet ifb
(if ${1}
(begin
${2})
${0})
snippet ifnb
(if (not ${1})
(begin
2018-09-24 20:40:17 -04:00
${2})
${0})
snippet when
(when ${1}
${0})
2020-05-10 10:24:38 -04:00
snippet unless
(unless ${1} ${2} ${0})
2018-09-24 20:40:17 -04:00
snippet cond
(cond
2020-05-10 10:24:38 -04:00
[(${1}) ${0}])
snippet conde
(cond
[(${1}) ${2}]
[else ${0}])
2018-09-24 20:40:17 -04:00
snippet case
(case ${1}
2020-05-10 10:24:38 -04:00
[(${2}) ${0}])
2018-09-24 20:40:17 -04:00
snippet match
(match ${1}
2020-05-10 10:24:38 -04:00
[(${2}) ${0}])
# For iterations
2018-09-24 20:40:17 -04:00
snippet for
2020-05-10 10:24:38 -04:00
(for ([${1}])
${0})
snippet forl "for/list"
(for/list ([${1}])
${0})
snippet forf "for/fold"
(for/fold
([${1}])
([${2}])
${0})
snippet forfr "for/foldr"
(for/foldr
([${1}])
([${2}])
${0})
snippet fora "for/and"
(for/and ([${1}])
${0})
snippet foro "for/or"
(for/or ([${1}])
2018-09-24 20:40:17 -04:00
${0})
2020-05-10 10:24:38 -04:00
snippet fors "for/sum"
(for/sum ([${1}])
${0})
snippet forp "for/product"
(for/product ([${1}])
${0})
snippet forfi "for/first"
(for/first ([${1}])
${0})
snippet forla "for/last"
(for/last ([${1}])
${0})
snippet lambda
(lambda (${1}) ${0})
snippet apply
(apply ${1} ${0})
snippet map
(map ${1} ${0})
snippet filter
(filter ${1} ${0})
2018-09-24 20:40:17 -04:00
snippet req
(require ${0})
2020-05-10 10:24:38 -04:00
snippet prov
(provide ${0})
2018-09-24 20:40:17 -04:00
snippet let
(let ([${1}]) ${0})
2020-05-10 10:24:38 -04:00
snippet letcc
(let/cc here (set! ${1} here) ${0})
2018-09-24 20:40:17 -04:00
snippet begin
(begin
${0})