1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins

This commit is contained in:
amix
2014-10-31 21:30:24 +00:00
parent fe77d23852
commit a304deea56
94 changed files with 5065 additions and 393 deletions

View File

@ -1,19 +1,131 @@
priority -50
snippet . "selector { }"
$1 {
$0
}
endsnippet
snippet p "padding"
padding: ${1:0};$0
endsnippet
snippet m "margin"
margin: ${1:0};$0
endsnippet
snippet bd "border"
border: ${1:0};$0
endsnippet
snippet d "display"
display: ${1:none};$0
endsnippet
snippet bg "background"
background: ${1:none};$0
endsnippet
snippet ff "font-family"
font-family: ${1:"Helvetica Neue", Helvetica, Arial, sans-serif};$0
endsnippet
snippet h "height"
height: ${1:auto};$0
endsnippet
snippet w "width"
width: ${1:auto};$0
endsnippet
snippet pos "position"
position: ${1:relative};$0
endsnippet
snippet tt "text-transform"
text-transform: ${1:none};$0
endsnippet
snippet ! "!important CSS (!)"
!important
endsnippet
snippet tsh "text-shadow: color-hex x y blur (text)"
text-shadow: ${1:${2:color} ${3:offset-x} ${4:offset-y} ${5:blur}};$0
endsnippet
snippet bxsh "box-shadow: color-hex x y blur (text)"
box-shadow: ${1:${2:offset-x} ${3:offset-y} ${4:blur} ${5:spread} ${6:color}};$0
endsnippet
#
# Colors
#
snippet rgb "color rgb"
rgb(${1:255}, ${2:255}, ${3:255})$0
endsnippet
snippet rgba "color rgba"
rgba(${1:255}, ${2:255}, ${3:255}, ${4:0.5})$0
endsnippet
snippet hsl "color hsl"
hsl(${1:360}, ${2:100}%, ${3:100}%)$0
endsnippet
snippet hsla "color hsla"
hsla(${1:360}, ${2:100}%, ${3:100}%, ${4:0.5})$0
endsnippet
#
# Selectors
#
snippet :fc
:first-child
endsnippet
snippet :lc
:last-child
endsnippet
snippet :nc
:nth-child($0)
endsnippet
snippet :nlc
:nth-last-child($0)
endsnippet
snippet :oc
:only-child
endsnippet
#
# Pseudo-elements
#
snippet :a
:after
endsnippet
snippet :b
:before
endsnippet
snippet ::a
::after
endsnippet
snippet ::b
::before
endsnippet
###########################################################################
# Most of these came from TextMate #
###########################################################################
priority -50
snippet ! "!important CSS (!)"
${1:!important}
endsnippet
snippet fixed "Fixed Position Bottom 100% wide IE6"
${2:bottom: auto;}top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-${1:THE HEIGHT OF THIS THING IN PIXELS}));
${3:left: expression(eval(document.documentElement.scrollLeft));
}${4:width: expression(eval(document.documentElement.clientWidth));}$0
endsnippet
snippet background "background-attachment: scroll:fixed (background)"
background-attachment: ${1:scroll/fixed};$0
endsnippet
@ -360,26 +472,10 @@ snippet text "text-indent: length (text)"
text-indent: ${1:10}px;$0
endsnippet
snippet text "text-shadow: color-hex x y blur (text)"
text-shadow: #${1:DDD} ${2:10px} ${3:10px} ${4:2px};$0
endsnippet
snippet text "text-shadow: color-rgb x y blur (text)"
text-shadow: rgb(${1:255},${2:255},${3:255}) ${4:10px} ${5:10px} ${6:2px};$0
endsnippet
snippet text "text-shadow: none (text)"
text-shadow: none;$0
endsnippet
snippet text "text-transform: capitalize:upper:lower (text)"
text-transform: ${1:capitalize/uppercase/lowercase};$0
endsnippet
snippet text "text-transform: none (text)"
text-transform: none;$0
endsnippet
snippet vertical "vertical-align: type (vertical)"
vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0
endsnippet
@ -396,10 +492,6 @@ snippet word "word-spacing: length (word)"
word-spacing: ${1:10px};$0
endsnippet
snippet word "word-spacing: normal (word)"
word-spacing: normal;$0
endsnippet
snippet z "z-index: index (z)"
z-index: $1;$0
endsnippet

View File

@ -17,7 +17,7 @@ ${1:name} :: ${2:Type} -> ${3:Type}
endsnippet
snippet => "Type constraint"
(${1:Class} ${2:Type var}) => ${3:$2}
(${1:Class} ${2:a}) => $2
endsnippet
snippet def "Function definition"
@ -50,7 +50,7 @@ snippet | "Guard"
endsnippet
snippet \ "Lambda expression"
\ ${1:pattern} -> ${2:expression}
\\${1:pattern} -> ${2:expression}
endsnippet
snippet [|] "List comprehension"
@ -61,3 +61,8 @@ snippet let "let ... in ..."
let ${1:name} = ${2:expression}
in ${3:expression}
endsnippet
snippet wh "where x = expression"
where
${1:name} = ${2:expression}
endsnippet

