1
0
mirror of https://github.com/amix/vimrc synced 2025-09-20 11:45:01 +08:00

Updated plugins

This commit is contained in:
amix
2015-12-08 10:20:04 -03:00
parent 768c72a3ed
commit 3b37bba6cd
239 changed files with 8132 additions and 3198 deletions

View File

@ -25,7 +25,7 @@ snippet Inc
snippet ndef
#ifndef $1
#define ${1:SYMBOL} ${2:value}
#endif
#endif /* ifndef $1 */
# define
snippet def
#define
@ -98,6 +98,8 @@ snippet case
case ${1:/* variable case */}:
${2}
${3:break;}
snippet ret
return ${0};
##
## Loops
# for
@ -146,6 +148,9 @@ snippet tds
typedef struct ${2:_$1 }{
${3:/* data */}
} ${1:`vim_snippets#Filename('$1_t', 'name')`};
snippet enum
enum ${1:name} { ${0} };
# typedef enum
snippet tde
typedef enum {
@ -221,23 +226,3 @@ snippet getopt
# This is kind of convenient
snippet .
[${1}]
# GPL
snippet gpl
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) ${1:Author}, `strftime("%Y")`
*/
${0}

View File

@ -1,5 +1,13 @@
extends c
##
## Preprocessor
# #include <...>
snippet inc
#include <${1:iostream}>
snippet binc
#include <boost/${1:shared_ptr}.hpp>
##
## STL Collections
# std::array
snippet array

View File

@ -70,7 +70,7 @@ snippet defma
${0}
end
snippet defmo
defmodule ${1:module_name} do
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
${0}
end
snippet defp
@ -123,3 +123,7 @@ snippet try try .. rescue .. end
snippet pry
require IEx; IEx.pry
${0}
snippet qu
quote do
${1}
end

View File

@ -22,23 +22,23 @@ snippet for
${0}
<% end %>
snippet rp
<%= render :partial => '${0:item}' %>
<%= render partial: '${0:item}' %>
snippet rpl
<%= render :partial => '${1:item}', :locals => { :${2:name} => '${3:value}'${0} } %>
<%= render partial: '${1:item}', locals: { :${2:name} => '${3:value}'${0} } %>
snippet rps
<%= render :partial => '${1:item}', :status => ${0:500} %>
<%= render partial: '${1:item}', status: ${0:500} %>
snippet rpc
<%= render :partial => '${1:item}', :collection => ${0:items} %>
<%= render partial: '${1:item}', collection: ${0:items} %>
snippet lia
<%= link_to '${1:link text...}', :action => '${0:index}' %>
<%= link_to '${1:link text...}', action: '${0:index}' %>
snippet liai
<%= link_to '${1:link text...}', :action => '${2:edit}', :id => ${0:@item} %>
<%= link_to '${1:link text...}', action: '${2:edit}', id: ${0:@item} %>
snippet lic
<%= link_to '${1:link text...}', :controller => '${0:items}' %>
<%= link_to '${1:link text...}', controller: '${0:items}' %>
snippet lica
<%= link_to '${1:link text...}', :controller => '${2:items}', :action => '${0:index}' %>
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${0:index}' %>
snippet licai
<%= link_to '${1:link text...}', :controller => '${2:items}', :action => '${3:edit}', :id => ${0:@item} %>
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${3:edit}', id: ${0:@item} %>
snippet yield
<%= yield ${1::content_symbol} %>
snippet conf
@ -110,11 +110,11 @@ snippet ofcfs
snippet ofs
<%= options_for_select ${1:collection}, ${2:value_method} %>
snippet rf
<%= render :file => "${1:file}"${0} %>
<%= render file: "${1:file}"${0} %>
snippet rt
<%= render :template => "${1:file}"${0} %>
<%= render template: "${1:file}"${0} %>
snippet slt
<%= stylesheet_link_tag ${1::all}, :cache => ${0:true} %>
<%= stylesheet_link_tag ${1::all}, cache: ${0:true} %>
snippet sslt
<%= stylesheet_link_tag "${0}" %>
snippet if

View File

