diff --git a/README.md b/README.md index 849d066..ef76ded 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,12 @@ get vim-dev plugin which has function completion 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? +Discuss at: https://github.com/honza/vim-snippets/issues/230 + + Related repositories ==================== We also encourage people to maintain sets of snippets for particular use cases diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 9813c8e..7744857 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -164,6 +164,8 @@ snippet atp attr_protected :${1:attr_names} snippet ata attr_accessible :${1:attr_names} + +# ivc == instance variable cache snippet ivc @${1:variable_name} ||= ${2:chached_value} # include Enumerable diff --git a/snippets/vim.snippets b/snippets/vim.snippets index 98cb51e..a92cd13 100644 --- a/snippets/vim.snippets +++ b/snippets/vim.snippets @@ -23,9 +23,9 @@ snippet for ${3} endfor snippet forkv - for [a,b] in items({2}) - ${3} - unlet a b + for [${1},${2}] in items(${3}) + ${4} + unlet $1 $2 endfor snippet wh