View File

@ -160,10 +160,6 @@ snippet base "XHTML <base>" w
<base href="$1"${2: target="$3"}`!p x(snip)`>
endsnippet
snippet img "XHTML <img>" w
<img src="${1:imgsrc}">
endsnippet
snippet body "XHTML <body>"
<body id="${1:`!p
snip.rv = snip.fn and 'Hallo' or 'Nothin'
@ -172,7 +168,13 @@ snip.rv = snip.fn and 'Hallo' or 'Nothin'
</body>
endsnippet
snippet div "XHTML <div>" w
snippet div. "<div> with class" w
<div`!p snip.rv=' class="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`>
$0
</div>
endsnippet
snippet div# "<div> with ID & class" w
<div`!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
</div>

View File

@ -169,3 +169,16 @@ endsnippet
snippet noscw "expect was not called with (js)" b
expect(${1:target}).wasNotCalledWith(${2:arguments});
endsnippet
snippet ethbc "expect to have been called (js)" b
expect(${1:target}).toHaveBeenCalled();
endsnippet
snippet nthbc "expect not to have been called (js)" b
expect(${1:target}).not.toHaveBeenCalled();
endsnippet
snippet ethbcw "expect to have been called with (js)" b
expect(${1:target}).toHaveBeenCalledWith(${2:arguments});
endsnippet

View File

@ -36,8 +36,8 @@ DOXYGEN = 0x2
SPHINX = 0x3
GOOGLE = 0x4
SINGLE_QUOTES = 0x1
DOUBLE_QUOTES = 0x2
SINGLE_QUOTES = "'"
DOUBLE_QUOTES = '"'
class Arg(object):
@ -69,9 +69,35 @@ def get_quoting_style(snip):
return DOUBLE_QUOTES
def triple_quotes(snip):
if get_quoting_style(snip) == SINGLE_QUOTES:
return "'''"
return '"""'
return get_quoting_style(snip) * 3
def triple_quotes_handle_trailing(snip, quoting_style):
"""
Generate triple quoted strings and handle any trailing quote char,
which might be there from some autoclose/autopair plugin,
i.e. when expanding ``"|"``.
"""
if not snip.c:
# Do this only once, otherwise the following error would happen:
# RuntimeError: The snippets content did not converge: …
_, col = vim.current.window.cursor
line = vim.current.line
# Handle already existing quote chars after the trigger.
_ret = quoting_style * 3
while True:
try:
nextc = line[col]
except IndexError:
break
if nextc == quoting_style and len(_ret):
_ret = _ret[1:]
col = col+1
else:
break
snip.rv = _ret
else:
snip.rv = snip.c
def get_style(snip):
style = snip.opt("g:ultisnips_python_style", "normal")
@ -613,4 +639,22 @@ class Test${1:Class}(${2:unittest.TestCase}):
${7:pass}
endsnippet
snippet " "triple quoted string (double quotes)" b
"""
${1:doc}
`!p triple_quotes_handle_trailing(snip, '"')`
endsnippet
snippet ' "triple quoted string (single quotes)" b
'''
${1:doc}
`!p triple_quotes_handle_trailing(snip, "'")`
endsnippet
snippet doc "doc block (triple quotes)"
`!p snip.rv = triple_quotes(snip)`
${1:doc}
`!p snip.rv = triple_quotes(snip)`
endsnippet
# vim:ft=snippets:

View File

@ -128,4 +128,4 @@ snippet ife
${0}
<% end %>
snippet pry
<% require 'pry'; binding.pry %>
<% require 'pry'; binding.pry %>

View File

@ -14,10 +14,14 @@ snippet info
--
-- ${0:Description}
--
snippet imp
import ${0:Data.Text}
snippet import
import ${0:Data.Text}
snippet import2
import ${1:Data.Text} (${0:head})
snippet impq
import qualified ${1:Data.Text} as ${0:T}
snippet importq
import qualified ${1:Data.Text} as ${0:T}
snippet inst
@ -52,9 +56,11 @@ snippet do
do
snippet λ
\${1:x} -> ${0}
\\${1:x} -> ${0:expression}
snippet \
\${1:x} -> ${0}
\\${1:x} -> ${0:expression}
snippet (\
(\\${1:x} -> ${0:expression})
snippet <-
${1:a} <- ${0:m a}
snippet ←

View File

@ -674,11 +674,11 @@ snippet ol
${0}
</ol>
snippet ol.
<ol class="${1}>
<ol class="${1}">
${0}
</ol>
snippet ol#
<ol id="${1}>
<ol id="${1}">
${0}
</ol>
snippet ol+

View File

@ -42,6 +42,11 @@ snippet fori
for (${1:i} <- ${2:0} to ${3:obj}.length) {
${0}
}
#for comprehension
snippet fory
for {
${1:item} <- ${2:obj}
} yield ${0}
#exceptions
snippet try
try {

View File

@ -7,3 +7,5 @@ snippet msnip
${0}
snippet v
{VISUAL}
snippet $
${${1:1}:${0:text}}