@ -2,11 +2,13 @@ snippet lang
{-# LANGUAGE ${0:OverloadedStrings} #-}
snippet haddock
{-# OPTIONS_HADDOCK ${0:hide} #-}
snippet ghc
{-# OPTIONS_GHC ${0:-fno-warn-unused-imports} #-}
snippet inline
{-# INLINE ${0:name} #-}
snippet info
-- |
-- Module : ${1:Module.Namespace}
-- Module : ${1:`substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')`}
-- Copyright : ${2:Author} ${3:2011-2012}
-- License : ${4:BSD3}
--
@ -40,9 +42,12 @@ snippet class
${0}
snippet module
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (
) where
`expand('%') =~ 'Main' ? "\n\nmain = do\n print \"hello world\"" : ""`
) where
`expand('%') =~ 'Main' ? "\nmain :: IO ()\nmain = undefined" : ""`
snippet main
main :: IO ()
main = ${0:undefined}
snippet const
${1:name} :: ${2:a}
$1 = ${0:undefined}
@ -52,25 +57,21 @@ snippet fn
snippet fn2
${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}
$1 ${5} = ${0:undefined}
snippet fn3
${1:fn} :: ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
$1 ${6} = ${0:undefined}
snippet => "Type constraint"
(${1:Class} ${2:a}) => $2
snippet ap
${1:map} ${2:fn} ${0:list}
snippet do
do
snippet λ
\\${1:x} -> ${0:expression}
snippet \
\\${1:x} -> ${0:expression}
snippet (\
(\\${1:x} -> ${0:expression})
snippet <-
${1:a} <- ${0:m a}
snippet ←
${1:a} <- ${0:m a}
snippet ->
${1:m a} -> ${0:a}
snippet →
${1:m a} -> ${0:a}
snippet tup
(${1:a}, ${0:b})
snippet tup2
@ -90,3 +91,25 @@ snippet let
snippet where
where
${1:fn} = ${0:undefined}
snippet spec
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (main, spec) where
import Test.Hspec
import Test.QuickCheck
main :: IO ()
main = hspec spec
spec :: Spec
spec =
describe "${1}" $ do
$0
snippet desc
describe "${1}" $ do
$0
snippet it
it "${1}" $
$0
snippet itp
it "${1}" $ property $
$0

View File

@ -159,18 +159,18 @@ snippet address
${0}
</address>
snippet area
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${0}" />
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${0}">
snippet area+
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${4}" />
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${4}">
area+
snippet area:c
<area shape="circle" coords="${1}" href="${2}" alt="${0}" />
<area shape="circle" coords="${1}" href="${2}" alt="${0}">
snippet area:d
<area shape="default" coords="${1}" href="${2}" alt="${0}" />
<area shape="default" coords="${1}" href="${2}" alt="${0}">
snippet area:p
<area shape="poly" coords="${1}" href="${2}" alt="${0}" />
<area shape="poly" coords="${1}" href="${2}" alt="${0}">
snippet area:r
<area shape="rect" coords="${1}" href="${2}" alt="${0}" />
<area shape="rect" coords="${1}" href="${2}" alt="${0}">
snippet article
<article>
${0}
@ -200,7 +200,7 @@ snippet audio
snippet b
<b>${0}</b>
snippet base
<base href="${1}" target="${0}" />
<base href="${1}" target="${0}">
snippet bdi
<bdi>${0}</bdo>
snippet bdo
@ -218,7 +218,7 @@ snippet body
${0}
</body>
snippet br
<br />
<br>
snippet button
<button type="${1:submit}">${0}</button>
snippet button.
@ -240,9 +240,9 @@ snippet cite
snippet code
<code>${0}</code>
snippet col
<col />
<col>
snippet col+
<col />
<col>
col+
snippet colgroup
<colgroup>
@ -254,11 +254,11 @@ snippet colgroup+
col+${0}
</colgroup>
snippet command
<command type="command" label="${1}" icon="${0}" />
<command type="command" label="${1}" icon="${0}">
snippet command:c
<command type="checkbox" label="${1}" icon="${0}" />
<command type="checkbox" label="${1}" icon="${0}">
snippet command:r
<command type="radio" radiogroup="${1}" label="${2}" icon="${0}" />
<command type="radio" radiogroup="${1}" label="${2}" icon="${0}">
snippet datagrid
<datagrid>
${0}
@ -330,7 +330,7 @@ snippet dt+
snippet em
<em>${0}</em>
snippet embed
<embed src="${1}" type="${0}" />
<embed src="${1}" type="${0}">
snippet fieldset
<fieldset>
${0}
@ -423,7 +423,7 @@ snippet h6#
<h6 id="${1}">${0}</h6>
snippet head
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
${0}
@ -449,7 +449,7 @@ snippet hgroup.
${0}
</hgroup>
snippet hr
<hr />
<hr>
snippet html
<html>
${0}
@ -493,59 +493,59 @@ snippet iframe.
snippet iframe#
<iframe id="${1}" src="${2}" frameborder="0"></iframe>
snippet img
<img src="${1}" alt="${2}" />
<img src="${1}" alt="${2}">
snippet img.
<img class="${1}" src="${2}" alt="${3}" />
<img class="${1}" src="${2}" alt="${3}">
snippet img#
<img id="${1}" src="${2}" alt="${3}" />
<img id="${1}" src="${2}" alt="${3}">
snippet input
<input type="${1:text/submit/hidden/button/image}" name="${2}" id="${3:$2}" value="${4}" />
<input type="${1:text/submit/hidden/button/image}" name="${2}" id="${3:$2}" value="${4}">
snippet input.
<input class="${1}" type="${2:text/submit/hidden/button/image}" name="${3}" id="${4:$3}" value="${5}" />
<input class="${1}" type="${2:text/submit/hidden/button/image}" name="${3}" id="${4:$3}" value="${5}">
snippet input:text
<input type="text" name="${1}" id="${2:$1}" value="${3}" />
<input type="text" name="${1}" id="${2:$1}" value="${3}">
snippet input:submit
<input type="submit" name="${1}" id="${2:$1}" value="${3}" />
<input type="submit" name="${1}" id="${2:$1}" value="${3}">
snippet input:hidden
<input type="hidden" name="${1}" id="${2:$1}" value="${3}" />
<input type="hidden" name="${1}" id="${2:$1}" value="${3}">
snippet input:button
<input type="button" name="${1}" id="${2:$1}" value="${3}" />
<input type="button" name="${1}" id="${2:$1}" value="${3}">
snippet input:image
<input type="image" name="${1}" id="${2:$1}" src="${3}" alt="${4}" />
<input type="image" name="${1}" id="${2:$1}" src="${3}" alt="${4}">
snippet input:checkbox
<input type="checkbox" name="${1}" id="${2:$1}" />
<input type="checkbox" name="${1}" id="${2:$1}">
snippet input:radio
<input type="radio" name="${1}" id="${2:$1}" />
<input type="radio" name="${1}" id="${2:$1}">
snippet input:color
<input type="color" name="${1}" id="${2:$1}" value="${3}" />
<input type="color" name="${1}" id="${2:$1}" value="${3}">
snippet input:date
<input type="date" name="${1}" id="${2:$1}" value="${3}" />
<input type="date" name="${1}" id="${2:$1}" value="${3}">
snippet input:datetime
<input type="datetime" name="${1}" id="${2:$1}" value="${3}" />
<input type="datetime" name="${1}" id="${2:$1}" value="${3}">
snippet input:datetime-local
<input type="datetime-local" name="${1}" id="${2:$1}" value="${3}" />
<input type="datetime-local" name="${1}" id="${2:$1}" value="${3}">
snippet input:email
<input type="email" name="${1}" id="${2:$1}" value="${3}" />
<input type="email" name="${1}" id="${2:$1}" value="${3}">
snippet input:file
<input type="file" name="${1}" id="${2:$1}" value="${3}" />
<input type="file" name="${1}" id="${2:$1}" value="${3}">
snippet input:month
<input type="month" name="${1}" id="${2:$1}" value="${3}" />
<input type="month" name="${1}" id="${2:$1}" value="${3}">
snippet input:number
<input type="number" name="${1}" id="${2:$1}" value="${3}" />
<input type="number" name="${1}" id="${2:$1}" value="${3}">
snippet input:password
<input type="password" name="${1}" id="${2:$1}" value="${3}" />
<input type="password" name="${1}" id="${2:$1}" value="${3}">
snippet input:range
<input type="range" name="${1}" id="${2:$1}" value="${3}" />
<input type="range" name="${1}" id="${2:$1}" value="${3}">
snippet input:reset
<input type="reset" name="${1}" id="${2:$1}" value="${3}" />
<input type="reset" name="${1}" id="${2:$1}" value="${3}">
snippet input:search
<input type="search" name="${1}" id="${2:$1}" value="${3}" />
<input type="search" name="${1}" id="${2:$1}" value="${3}">
snippet input:time
<input type="time" name="${1}" id="${2:$1}" value="${3}" />
<input type="time" name="${1}" id="${2:$1}" value="${3}">
snippet input:url
<input type="url" name="${1}" id="${2:$1}" value="${3}" />
<input type="url" name="${1}" id="${2:$1}" value="${3}">
snippet input:week
<input type="week" name="${1}" id="${2:$1}" value="${3}" />
<input type="week" name="${1}" id="${2:$1}" value="${3}">
snippet ins
<ins>${0}</ins>
snippet kbd
@ -579,19 +579,19 @@ snippet lia+
<li><a href="${2:#}">${1}</a></li>
lia+
snippet link
<link rel="${1}" href="${2}" title="${3}" type="${4}" />
<link rel="${1}" href="${2}" title="${3}" type="${4}">
snippet link:atom
<link rel="alternate" href="${1:atom.xml}" title="Atom" type="application/atom+xml" />
<link rel="alternate" href="${1:atom.xml}" title="Atom" type="application/atom+xml">
snippet link:s
<link rel="stylesheet" href="${1:style.css}" />
<link rel="stylesheet" href="${1:style.css}">
snippet link:css
<link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}" />
<link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}">
snippet link:favicon
<link rel="shortcut icon" href="${1:favicon.ico}" type="image/x-icon" />
<link rel="shortcut icon" href="${1:favicon.ico}" type="image/x-icon">
snippet link:rss
<link rel="alternate" href="${1:rss.xml}" title="RSS" type="application/atom+xml" />
<link rel="alternate" href="${1:rss.xml}" title="RSS" type="application/atom+xml">
snippet link:touch
<link rel="apple-touch-icon" href="${1:favicon.png}" />
<link rel="apple-touch-icon" href="${1:favicon.png}">
snippet main
<main role="main">
${0}
@ -610,7 +610,7 @@ snippet map#
</map>
snippet map+
<map name="${1}">
<area shape="${2}" coords="${3}" href="${4}" alt="${5}" />${6}
<area shape="${2}" coords="${3}" href="${4}" alt="${5}">${6}
</map>
snippet mark
<mark>${0}</mark>
@ -627,17 +627,17 @@ snippet menu:t
${0}
</menu>
snippet meta
<meta http-equiv="${1}" content="${2}" />
<meta http-equiv="${1}" content="${2}">
snippet meta:s
<meta ${0} />
<meta ${0}>
snippet meta:d
<meta name="description" content="${0}" />
<meta name="description" content="${0}">
snippet meta:compat
<meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}" />
<meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}">
snippet meta:refresh
<meta http-equiv="refresh" content="text/html;charset=UTF-8" />
<meta http-equiv="refresh" content="text/html;charset=UTF-8">
snippet meta:utf
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
snippet meter
<meter>${0}</meter>
snippet nav
@ -665,13 +665,13 @@ snippet movie
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="$1" />
<param name="controller" value="$4" />
<param name="autoplay" value="$5" />
<param name="controller" value="$4">
<param name="autoplay" value="$5">
<embed src="${1:movie.mov}"
width="${2:320}" height="${3:240}"
controller="${4:true}" autoplay="${5:true}"
scale="tofit" cache="true"
pluginspage="http://www.apple.com/quicktime/download/" />
pluginspage="http://www.apple.com/quicktime/download/">
</object>
snippet ol
<ol>
@ -711,7 +711,7 @@ snippet p.
snippet p#
<p id="${1}">${0}</p>
snippet param
<param name="${1}" value="${2}" />
<param name="${1}" value="${2}">
snippet pre
<pre>
${0}
@ -774,7 +774,7 @@ snippet select+
snippet small
<small>${0}</small>
snippet source
<source src="${1}" type="${2}" media="${0}" />
<source src="${1}" type="${2}" media="${0}">
snippet span
<span>${0}</span>
snippet span.
@ -876,4 +876,4 @@ snippet var
snippet video
<video src="${1} height="${2}" width="${3}" preload="${5:none}" autoplay="${6:autoplay}>${7}</video>
snippet wbr
<wbr />
<wbr>

