From 8024cfcecdc4bf8ad601d5eae9f7ca52426579a4 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Thu, 8 Aug 2013 11:24:27 +0200 Subject: [PATCH] while -> wh, see #230 and README.md --- README.md | 3 ++- UltiSnips/ocaml.snippets | 2 +- UltiSnips/perl.snippets | 2 +- UltiSnips/ruby.snippets | 2 +- UltiSnips/sh.snippets | 2 +- UltiSnips/tcl.snippets | 2 +- snippets/actionscript.snippets | 2 +- snippets/autoit.snippets | 2 +- snippets/falcon.snippets | 2 +- snippets/htmltornado.snippets | 2 +- snippets/processing.snippets | 2 +- snippets/ruby.snippets | 2 +- snippets/scala.snippets | 2 +- 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 35eac1b..6d3e41d 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ if : if without else ife: if $1 else $2 eif : else if ($1) { .. } el : else .. +wh : while (cond) ... ``` If you're not satisfied with these defaults, open a ticket that we implement @@ -89,7 +90,7 @@ Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks Open questions: What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ? -What about wh(ile), which trigger? +Which additional policies to add? Discuss at: https://github.com/honza/vim-snippets/issues/230 diff --git a/UltiSnips/ocaml.snippets b/UltiSnips/ocaml.snippets index 14926c8..157eb91 100644 --- a/UltiSnips/ocaml.snippets +++ b/UltiSnips/ocaml.snippets @@ -59,7 +59,7 @@ if ${1} then ${2} endsnippet -snippet while "while" +snippet wh "while" while ${1} do ${2} done diff --git a/UltiSnips/perl.snippets b/UltiSnips/perl.snippets index 6a9e8f9..e183b11 100644 --- a/UltiSnips/perl.snippets +++ b/UltiSnips/perl.snippets @@ -117,7 +117,7 @@ unless ($1) { endsnippet -snippet while "while" +snippet wh "while" while ($1) { ${2:# body...} } diff --git a/UltiSnips/ruby.snippets b/UltiSnips/ruby.snippets index 0b6836c..90001b1 100644 --- a/UltiSnips/ruby.snippets +++ b/UltiSnips/ruby.snippets @@ -455,7 +455,7 @@ endsnippet -snippet while "while ... end" +snippet wh "while ... end" while ${1:expression} ${0} end diff --git a/UltiSnips/sh.snippets b/UltiSnips/sh.snippets index 915c0df..cce06ef 100644 --- a/UltiSnips/sh.snippets +++ b/UltiSnips/sh.snippets @@ -79,7 +79,7 @@ until ${2:[[ ${1:condition} ]]}; do done endsnippet -snippet while "while ... (done)" +snippet wh "while ... (done)" while ${2:[[ ${1:condition} ]]}; do ${0:#statements} done diff --git a/UltiSnips/tcl.snippets b/UltiSnips/tcl.snippets index c5ae37b..fd53d26 100644 --- a/UltiSnips/tcl.snippets +++ b/UltiSnips/tcl.snippets @@ -40,7 +40,7 @@ switch ${1:-exact} -- ${2:\$var} { endsnippet -snippet while "while... (while)" b +snippet wh "while... (while)" b while {${1}} { ${2} } diff --git a/snippets/actionscript.snippets b/snippets/actionscript.snippets index 5385d11..1aeca1c 100644 --- a/snippets/actionscript.snippets +++ b/snippets/actionscript.snippets @@ -75,7 +75,7 @@ snippet do do { ${2} } while (${1:cond}) -snippet while +snippet wh while ${1:cond}{ ${2} } diff --git a/snippets/autoit.snippets b/snippets/autoit.snippets index c266e33..b214fd2 100644 --- a/snippets/autoit.snippets +++ b/snippets/autoit.snippets @@ -41,7 +41,7 @@ snippet select {$4:; Else code} EndSelect # While loop -snippet while +snippet wh While (${1:condition}) ${2:; code...} WEnd diff --git a/snippets/falcon.snippets b/snippets/falcon.snippets index 78257b6..50c3694 100644 --- a/snippets/falcon.snippets +++ b/snippets/falcon.snippets @@ -65,7 +65,7 @@ snippet forto end # While Loop -snippet while +snippet wh while ${1:conidition} ${2} end diff --git a/snippets/htmltornado.snippets b/snippets/htmltornado.snippets index e80499c..c52f0e8 100644 --- a/snippets/htmltornado.snippets +++ b/snippets/htmltornado.snippets @@ -49,7 +49,7 @@ snippet try {% finallly %} ${3} {% end %} -snippet while +snippet wh {% while ${1:condition} %} ${2} {% end %} diff --git a/snippets/processing.snippets b/snippets/processing.snippets index 27f3e00..2aec1b1 100755 --- a/snippets/processing.snippets +++ b/snippets/processing.snippets @@ -63,7 +63,7 @@ snippet for ${4:$1[$2]} }; #loop while -snippet while +snippet wh while (${1:/* condition */}) { ${2} } diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 0135882..06a7820 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -75,7 +75,7 @@ snippet unless unless ${1:condition} ${2} end -snippet while +snippet wh while ${1:condition} ${2} end diff --git a/snippets/scala.snippets b/snippets/scala.snippets index e3999f8..1cbd368 100644 --- a/snippets/scala.snippets +++ b/snippets/scala.snippets @@ -33,7 +33,7 @@ snippet eif ${4} } #while loop -snippet while +snippet wh while (${1:obj}) { ${2} }