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-09-27 16:32:18 +01:00
parent 2a9908e4f0
commit 89c36a0d2c
97 changed files with 3635 additions and 1655 deletions

View File

@ -0,0 +1,324 @@
priority -50
global !p
def ada_case(word):
out = word[0].upper()
for i in range(1, len(word)):
if word[i - 1] == '_':
out = out + word[i].upper()
else:
out = out + word[i]
return out
def get_year():
import time
return time.strftime("%Y")
endglobal
snippet wi "with"
with $1;$0
endsnippet
snippet pac "package"
package ${1:`!p snip.rv = ada_case(snip.basename)`} is
$0
end $1;
endsnippet
snippet pacb "package body"
package body ${1:`!p snip.rv = ada_case(snip.basename)`} is
$0
end $1;
endsnippet
snippet ent "entry ... when"
entry $1($2) when $3 is
begin
$0
end $1;
endsnippet
snippet task "task"
task $1 is
entry $0
end $1;
endsnippet
snippet taskb "task body"
task body $1 is
$2
begin
$0
end $1;
endsnippet
snippet acc "accept"
accept $1($2) do
$0
end $1;
endsnippet
snippet prot "protected type"
protected type $1($2) is
$0
end $1;
endsnippet
snippet prob "protected body"
protected body $1 is
$2
begin
$0
end $1;
endsnippet
snippet gen "generic type"
generic
type $1 is $2;$0
endsnippet
snippet ty "type"
type $1 is $2;$0
endsnippet
snippet tyd "type with default value"
type $1 is $2
with Default_Value => $3;$0
endsnippet
snippet subty "subtype"
subtype $1 is $2;$0
endsnippet
snippet dec "declare block"
declare
$1
begin
$0
end;
endsnippet
snippet decn "declare named block"
$1:
declare
$2
begin
$0
end $1;
endsnippet
snippet ifex "if expression"
if $1 then $2 else $0
endsnippet
snippet casex "case expression"
case $1 is
when $2 => $3,$0
endsnippet
snippet fora "for all"
for all $1 ${2:in} $3 => $0
endsnippet
snippet fors "for some"
for some $1 ${2:in} $3 => $0
endsnippet
snippet if "if"
if $1 then
$0
end if;
endsnippet
snippet ife "if ... else"
if $1 then
$2
else
$0
end if;
endsnippet
snippet el "else"
else
$0
endsnippet
snippet eif "elsif"
elsif $1 then
$0
endsnippet
snippet wh "while"
while $1 loop
$0
end loop;
endsnippet
snippet nwh "named while"
$1:
while $2 loop
$0
end loop $1;
endsnippet
snippet for "for"
for ${1:I} in $2 loop
$0
end loop;
endsnippet
snippet fore "for each"
for $1 of $2 loop
$0
end loop;
endsnippet
snippet nfor "named for"
$1:
for ${2:I} in $3 loop
$0
end loop $1;
endsnippet
snippet nfore "named for each"
$1:
for $2 of $3 loop
$0
end loop $1;
endsnippet
snippet proc "procedure"
procedure $1($2) is
$3
begin
$0
end $1;
endsnippet
snippet procd "procedure declaration"
procedure $1;$0
endsnippet
snippet fun "function"
function $1($2) return $3 is
$4
begin
$0
end $1;
endsnippet
snippet fune "expression function"
function $1 return $2 is
($3);$0
endsnippet
snippet fund "function declaration"
function $1 return $2;$0
endsnippet
snippet ret "extended return"
return $1 do
$0
end return;
endsnippet
snippet rec "record"
record
$0
end record;
endsnippet
snippet case "case"
case $1 is
when $2 => $3;$0
end case;
endsnippet
snippet whe "when"
when $1 => $2;$0
endsnippet
snippet wheo "when others"
when others => $1;$0
endsnippet
snippet lo "loop"
loop
$0
end loop;
endsnippet
snippet nlo "named loop"
$1:
loop
$0
end loop $1;
endsnippet
snippet ex "exit when"
exit when $1;$0
endsnippet
snippet put "Ada.Text_IO.Put"
Ada.Text_IO.Put($1);$0
endsnippet
snippet putl "Ada.Text_IO.Put_Line"
Ada.Text_IO.Put_Line($1);$0
endsnippet
snippet get "Ada.Text_IO.Get"
Ada.Text_IO.Get($1);$0
endsnippet
snippet getl "Ada.Text_IO.Get_Line"
Ada.Text_IO.Get_Line($1);$0
endsnippet
snippet newline "Ada.Text_IO.New_Line"
Ada.Text_IO.New_Line(${1:1});$0
endsnippet
snippet gpl "GPL license header"
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU ${1}General Public License as published by
-- the Free Software Foundation; either version ${2:3} of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $1General Public License for more details.
--
-- You should have received a copy of the GNU $1General Public License
-- along with this program; if not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${3:Author}, ${4:`!p snip.rv = get_year()`}
$0
endsnippet
snippet gplf "GPL file license header"
-- This file is part of ${1:Program-Name}.
--
-- $1 is free software: you can redistribute it and/or modify
-- it under the terms of the GNU ${2}General Public License as published by
-- the Free Software Foundation, either version ${3:3} of the License, or
-- (at your option) any later version.
--
-- $1 is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $2General Public License for more details.
--
-- You should have received a copy of the GNU $2General Public License
-- along with $1. If not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${4:Author}, ${5:`!p snip.rv = get_year()`}
$0
endsnippet
# vim:ft=snippets:

View File

@ -120,4 +120,14 @@ vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
endsnippet
##########################
# VIM MODELINE GENERATOR #
##########################
# See advice on `:help 'tabstop'` for why these values are set. Uses second
# modeline form ('set') to work in languages with comment terminators
# (/* like C */).
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
# vim:ft=snippets:

View File

@ -77,7 +77,6 @@ else:
${VISUAL}${0}
#endif /* end of include guard: $1 */
endsnippet
snippet td "Typedef"

View File

@ -29,4 +29,9 @@ ${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)`
$0
endsnippet
# For vim help, follow the same settings as the official docs.
snippet modeline "Vim help modeline"
`!v 'vim'`:tw=78:ts=8:ft=help:norl:
endsnippet
# vim:ft=snippets:

View File

@ -253,6 +253,10 @@ snippet td "table cell" w
<td>$0</td>
endsnippet
snippet th "table header" w
<th>$0</th>
endsnippet
snippet tr "table row" w
<tr>$0</tr>
endsnippet

View File

@ -180,13 +180,13 @@ endsnippet
snippet elif "else if"
else if ($1)`!p nl(snip)`{
$0
$0${VISUAL}
}
endsnippet
snippet el "else" w
else`!p nl(snip)`{
$0
$0${VISUAL}
}
endsnippet
@ -214,7 +214,7 @@ endsnippet
snippet if "if" b
if ($1)`!p nl(snip)`{
$0
$0${VISUAL}
}
endsnippet
@ -303,7 +303,7 @@ endsnippet
snippet try "try/catch" b
try {
$1
$1${VISUAL}
} catch(${2:Exception} ${3:e}){
${4:e.printStackTrace();}
}

View File

@ -50,6 +50,10 @@ snippet ee "expect to equal (js)" b
expect(${1:target}).toEqual(${2:value});
endsnippet
snippet eb "expect to be (js)" b
expect(${1:target}).toBe(${2:value});
endsnippet
snippet em "expect to match (js)" b
expect(${1:target}).toMatch(${2:pattern});
endsnippet

View File

@ -1,3 +1,12 @@
extends markdown
# overwrite if necessary
priority -49
extends markdown
snippet title "Title Header" b
% ${1:`!v Filename('', 'title')`}
% ${2:`!v g:snips_author`}
% ${3:`!v strftime("%d %B %Y")`}
$0
endsnippet

View File

@ -129,4 +129,11 @@ while ($1) {
endsnippet
snippet until "until"
until ($1) {
${2:# body...}
}
endsnippet
# vim:ft=snippets:

View File

@ -14,7 +14,7 @@ endsnippet
snippet do "do"
do {
${2:// code... }
} while (${1:/* condition */});"
} while (${1:/* condition */});
endsnippet
snippet doc_f "doc_f"
@ -67,6 +67,12 @@ if (${1:/* condition */}) {
}
endsnippet
snippet elif "elseif"
elseif (${1:/* condition */}) {
${2:// code...}
}
endsnippet
snippet inc "inc"
include '${1:file}';${2}
endsnippet
@ -240,8 +246,8 @@ public function __construct(${1:$dependencies})
$0
endsnippet
snippet pr "Dumb debug helper in HTML"
echo '<pre>' . var_export($1, 1) . '</pre>';$0
snippet ve "Dumb debug helper in HTML"
echo '<pre>' . var_export($1, 1) . '</pre>';$0
endsnippet
snippet pc "Dumb debug helper in cli"

View File

@ -84,22 +84,22 @@ def get_style(snip):
def format_arg(arg, style):
if style == DOXYGEN:
return "@param %s @todo" % arg
return "@param %s TODO" % arg
elif style == SPHINX:
return ":param %s: @todo" % arg
return ":param %s: TODO" % arg
elif style == NORMAL:
return ":%s: @todo" % arg
return ":%s: TODO" % arg
elif style == GOOGLE:
return "%s (@todo): @todo" % arg
return "%s (TODO): TODO" % arg
def format_return(style):
if style == DOXYGEN:
return "@return: @todo"
return "@return: TODO"
elif style in (NORMAL, SPHINX):
return ":returns: @todo"
return ":returns: TODO"
elif style == GOOGLE:
return "Returns: @todo"
return "Returns: TODO"
def write_docstring_args(args, snip):
@ -169,7 +169,7 @@ class ${1:MyClass}(${2:object}):
`!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
def __init__(self$4):
`!p snip.rv = triple_quotes(snip)`${5:@todo: to be defined1.}`!p
`!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined1.}`!p
snip.rv = ""
snip >> 2
@ -197,7 +197,7 @@ write_slots_args(args, snip)
`
def __init__(self$4):
`!p snip.rv = triple_quotes(snip)`${5:@todo: to be defined.}`!p
`!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined.}`!p
snip.rv = ""
snip >> 2
@ -399,7 +399,7 @@ snippet def "function with docstrings" b
def ${1:function}(`!p
if snip.indent:
snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}):
`!p snip.rv = triple_quotes(snip)`${4:@todo: Docstring for $1.}`!p
`!p snip.rv = triple_quotes(snip)`${4:TODO: Docstring for $1.}`!p
snip.rv = ""
snip >> 1
@ -437,7 +437,7 @@ endsnippet
snippet rwprop "Read write property" b
def ${1:name}():
`!p snip.rv = triple_quotes(snip) if t[2] else ''
`${2:@todo: Docstring for $1.}`!p
`${2:TODO: Docstring for $1.}`!p
if t[2]:
snip >> 1

View File

@ -73,7 +73,7 @@ endsnippet
snippet ecl "...extern crate log;" b
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
#[phase(plugin, link)] extern crate log;
endsnippet
snippet mod "A module" b
@ -83,16 +83,16 @@ mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
endsnippet
snippet crate "Create header information" b
// Crate ID
#![crate_id = "${1:crate_name}#${2:0.0.1}"]
// Crate name
#![crate_name = "${1:crate_name}"]
// Additional metadata attributes
#![desc = "${3:Descrption.}"]
#![license = "${4:BSD}"]
#![comment = "${5:Comment.}"]
#![desc = "${2:Descrption.}"]
#![license = "${3:BSD}"]
#![comment = "${4:Comment.}"]
// Specify the output type
#![crate_type = "${6:lib}"]
#![crate_type = "${5:lib}"]
endsnippet
snippet allow "#[allow(..)]" b

View File

@ -1,54 +1,56 @@
extends css
priority -50
snippet /@?imp/ "@import '...';" br
snippet imp "@import '...';" b
@import '${1:file}';
endsnippet
snippet /@?inc/ "@include mixin(...);" br
snippet inc "@include mixin(...);" b
@include ${1:mixin}(${2:arguments});
endsnippet
snippet /@?ext?/ "@extend %placeholder;" br
snippet ext "@extend %placeholder;" b
@extend %${1:placeholder};
endsnippet
snippet /@?mixin/ "@mixin (...) { ... }" br
snippet mixin "@mixin (...) { ... }" b
@mixin ${1:name}(${2:arguments}) {
${VISUAL}$0
}
endsnippet
snippet /@?fun/ "@function (...) { ... }" br
snippet fun "@function (...) { ... }" b
@function ${1:name}(${2:arguments}) {
${VISUAL}$0
}
endsnippet
snippet /@?if/ "@if (...) { ... }" br
snippet if "@if (...) { ... }" b
@if ${1:condition} {
${VISUAL}$0
}
endsnippet
snippet /(} )?@?else/ "@else { ... }" br
snippet else "@else { ... }" b
@else ${1:condition} {
${VISUAL}$0
}
endsnippet
snippet /@?for/ "@for loop" br
snippet for "@for loop" b
@for ${1:$i} from ${2:1} through ${3:3} {
${VISUAL}$0
}
endsnippet
snippet /@?each/ "@each loop" br
snippet each "@each loop" b
@each ${1:$item} in ${2:item, item, item} {
${VISUAL}$0
}
endsnippet
snippet /@?while/ "@while loop" br
snippet while "@while loop" b
@while ${1:$i} ${2:>} ${3:0} {
${VISUAL}$0
}