View File

@ -1,5 +1,7 @@
# Generic tags
extends html
snippet %
{% ${1} %}
snippet %%
@ -138,4 +140,3 @@ snippet urlizetrunc
urlizetrunc:${0}
snippet wordwrap
wordwrap:${0}

View File

@ -0,0 +1,22 @@
snippet const
const ${0} = ${1};
snippet let
let ${0} = ${1};
snippet im
import ${0} from '${1}';
snippet cla
class ${0} {
${1}
}
snippet clax
class ${0} extends ${1} {
${2}
}
snippet =>
(${0}) => {
${1}
}
snippet sym
const ${0} = Symbol('${1}');
snippet ed
export default ${0}

View File

@ -11,7 +11,7 @@ snippet fun
${0}
}
# Anonymous Function
snippet f
snippet f "" w
function(${1}) {
${0}
}
@ -80,6 +80,18 @@ snippet try
} catch (${2:e}) {
${0:/* handle error */}
}
# try finally
snippet tryf
try {
${1}
} catch (${2:e}) {
${0:/* handle error */}
} finally {
${3:/* be executed regardless of the try / catch result*/}
}
# throw Error
snippet terr
throw new Error('${1:error message}')
# return
snippet ret
return ${0:result};
@ -88,12 +100,12 @@ snippet ret
# for loop
snippet for
for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2 ++) {
for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2++) {
var ${3:v} = $1[$2];${0:}
}
# Reversed for loop
snippet forr
for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2 --) {
for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2--) {
var ${3:v} = $1[$2];${0:}
}
# While loop
@ -203,7 +215,6 @@ snippet @par
@param {${1:type}} ${2:name} ${0:description}
snippet @ret
@return {${1:type}} ${0:description}
# JSON
# JSON.parse
@ -243,6 +254,9 @@ snippet cl
# console.debug
snippet cd
console.debug(${0});
# console.err
snippet ce
console.err(${0});
# console.trace
snippet ct
console.trace(${0:label});

