This commit is contained in:
Austen Adler 2016-10-01 15:50:47 -04:00
commit 007bb6d30e
No known key found for this signature in database
GPG Key ID: 7ECEE590CCDFE3F1
10 changed files with 133 additions and 3 deletions

View File

@ -73,4 +73,27 @@ snippet modeline "Vim modeline"
vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'`
endsnippet
#########
# DATES #
#########
snippet date "YYYY-MM-DD" w
`date +%Y-%m-%d`
endsnippet
snippet ddate "Month DD, YYYY" w
`date +%B\ %d,\ %Y`
endsnippet
snippet diso "ISO format datetime" w
`date +%Y-%m-%dT%H:%M:%S%:z`
endsnippet
snippet time "hh:mm" w
`date +%H:%M`
endsnippet
snippet datetime "YYYY-MM-DD hh:mm" w
`date +%Y-%m-%d\ %H:%M`
endsnippet
# vim:ft=snippets:

View File

@ -239,6 +239,18 @@ snippet script "XHTML <script>" w
</script>
endsnippet
snippet span "<span>" w
<span> ${0:${VISUAL}} </span>
endsnippet
snippet span. "<span> with class" w
<span`!p snip.rv=' class="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`> ${0:${VISUAL}} </span>
endsnippet
snippet span# "<span> with ID & class" w
<span`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`> ${0:${VISUAL}} </span>
endsnippet
snippet style "XHTML <style>" w
<style type="text/css" media="screen">
${0:${VISUAL}}

View File

@ -46,7 +46,7 @@ for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
}
endsnippet
snippet fun "function (fun)"
snippet fun "function (fun)" w
function ${1:function_name}(${2:argument}) {
${VISUAL}$0
}

View File

@ -48,6 +48,21 @@ snippet fori
for ${1:item} <- ${2:items}, into: ${3} do
${0}
end
snippet wi
with(
${1:item} <- ${2:items}
) do
${0}
end
snippet wie
with(
${1:item} <- ${2:items}
) do
${3}
else
${4} ->
${0}
end
snippet df
def ${1:name}, do: ${2}
snippet def

View File

@ -1,6 +1,7 @@
# .erb and .rhmtl files
# Includes html.snippets
extends html
# Rails *****************************
snippet rc

View File

@ -0,0 +1,52 @@
# Snippet for bemjson. https://en.bem.info/platform/bemjson/
# Blocks
snippet b
{
block : '${1:name}',
content : [
'${2:content}'
]
}
# btc - BEM block with text content
snippet btc
{
block : '${1:name}',
content: '${2:content}'
}
# bwm - BEM block with modifier.
snippet bwm
{
block : '${1:name}',
mods: { ${2:modName}: '${3:modVal}' },
content : [
'${4:content}'
]
}
# Elems
# e - BEM elem
snippet e
{
elem : '${1:name}',
content : [
'${2:content}'
]
}
# mo - Mods
snippet mo
mods : { ${1:modName} : '${2:modVal}' },
mi - BEM mix mod
snippet mi
mix : [ { ${1:block} : '${2:block}' } ],
# a - BEM attrs mod
snippet a
attrs : { ${1:attr} : '${2:val}' },

View File

@ -262,6 +262,9 @@ snippet cd
# console.error
snippet ce
console.error(${0});
# console.warn
snippet cw
console.warn(${0});
# console.trace
snippet ct
console.trace(${0:label});

18
snippets/lfe.snippets Normal file
View File

@ -0,0 +1,18 @@
snippet defmo
(defmodule ${1:`vim_snippets#Filename()`}
(export ${2:all}))
$0
snippet def
(defun $1 ($2)
$0)
snippet ltest
(defmodule ${1:`vim_snippets#Filename()`}
(behaviour ltest-unit)
(export all))
(include-lib "ltest/include/ltest-macros.lfe")
$0
snippet test
(deftest $1
$0)

View File

@ -84,7 +84,9 @@ snippet fore
${1:expression} foreach @${2:array};
# Package
snippet package
package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`};
package ${1:`expand('%:p:s?.*lib/??:r:gs?/?::?')`};
use strict;
use warnings;
${0}
@ -93,7 +95,9 @@ snippet package
__END__
# Package syntax perl >= 5.14
snippet packagev514
package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99};
package ${1:`expand('%:p:s?.*lib/??:r:gs?/?::?')`} ${2:0.99};
use v5.14;
use warnings;
${0}

View File

@ -379,6 +379,8 @@ snippet d:mis
display -moz-inline-stack
snippet d:b
display block
snippet d:f
display flex
snippet d:cp
display compact
snippet d:ib