View File

@ -0,0 +1,116 @@
# shebang
snippet #!
#!/usr/bin/env perl6
# Hash Pointer
snippet .
=>
# Function
snippet sub
sub ${1:function_name}(${2:Str $var}) {
${3}
}
snippet mul
multi ${1:function_name}(${2:Str $var}) {
${3}
}
# Conditional
snippet if
if ${1} {
${2}
}
# Conditional if..else
snippet ife
if ${1} {
${2}
}
else {
${3}
}
snippet eif
elsif ${1) {
${2}
}
# Conditional One-line
snippet xif
${1:expression} if ${2:condition};
# Unless conditional
snippet unless
unless ${1} {
${2}
}
# Unless conditional One-line
snippet xunless
${1:expression} unless ${2:condition};
# Ternary conditional
snippet tc
${1:condition} ?? ${2:value-if-true} !! ${3:value-if-false};
# given - when (perl6 switch)
snippet switch
given ${1:$var} {
when ${2:condition} {
${3:# code block ...}
}
${4}
default {
${5}
}
}
# 'loop' - C's for.
snippet loop
loop (my ${1:$i} = 0; $$1 < ${2:count}; $$1++) {
${3}
}
# for loop
snippet for
for ${1:@array} -> ${2:$variable} {
${3}
}
# While Loop
snippet wh
while ${1} {
${2}
}
# Repeat while and repean until
snippet rp
repeat {
${1}
} ${2:while|until} ${3};
# classes ..
snippet cl
${1:my} class ${2:ClassName} ${3:is|does Parent|Role}{
${4}
}
snippet has
has ${1:Type} ${2:$!identifier};
snippet mth
method ${1:method_name}(${2:$attr}) {
${3}
}
snippet pmth
method ${1:!}${2:method_name}(${3:$attr}) {
${4}
}
snippet smth
submethod ${1:submethod_name}(${2:$attr}) {
${3}
}
# Tests
snippet test
use v6;
use Test;
${1:use lib 'lib';}
plan ${2:$num-tests};
# IO
snippet slurp
my ${1:$var} = "${2:filename}".IO.slurp;
snippet rfile
for "${1:filename}".IO.lines -> $line {
${2}
}
snippet open
my $fh = open "${1:filename}", ${2::r|:w|:a};
${3:# actions};
$fh.close;

View File

@ -601,4 +601,5 @@ snippet tc
{
${0:code}
}
snippet te
throw new ${1:Exception}("${2:Error Processing Request}");

View File

@ -221,7 +221,7 @@ snippet package
snippet yumrepo
yumrepo { "${1:repo name}":
Descr => "${2:$1}",
descr => "${2:$1}",
enabled => ${0:1},
}

View File

@ -1,6 +1,9 @@
snippet #!
#!/usr/bin/env python
# -*- coding: utf-8 -*-
snippet #!3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
snippet imp
import ${0:module}
snippet uni
@ -145,6 +148,9 @@ snippet ptpython
# python console debugger (pudb)
snippet pudb
import pudb; pudb.set_trace()
# pdb in nosetests
snippet nosetrace
from nose.tools import set_trace; set_trace()
snippet pprint
import pprint; pprint.pprint(${1})
snippet "

View File

@ -56,11 +56,40 @@ snippet err:
snippet cau:
.. caution::
${0:Watch out!}
#Spinx only
#Sphinx only
snippet sid:
.. sidebar:: ${1:Title}
${0}
snippet tod:
.. todo::
${0}
snippet lis:
.. list-table:: ${0:Title}
:header-rows: 1
:stub-columns: 1
* - x1,y1
- x2,y1
- x3,y1
* - x1,y2
- x2,y2
- x3,y2
* - x1,y3
- x2,y3
- x3,y3
snippet toc:
.. toctree::
:maxdepth: 2
${0}
snippet dow:
:download:`${0:text} <${1:path}>`
snippet ref:
:ref:`${0:text} <${1:path}>`
snippet doc:
:doc:`${0:text} <${1:path}>`
# CJK optimize, CJK has no space between charaters
snippet *c
\ *${1:Emphasis}*\ ${0}

View File

@ -1,12 +1,7 @@
# encoding for Ruby 1.9
snippet enc
# encoding: utf-8
# #!/usr/bin/env ruby
snippet #!
#!/usr/bin/env ruby
# encoding: utf-8
# New Block
snippet =b
=begin rdoc
@ -29,15 +24,12 @@ snippet beg
${0}
rescue ${1:Exception} => ${2:e}
end
snippet req require
require '${1}'
snippet reqr
require_relative '${1}'
snippet #
# =>
snippet end
__END__
snippet case
case ${1:object}
when ${2:condition}
@ -115,7 +107,7 @@ snippet cla class .. end
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
${0}
end
snippet cla class .. initialize .. end
snippet clai class .. initialize .. end
class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
def initialize(${2:args})
${0}

View File

@ -7,6 +7,10 @@ snippet fn "Function definition"
fn ${1:function_name}(${2})${3} {
${0}
}
snippet pfn "Function definition"
pub fn ${1:function_name}(${2})${3} {
${0}
}
snippet test "Unit test function"
#[test]
fn ${1:test_function_name}() {
@ -106,7 +110,7 @@ snippet loop "loop {}" b
loop {
${0}
}
snippet while "while loop"
snippet wh "while loop"
while ${1:condition} {
${0}
}

View File

@ -1,3 +1,5 @@
extends css
snippet $
$${1:variable}: ${0:value};
snippet imp
@ -8,7 +10,7 @@ snippet mix
}
snippet inc
@include ${1:mixin}(${2});
snippet ex
snippet ext
@extend ${0};
snippet fun
@function ${1:name}(${2:args}) {

View File

@ -0,0 +1,122 @@
snippet sm_controller
<?php
namespace Controllers;
use Core\View;
use Core\Controller;
class ${1:class_name} extends Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
${2:}
}
}
snippet sm_model
<?php
namespace Models;
use Core\Model;
class ${1:class_name} extends Model
{
function __construct()
{
parent::__construct();
}
}
snippet sm_model_crud
<?php
namespace Models;
use Core\Model;
class ${1:class_name} extends Model
{
private $${2:table};
function __construct()
{
parent::__construct();
}
public function getRow($where)
{
return $this->db->select('SELECT * FROM '.$table.' WHERE ${3:where}', $data);
}
public function getRows($where)
{
return $this->db->select('SELECT * FROM '.$table.');
}
public function insert($data)
{
$this->db->insert($table, $data);
}
public function update($data, $where)
{
$this->db->update($table ,$data, $where);
}
public function delete($where)
{
$this->db->delete($table, $where);
}
}
snippet sm_render
View::render('${1:view}', $${2:array});
snippet sm_render_template
View::renderTemplate('${1:part}', $${2:array});
# database
snippet sm_db_select
$this->db->select(${1:sql}, ${2:where});
snippet sm_db_insert
$this->db->insert(${1:table}, ${2:data});
snippet sm_db_update
$this->db->update(${1:table}, ${2:data}, ${3:where});
snippet sm_db_delete
$this->db->delete(${1:table}, ${2:where});
snippet sm_db_truncate
$this->db->delete(${1:table});
#session
snippet sm_session_set
Session::set(${1:key}, ${2:value});
snippet sm_session_get
Session::get(${1:key});
snippet sm_session_pull
Session::pull(${1:key});
snippet sm_session_id
Session::id();
snippet sm_session_destroy
Session::set(${1:key});
snippet sm_session_display
Session::display();
#url
snippet sm_url_redirect
Url:redirect('${1:path}');
snippet sm_url_previous
Url:previous();
snippet sm_url_templatepath
Url:templatePath();
snippet sm_url_autolink
Url:autolink('${1:string}');

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
snippet b
(
${0}
)
snippet if
if (${1}) {
${0}
}
snippet ife
if (${1}) {
${2}
} {
${0}
}
snippet for
for (${1:1}, ${2:10}) { |i|
${0}
}
snippet sdef
SynthDef(\\${1:synthName}, {${2}
${0}
}).add;

View File

@ -76,6 +76,14 @@ snippet enum enumerate environment
\begin{enumerate}
\item ${0}
\end{enumerate}
snippet enuma enumerate environment
\begin{enumerate}[(a)]
\item ${0}
\end{enumerate}
snippet enumi enumerate environment
\begin{enumerate}[(i)]
\item ${0}
\end{enumerate}
# Itemize
snippet itemize itemize environment
\begin{itemize}
@ -249,7 +257,7 @@ snippet frac \frac{}{}
snippet sum \sum^{}_{}
\sum^{${1:n}}_{${2:i=1}} ${0}
snippet lim \lim_{}
\lim_{${1:x \to +\infty}} ${0}
\lim_{${1:n \to \infty}} ${0}
snippet frame frame environment
\begin{frame}[${1:t}]{${2:title}}
${0}
@ -275,7 +283,11 @@ snippet col2 two-column environment
${0}
\end{column}
\end{columns}
snippet \{ \{ \}
\\{ ${0} \\}
#delimiter
snippet lr left right
\left${1} ${0} \right$1
snippet lr( left( right)
\left( ${0} \right)
snippet lr| left| right|
@ -286,7 +298,6 @@ snippet lr[ left[ right]
\left[ ${0} \right]
snippet lra langle rangle
\langle ${0} \rangle
# Code listings
snippet lst
\begin{listing}[language=${1:language}]