Clean up snippets
Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
This commit is contained in:
parent
b4ac675773
commit
e27f8d391b
|
@ -21,7 +21,7 @@ require('gitsigns').setup {
|
|||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 100,
|
||||
delay = 500,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100,
|
||||
},
|
||||
|
@ -75,10 +75,9 @@ require('gitsigns').setup {
|
|||
map('n', '<leader>hR', gs.reset_buffer)
|
||||
map('n', '<leader>hp', gs.preview_hunk)
|
||||
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
||||
map('n', '<leader>hd', gs.diffthis)
|
||||
map('n', '<leader>hD', function() gs.diffthis('~') end)
|
||||
map('n', '<leader>td', gs.toggle_deleted)
|
||||
map('n', '<leader>sd', gs.toggle_deleted)
|
||||
map('n', '<leader>hc', gs.select_hunk)
|
||||
|
||||
-- Text object
|
||||
|
|
|
@ -25,7 +25,7 @@ require 'nvim-treesitter.configs'.setup {
|
|||
rainbow = {
|
||||
enable = true,
|
||||
-- list of languages you want to disable the plugin for
|
||||
disable = { 'jsx', 'cpp' },
|
||||
-- disable = { 'jsx', 'cpp' },
|
||||
-- Which query to use for finding delimiters
|
||||
query = 'rainbow-parens',
|
||||
-- Highlight the entire buffer all at once
|
||||
|
|
|
@ -4,6 +4,9 @@ vim.keymap.set("n", "<leader>w", vim.cmd.w)
|
|||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("v", "<Tab>", ">gv")
|
||||
vim.keymap.set("v", "<S-Tab>", "<gv")
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
|
|
@ -1,195 +0,0 @@
|
|||
snippet scode Start basic code for assembly
|
||||
.data
|
||||
|
||||
|
||||
.text
|
||||
|
||||
|
||||
.global main
|
||||
|
||||
|
||||
main:
|
||||
|
||||
|
||||
snippet scodes Start basic code for assembly with _start label
|
||||
.data
|
||||
|
||||
|
||||
.text
|
||||
|
||||
|
||||
.globl _start
|
||||
|
||||
|
||||
_start:
|
||||
|
||||
|
||||
snippet lo Long
|
||||
$1: .long $2
|
||||
snippet wo Word
|
||||
$1: .word $2
|
||||
snippet by Byte
|
||||
$1: .byte $2
|
||||
snippet sp Space
|
||||
$1: .space $2
|
||||
snippet ai Ascii
|
||||
$1: .ascii "$2"
|
||||
snippet az Asciz
|
||||
$1: .asciz "$2"
|
||||
snippet ze Zero
|
||||
$1: .zero "$2"
|
||||
snippet qu Quad
|
||||
$1: .quad "$2"
|
||||
snippet si Single
|
||||
$1: .single "$2"
|
||||
snippet do Double
|
||||
$1: .single "$2"
|
||||
snippet fl Float
|
||||
$1: .single "$2"
|
||||
snippet oc Octa
|
||||
$1: .single "$2"
|
||||
snippet sh Short
|
||||
$1: .single "$2"
|
||||
snippet exit0 Exit without error
|
||||
movl \$1, %eax
|
||||
xorl %ebx, %ebx
|
||||
int \$0x80
|
||||
|
||||
snippet exit Exit with error
|
||||
mov \$1, %eax
|
||||
mov $1, %ebx
|
||||
int \$0x80
|
||||
|
||||
snippet readfstdin Read fixed length text from stdin
|
||||
mov \$3, %eax
|
||||
mov \$2, %ebx
|
||||
mov $1, %ecx
|
||||
mov $2, %edx
|
||||
int \$0x80
|
||||
|
||||
snippet writestdout Write text to stdout
|
||||
mov \$4, %eax
|
||||
mov \$1, %ebx
|
||||
mov $1, %ecx
|
||||
mov $2, %edx
|
||||
int \$0x80
|
||||
|
||||
snippet writestderr Write text to stderr
|
||||
mov \$4, %eax
|
||||
mov \$2, %ebx
|
||||
mov $1, %ecx
|
||||
mov $2, %edx
|
||||
int \$0x80
|
||||
|
||||
snippet * Multiplication
|
||||
mov $1, %eax
|
||||
mul $2
|
||||
|
||||
snippet / Division
|
||||
mov $1, %eax
|
||||
div $2
|
||||
|
||||
snippet jmpl Conditional lower jump
|
||||
cmp $1, $2
|
||||
jl $3
|
||||
|
||||
snippet jmple Conditional lower or equal jump
|
||||
cmp $1, $2
|
||||
jle $3
|
||||
|
||||
snippet jmpe Conditional equal jump
|
||||
cmp $1, $2
|
||||
je $3
|
||||
|
||||
snippet jmpn Conditional not equal jump
|
||||
cmp $1, $2
|
||||
jn $3
|
||||
|
||||
snippet jmpg Conditional greater jump
|
||||
cmp $1, $2
|
||||
jg $3
|
||||
|
||||
snippet jmpge Conditional greater or equal jump
|
||||
cmp $1, $2
|
||||
je $3
|
||||
|
||||
snippet loopn Loop n times
|
||||
mov $1, %ecx
|
||||
|
||||
et_for:
|
||||
$2
|
||||
|
||||
loop et_for
|
||||
|
||||
snippet loopnn Loop n-1 times
|
||||
mov $1, %ecx
|
||||
dec %ecx
|
||||
|
||||
et_for:
|
||||
$2
|
||||
|
||||
loop et_for
|
||||
|
||||
snippet loopv Loop through a vector
|
||||
lea $1, %edi
|
||||
xor %ecx, %ecx
|
||||
|
||||
et_for:
|
||||
cmp %ecx, $2
|
||||
je $3
|
||||
|
||||
$4
|
||||
|
||||
inc %ecx
|
||||
jmp et_for
|
||||
|
||||
snippet mul Multiply
|
||||
xor %edx, %edx
|
||||
mov $1, %eax
|
||||
mul $2
|
||||
snippet mul64 Multiply numbers greater than 2^32
|
||||
mov $1, %edx
|
||||
mov $2, %eax
|
||||
mul $3
|
||||
snippet div Divide
|
||||
xor %edx, %edx
|
||||
mov $1, %eax
|
||||
div $2
|
||||
snippet div64 Divide numbers greater than 2^32
|
||||
mov $1, %edx
|
||||
mov $2, %eax
|
||||
div $3
|
||||
snippet pr Call printf
|
||||
pushl $1
|
||||
call printf
|
||||
popl $2
|
||||
snippet sc Call scanf
|
||||
pushl $1
|
||||
call scanf
|
||||
popl $2
|
||||
snippet mindex Current index from a matrix
|
||||
xor %edx, %edx
|
||||
movl $1, %eax
|
||||
mull $2
|
||||
addl $3, %eax
|
||||
snippet ffl Call fflush
|
||||
pushl \$0
|
||||
call fflush
|
||||
popl $1
|
||||
snippet at Call atoi
|
||||
pushl $1
|
||||
call atoi
|
||||
popl $2
|
||||
snippet len Call strlen
|
||||
pushl $1
|
||||
call strlen
|
||||
popl $2
|
||||
snippet proc Basic procedure
|
||||
$1:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
|
||||
$2
|
||||
|
||||
popl %ebp
|
||||
ret
|
|
@ -1,80 +0,0 @@
|
|||
snippet doc
|
||||
/// ${0}
|
||||
snippet comment
|
||||
// ${0}
|
||||
snippet let
|
||||
let ${1} = ${0}
|
||||
snippet lit
|
||||
[<Literal>]
|
||||
let ${1} = ${0}
|
||||
snippet rec
|
||||
type ${1} = { ${0} }
|
||||
snippet arec
|
||||
{| ${0} |}
|
||||
snippet fn
|
||||
let ${1} =
|
||||
${0}
|
||||
snippet fnr
|
||||
let rec ${1} =
|
||||
${0}
|
||||
snippet lam
|
||||
(fun ${1} -> ${0})
|
||||
snippet mod
|
||||
module ${1} =
|
||||
${0}
|
||||
snippet for
|
||||
for ${1} in ${2} do
|
||||
${0}
|
||||
snippet if
|
||||
if ${1} then
|
||||
${2}
|
||||
snippet ife
|
||||
if ${1} then
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
snippet ifee
|
||||
if ${1} then
|
||||
${2}
|
||||
elif ${3} then
|
||||
${4}
|
||||
else
|
||||
${0}
|
||||
snippet eif
|
||||
elif ${1} then
|
||||
${0}
|
||||
snippet el
|
||||
else
|
||||
${0}
|
||||
snippet try
|
||||
try
|
||||
${1}
|
||||
with ${0}
|
||||
snippet match
|
||||
match ${1} with
|
||||
| ${2} -> ${0}
|
||||
snippet |
|
||||
| ${1} -> ${0}
|
||||
snippet p
|
||||
|> ${0}
|
||||
snippet pr
|
||||
printfn "${1}" ${0}
|
||||
snippet pri
|
||||
printfn \$"${0}"
|
||||
snippet amap
|
||||
|> Array.map (fun ${1} -> ${0})
|
||||
snippet lmap
|
||||
|> List.map (fun ${1} -> ${0})
|
||||
snippet smap
|
||||
|> Seq.map (fun ${1} -> ${0})
|
||||
snippet atap
|
||||
|> Array.map (fun x -> printfn "%A" x; x) // tap
|
||||
snippet ltap
|
||||
|> List.map (fun x -> printfn "%A" x; x) // tap
|
||||
snippet stap
|
||||
|> Seq.map (fun x -> printfn "%A" x; x) // tap
|
||||
snippet main
|
||||
[<EntryPoint>]
|
||||
let main argv =
|
||||
${0}
|
||||
0
|
|
@ -1,858 +0,0 @@
|
|||
# Some useful Unicode entities
|
||||
# Non-Breaking Space
|
||||
snippet nbs
|
||||
|
||||
# ←
|
||||
snippet left
|
||||
←
|
||||
# →
|
||||
snippet right
|
||||
→
|
||||
# ↑
|
||||
snippet up
|
||||
↑
|
||||
# ↓
|
||||
snippet down
|
||||
↓
|
||||
# ↩
|
||||
snippet return
|
||||
↩
|
||||
# ⇤
|
||||
snippet backtab
|
||||
⇤
|
||||
# ⇥
|
||||
snippet tab
|
||||
⇥
|
||||
# ⇧
|
||||
snippet shift
|
||||
⇧
|
||||
# ⌃
|
||||
snippet ctrl
|
||||
⌃
|
||||
# ⌅
|
||||
snippet enter
|
||||
⌅
|
||||
# ⌘
|
||||
snippet cmd
|
||||
⌘
|
||||
# ⌥
|
||||
snippet option
|
||||
⌥
|
||||
# ⌦
|
||||
snippet delete
|
||||
⌦
|
||||
# ⌫
|
||||
snippet backspace
|
||||
⌫
|
||||
# ⎋
|
||||
snippet esc
|
||||
⎋
|
||||
# comment
|
||||
snippet //
|
||||
<!-- ${1} -->${0}
|
||||
# HTML Doctype 4.01 Strict
|
||||
snippet docts
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
# HTML Doctype 4.01 Transitional
|
||||
snippet doct
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
# HTML Doctype 5
|
||||
snippet doct5
|
||||
<!DOCTYPE HTML>
|
||||
# XHTML Doctype 1.0 Frameset
|
||||
snippet docxf
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
||||
# XHTML Doctype 1.0 Strict
|
||||
snippet docxs
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
# XHTML Doctype 1.0 Transitional
|
||||
snippet docxt
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
# XHTML Doctype 1.1
|
||||
snippet docx
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
# Attributes
|
||||
snippet attr
|
||||
${1:attribute}="${0:property}"
|
||||
snippet attr+
|
||||
${1:attribute}="${2:property}" attr+
|
||||
snippet .
|
||||
class="${1}"
|
||||
snippet #
|
||||
id="${1}"
|
||||
snippet alt
|
||||
alt="${1}"
|
||||
snippet charset
|
||||
charset="${1:utf-8}"
|
||||
snippet data
|
||||
data-${1}="${2:$1}"
|
||||
snippet for
|
||||
for="${1}"
|
||||
snippet height
|
||||
height="${1}"
|
||||
snippet href
|
||||
href="${1:#}"
|
||||
snippet lang
|
||||
lang="${1:en}"
|
||||
snippet media
|
||||
media="${1}"
|
||||
snippet name
|
||||
name="${1}"
|
||||
snippet rel
|
||||
rel="${1}"
|
||||
snippet scope
|
||||
scope="${1:row}"
|
||||
snippet src
|
||||
src="${1}"
|
||||
snippet title=
|
||||
title="${1}"
|
||||
snippet type
|
||||
type="${1}"
|
||||
snippet value
|
||||
value="${1}"
|
||||
snippet width
|
||||
width="${1}"
|
||||
# Elements
|
||||
snippet a
|
||||
<a href="${1:#}">${0:$1}</a>
|
||||
snippet a.
|
||||
<a class="${1}" href="${2:#}">${0:$1}</a>
|
||||
snippet a#
|
||||
<a id="${1}" href="${2:#}">${0:$1}</a>
|
||||
snippet a:ext
|
||||
<a href="http://${1:example.com}">${0:$1}</a>
|
||||
snippet a:mail
|
||||
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${0:email me}</a>
|
||||
snippet ac
|
||||
<a href="`@+`">${0:`@+`}</a>
|
||||
snippet abbr
|
||||
<abbr title="${1}">${0}</abbr>
|
||||
snippet address
|
||||
<address>
|
||||
${0}
|
||||
</address>
|
||||
snippet area
|
||||
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${0}">
|
||||
snippet area+
|
||||
<area shape="${1:rect}" coords="${2}" href="${3}" alt="${4}">
|
||||
area+
|
||||
snippet area:c
|
||||
<area shape="circle" coords="${1}" href="${2}" alt="${0}">
|
||||
snippet area:d
|
||||
<area shape="default" coords="${1}" href="${2}" alt="${0}">
|
||||
snippet area:p
|
||||
<area shape="poly" coords="${1}" href="${2}" alt="${0}">
|
||||
snippet area:r
|
||||
<area shape="rect" coords="${1}" href="${2}" alt="${0}">
|
||||
snippet article
|
||||
<article>
|
||||
${0}
|
||||
</article>
|
||||
snippet article.
|
||||
<article class="${1}">
|
||||
${0}
|
||||
</article>
|
||||
snippet article#
|
||||
<article id="${1}">
|
||||
${0}
|
||||
</article>
|
||||
snippet aside
|
||||
<aside>
|
||||
${0}
|
||||
</aside>
|
||||
snippet aside.
|
||||
<aside class="${1}">
|
||||
${0}
|
||||
</aside>
|
||||
snippet aside#
|
||||
<aside id="${1}">
|
||||
${0}
|
||||
</aside>
|
||||
snippet audio
|
||||
<audio src="${1}">${0}</audio>
|
||||
snippet b
|
||||
<b>${0}</b>
|
||||
snippet base
|
||||
<base href="${1}" target="${0}">
|
||||
snippet bdi
|
||||
<bdi>${0}</bdo>
|
||||
snippet bdo
|
||||
<bdo dir="${1}">${0}</bdo>
|
||||
snippet bdo:l
|
||||
<bdo dir="ltr">${0}</bdo>
|
||||
snippet bdo:r
|
||||
<bdo dir="rtl">${0}</bdo>
|
||||
snippet blockquote
|
||||
<blockquote>
|
||||
${0}
|
||||
</blockquote>
|
||||
snippet body
|
||||
<body>
|
||||
${0}
|
||||
</body>
|
||||
snippet br
|
||||
<br>
|
||||
snippet button
|
||||
<button type="${1:submit}">${0}</button>
|
||||
snippet button.
|
||||
<button class="${1:button}" type="${2:submit}">${0}</button>
|
||||
snippet button#
|
||||
<button id="${1}" type="${2:submit}">${0}</button>
|
||||
snippet button:s
|
||||
<button type="submit">${0}</button>
|
||||
snippet button:r
|
||||
<button type="reset">${0}</button>
|
||||
snippet canvas
|
||||
<canvas>
|
||||
${0}
|
||||
</canvas>
|
||||
snippet caption
|
||||
<caption>${0}</caption>
|
||||
snippet cite
|
||||
<cite>${0}</cite>
|
||||
snippet code
|
||||
<code>${0}</code>
|
||||
snippet col
|
||||
<col>
|
||||
snippet colgroup
|
||||
<colgroup>
|
||||
${0}
|
||||
</colgroup>
|
||||
snippet colgroup+
|
||||
<colgroup>
|
||||
<col>
|
||||
col+${0}
|
||||
</colgroup>
|
||||
snippet command
|
||||
<command type="command" label="${1}" icon="${0}">
|
||||
snippet command:c
|
||||
<command type="checkbox" label="${1}" icon="${0}">
|
||||
snippet command:r
|
||||
<command type="radio" radiogroup="${1}" label="${2}" icon="${0}">
|
||||
snippet datagrid
|
||||
<datagrid>
|
||||
${0}
|
||||
</datagrid>
|
||||
snippet datalist
|
||||
<datalist>
|
||||
${0}
|
||||
</datalist>
|
||||
snippet datatemplate
|
||||
<datatemplate>
|
||||
${0}
|
||||
</datatemplate>
|
||||
snippet dd
|
||||
<dd>${0}</dd>
|
||||
snippet dd.
|
||||
<dd class="${1}">${0}</dd>
|
||||
snippet dd#
|
||||
<dd id="${1}">${0}</dd>
|
||||
snippet del
|
||||
<del>${0}</del>
|
||||
snippet details
|
||||
<details>${0}</details>
|
||||
snippet dfn
|
||||
<dfn>${0}</dfn>
|
||||
snippet dialog
|
||||
<dialog>
|
||||
${0}
|
||||
</dialog>
|
||||
snippet div
|
||||
<div>
|
||||
${0}
|
||||
</div>
|
||||
snippet div.
|
||||
<div class="${1}">
|
||||
${0}
|
||||
</div>
|
||||
snippet div#
|
||||
<div id="${1}">
|
||||
${0}
|
||||
</div>
|
||||
snippet dl
|
||||
<dl>
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl.
|
||||
<dl class="${1}">
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl#
|
||||
<dl id="${1}">
|
||||
${0}
|
||||
</dl>
|
||||
snippet dl+
|
||||
<dl>
|
||||
<dt>${1}</dt>
|
||||
<dd>${2}</dd>
|
||||
dt+${0}
|
||||
</dl>
|
||||
snippet dt
|
||||
<dt>${0}</dt>
|
||||
snippet dt.
|
||||
<dt class="${1}">${0}</dt>
|
||||
snippet dt#
|
||||
<dt id="${1}">${0}</dt>
|
||||
snippet dt+
|
||||
<dt>${1}</dt>
|
||||
<dd>${2}</dd>
|
||||
dt+${0}
|
||||
snippet em
|
||||
<em>${0}</em>
|
||||
snippet embed
|
||||
<embed src="${1}" type="${0}">
|
||||
snippet fieldset
|
||||
<fieldset>
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset.
|
||||
<fieldset class="${1}">
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset#
|
||||
<fieldset id="${1}">
|
||||
${0}
|
||||
</fieldset>
|
||||
snippet fieldset+
|
||||
<fieldset>
|
||||
<legend><span>${1}</span></legend>
|
||||
${2}
|
||||
</fieldset>
|
||||
fieldset+${0}
|
||||
snippet figcaption
|
||||
<figcaption>${0}</figcaption>
|
||||
snippet figure
|
||||
<figure>${0}</figure>
|
||||
snippet figure#
|
||||
<figure id="${1}">
|
||||
${0}
|
||||
</figure>
|
||||
snippet figure.
|
||||
<figure class="${1}">
|
||||
${0}
|
||||
</figure>
|
||||
snippet footer
|
||||
<footer>
|
||||
${0}
|
||||
</footer>
|
||||
snippet footer.
|
||||
<footer class="${1}">
|
||||
${0}
|
||||
</footer>
|
||||
snippet footer#
|
||||
<footer id="${1}">
|
||||
${0}
|
||||
</footer>
|
||||
snippet form
|
||||
<form action="${1}" method="${2:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet form.
|
||||
<form class="${1}" action="${2}" method="${3:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet form#
|
||||
<form id="${1}" action="${2}" method="${3:post}">
|
||||
${0}
|
||||
</form>
|
||||
snippet h1
|
||||
<h1>${0}</h1>
|
||||
snippet h1.
|
||||
<h1 class="${1}">${0}</h1>
|
||||
snippet h1#
|
||||
<h1 id="${1}">${0}</h1>
|
||||
snippet h2
|
||||
<h2>${0}</h2>
|
||||
snippet h2.
|
||||
<h2 class="${1}">${0}</h2>
|
||||
snippet h2#
|
||||
<h2 id="${1}">${0}</h2>
|
||||
snippet h3
|
||||
<h3>${0}</h3>
|
||||
snippet h3.
|
||||
<h3 class="${1}">${0}</h3>
|
||||
snippet h3#
|
||||
<h3 id="${1}">${0}</h3>
|
||||
snippet h4
|
||||
<h4>${0}</h4>
|
||||
snippet h4.
|
||||
<h4 class="${1}">${0}</h4>
|
||||
snippet h4#
|
||||
<h4 id="${1}">${0}</h4>
|
||||
snippet h5
|
||||
<h5>${0}</h5>
|
||||
snippet h5.
|
||||
<h5 class="${1}">${0}</h5>
|
||||
snippet h5#
|
||||
<h5 id="${1}">${0}</h5>
|
||||
snippet h6
|
||||
<h6>${0}</h6>
|
||||
snippet h6.
|
||||
<h6 class="${1}">${0}</h6>
|
||||
snippet h6#
|
||||
<h6 id="${1}">${0}</h6>
|
||||
snippet head
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
${0}
|
||||
</head>
|
||||
snippet header
|
||||
<header>
|
||||
${0}
|
||||
</header>
|
||||
snippet header.
|
||||
<header class="${1}">
|
||||
${0}
|
||||
</header>
|
||||
snippet header#
|
||||
<header id="${1}">
|
||||
${0}
|
||||
</header>
|
||||
snippet hgroup
|
||||
<hgroup>
|
||||
${0}
|
||||
</hgroup>
|
||||
snippet hgroup.
|
||||
<hgroup class="${1}>
|
||||
${0}
|
||||
</hgroup>
|
||||
snippet hr
|
||||
<hr>
|
||||
snippet html
|
||||
<html>
|
||||
${0}
|
||||
</html>
|
||||
snippet xhtml
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
${0}
|
||||
</html>
|
||||
snippet html5
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
</head>
|
||||
<body>
|
||||
$0
|
||||
</body>
|
||||
</html>
|
||||
snippet html5l
|
||||
<!DOCTYPE html>
|
||||
<html lang="${1:en}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>${2:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
${3:link}
|
||||
</head>
|
||||
<body>
|
||||
$0
|
||||
</body>
|
||||
</html>
|
||||
snippet i
|
||||
<i>${0}</i>
|
||||
snippet iframe
|
||||
<iframe src="${1}" frameborder="0"></iframe>
|
||||
snippet iframe.
|
||||
<iframe class="${1}" src="${2}" frameborder="0"></iframe>
|
||||
snippet iframe#
|
||||
<iframe id="${1}" src="${2}" frameborder="0"></iframe>
|
||||
snippet img
|
||||
<img src="${1}" alt="${2}">
|
||||
snippet img.
|
||||
<img class="${1}" src="${2}" alt="${3}">
|
||||
snippet img#
|
||||
<img id="${1}" src="${2}" alt="${3}">
|
||||
snippet input
|
||||
<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}">
|
||||
snippet input:text
|
||||
<input type="text" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:submit
|
||||
<input type="submit" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:hidden
|
||||
<input type="hidden" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:button
|
||||
<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}">
|
||||
snippet input:checkbox
|
||||
<input type="checkbox" name="${1}" id="${2:$1}">
|
||||
snippet input:radio
|
||||
<input type="radio" name="${1}" id="${2:$1}">
|
||||
snippet input:color
|
||||
<input type="color" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:date
|
||||
<input type="date" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:datetime
|
||||
<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}">
|
||||
snippet input:email
|
||||
<input type="email" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:file
|
||||
<input type="file" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:month
|
||||
<input type="month" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:number
|
||||
<input type="number" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:password
|
||||
<input type="password" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:range
|
||||
<input type="range" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:reset
|
||||
<input type="reset" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:search
|
||||
<input type="search" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:time
|
||||
<input type="time" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:url
|
||||
<input type="url" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet input:week
|
||||
<input type="week" name="${1}" id="${2:$1}" value="${3}">
|
||||
snippet ins
|
||||
<ins>${0}</ins>
|
||||
snippet kbd
|
||||
<kbd>${0}</kbd>
|
||||
snippet label
|
||||
<label for="${0:$1}">${1}</label>
|
||||
snippet label:i
|
||||
<label for="${2:$1}">${1}</label>
|
||||
<input type="${3:text/submit/hidden/button}" name="${4:$2}" id="${5:$2}" value="${6}" />
|
||||
snippet label:s
|
||||
<label for="${2:$1}">${1}</label>
|
||||
<select name="${3:$2}" id="${4:$2}">
|
||||
<option value="${5}">${0:$5}</option>
|
||||
</select>
|
||||
snippet legend
|
||||
<legend>${0}</legend>
|
||||
snippet legend+
|
||||
<legend><span>${0}</span></legend>
|
||||
snippet li
|
||||
<li>${0}</li>
|
||||
snippet li.
|
||||
<li class="${1}">${0}</li>
|
||||
snippet li+
|
||||
<li>${1}</li>
|
||||
li+
|
||||
snippet lia
|
||||
<li><a href="${0:#}">${1}</a></li>
|
||||
snippet lia+
|
||||
<li><a href="${2:#}">${1}</a></li>
|
||||
lia+
|
||||
snippet link
|
||||
<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">
|
||||
snippet link:s
|
||||
<link rel="stylesheet" href="${1:style.css}">
|
||||
snippet link:css
|
||||
<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">
|
||||
snippet link:rss
|
||||
<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}">
|
||||
snippet main
|
||||
<main role="main">
|
||||
${0}
|
||||
</main>
|
||||
snippet map
|
||||
<map name="${1}">
|
||||
${0}
|
||||
</map>
|
||||
snippet map.
|
||||
<map class="${1}" name="${2}">
|
||||
${0}
|
||||
</map>
|
||||
snippet map#
|
||||
<map name="${1}" id="${2:$1}>
|
||||
${0}
|
||||
</map>
|
||||
snippet map+
|
||||
<map name="${1}">
|
||||
<area shape="${2}" coords="${3}" href="${4}" alt="${5}" />${6}
|
||||
</map>
|
||||
snippet mark
|
||||
<mark>${0}</mark>
|
||||
snippet menu
|
||||
<menu>
|
||||
${0}
|
||||
</menu>
|
||||
snippet menu:c
|
||||
<menu type="context">
|
||||
${0}
|
||||
</menu>
|
||||
snippet menu:t
|
||||
<menu type="toolbar">
|
||||
${0}
|
||||
</menu>
|
||||
snippet meta
|
||||
<meta http-equiv="${1}" content="${2}">
|
||||
snippet meta:s
|
||||
<meta ${0}>
|
||||
snippet meta:d
|
||||
<meta name="description" content="${0}">
|
||||
snippet meta:compat
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}">
|
||||
snippet meta:refresh
|
||||
<meta http-equiv="refresh" content="3;url=${0}">
|
||||
snippet meta:utf5
|
||||
<meta charset="utf-8">
|
||||
snippet meta:utf
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
|
||||
snippet meter
|
||||
<meter>${0}</meter>
|
||||
snippet nav
|
||||
<nav>
|
||||
${0}
|
||||
</nav>
|
||||
snippet nav.
|
||||
<nav class="${1}">
|
||||
${0}
|
||||
</nav>
|
||||
snippet nav#
|
||||
<nav id="${1}">
|
||||
${0}
|
||||
</nav>
|
||||
snippet noscript
|
||||
<noscript>
|
||||
${0}
|
||||
</noscript>
|
||||
snippet object
|
||||
<object data="${1}" type="${2}">
|
||||
${3}
|
||||
</object>
|
||||
# Embed QT Movie
|
||||
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">
|
||||
<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/">
|
||||
</object>
|
||||
snippet ol
|
||||
<ol>
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol.
|
||||
<ol class="${1}">
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol#
|
||||
<ol id="${1}">
|
||||
${0}
|
||||
</ol>
|
||||
snippet ol+
|
||||
<ol>
|
||||
<li>${1}</li>
|
||||
li+${0}
|
||||
</ol>
|
||||
snippet opt
|
||||
<option value="${1}">${0:$1}</option>
|
||||
snippet opt+
|
||||
<option value="${1}">${2:$1}</option>
|
||||
opt+${0}
|
||||
snippet optt
|
||||
<option>${0}</option>
|
||||
snippet optgroup
|
||||
<optgroup>
|
||||
<option value="${1}">${2:$1}</option>
|
||||
opt+${0}
|
||||
</optgroup>
|
||||
snippet output
|
||||
<output>${0}</output>
|
||||
snippet p
|
||||
<p>${0}</p>
|
||||
snippet p.
|
||||
<p class="${1}">${0}</p>
|
||||
snippet p#
|
||||
<p id="${1}">${0}</p>
|
||||
snippet param
|
||||
<param name="${1}" value="${2}">
|
||||
snippet pre
|
||||
<pre>
|
||||
${0}
|
||||
</pre>
|
||||
snippet progress
|
||||
<progress>${0}</progress>
|
||||
snippet q
|
||||
<q>${0}</q>
|
||||
snippet rp
|
||||
<rp>${0}</rp>
|
||||
snippet rt
|
||||
<rt>${0}</rt>
|
||||
snippet ruby
|
||||
<ruby>
|
||||
<rp><rt>${0}</rt></rp>
|
||||
</ruby>
|
||||
snippet s
|
||||
<s>${0}</s>
|
||||
snippet samp
|
||||
<samp>
|
||||
${0}
|
||||
</samp>
|
||||
snippet script
|
||||
<script>
|
||||
${0}
|
||||
</script>
|
||||
snippet scripts
|
||||
<script src="${0}.js"></script>
|
||||
snippet scriptt
|
||||
<script type="${1}" id="${2}">
|
||||
${0}
|
||||
</script>
|
||||
snippet scriptsrc
|
||||
<script src="${0}.js" charset="utf-8"></script>
|
||||
snippet section
|
||||
<section>
|
||||
${0}
|
||||
</section>
|
||||
snippet section.
|
||||
<section class="${1}">
|
||||
${0}
|
||||
</section>
|
||||
snippet section#
|
||||
<section id="${1}">
|
||||
${0}
|
||||
</section>
|
||||
snippet select
|
||||
<select name="${1}" id="${2:$1}">
|
||||
${0}
|
||||
</select>
|
||||
snippet select.
|
||||
<select name="${1}" id="${2:$1}" class="${3}>
|
||||
${0}
|
||||
</select>
|
||||
snippet select+
|
||||
<select name="${1}" id="${2:$1}">
|
||||
<option value="${3}">${4:$3}</option>
|
||||
opt+${0}
|
||||
</select>
|
||||
snippet small
|
||||
<small>${0}</small>
|
||||
snippet source
|
||||
<source src="${1}" type="${2}" media="${0}">
|
||||
snippet span
|
||||
<span>${0}</span>
|
||||
snippet span.
|
||||
<span class="${1}">${0}</span>
|
||||
snippet span#
|
||||
<span id="${1}">${0}</span>
|
||||
snippet strong
|
||||
<strong>${0}</strong>
|
||||
snippet style
|
||||
<style type="text/css" media="${1:all}">
|
||||
${0}
|
||||
</style>
|
||||
snippet sub
|
||||
<sub>${0}</sub>
|
||||
snippet summary
|
||||
<summary>
|
||||
${0}
|
||||
</summary>
|
||||
snippet sup
|
||||
<sup>${0}</sup>
|
||||
snippet table
|
||||
<table>
|
||||
${0}
|
||||
</table>
|
||||
snippet table.
|
||||
<table class="${1}">
|
||||
${0}
|
||||
</table>
|
||||
snippet table#
|
||||
<table id="${1}">
|
||||
${0}
|
||||
</table>
|
||||
snippet tbody
|
||||
<tbody>
|
||||
${0}
|
||||
</tbody>
|
||||
snippet td
|
||||
<td>${0}</td>
|
||||
snippet td.
|
||||
<td class="${1}">${0}</td>
|
||||
snippet td#
|
||||
<td id="${1}">${0}</td>
|
||||
snippet td+
|
||||
<td>${1}</td>
|
||||
td+${0}
|
||||
snippet textarea
|
||||
<textarea name="${1}" id="${2:$1}" rows="${3:8}" cols="${4:40}">${5}</textarea>
|
||||
snippet tfoot
|
||||
<tfoot>
|
||||
${0}
|
||||
</tfoot>
|
||||
snippet th
|
||||
<th>${0}</th>
|
||||
snippet th.
|
||||
<th class="${1}">${0}</th>
|
||||
snippet th#
|
||||
<th id="${1}">${0}</th>
|
||||
snippet th+
|
||||
<th>${1}</th>
|
||||
th+${0}
|
||||
snippet thead
|
||||
<thead>
|
||||
${0}
|
||||
</thead>
|
||||
snippet time
|
||||
<time datetime="${1}" pubdate="${2:$1}">${0:$1}</time>
|
||||
snippet title
|
||||
<title>${0:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
||||
snippet tr
|
||||
<tr>
|
||||
${0}
|
||||
</tr>
|
||||
snippet tr+
|
||||
<tr>
|
||||
<td>${1}</td>
|
||||
td+${0}
|
||||
</tr>
|
||||
snippet track
|
||||
<track src="${1}" srclang="${2}" label="${3}" default="${4:default}>${5}
|
||||
snippet ul
|
||||
<ul>
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul.
|
||||
<ul class="${1}">
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul#
|
||||
<ul id="${1}">
|
||||
${0}
|
||||
</ul>
|
||||
snippet ul+
|
||||
<ul>
|
||||
<li>${1}</li>
|
||||
li+${0}
|
||||
</ul>
|
||||
snippet var
|
||||
<var>${0}</var>
|
||||
snippet video
|
||||
<video src="${1}" height="${2}" width="${3}" preload="${4:none}" autoplay="${5:autoplay}">${6}</video>
|
||||
snippet video.
|
||||
<video class="${1}" src="${2}" height="${3}" width="${4}" preload="${5:none}" autoplay="${6:autoplay}">${7}</video>
|
||||
snippet wbr
|
||||
<wbr>
|
||||
snippet viewport
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@ -1,297 +0,0 @@
|
|||
## Access Modifiers
|
||||
snippet po
|
||||
protected ${0}
|
||||
snippet pu
|
||||
public ${0}
|
||||
snippet pr
|
||||
private ${0}
|
||||
##
|
||||
## Annotations
|
||||
snippet before
|
||||
@Before
|
||||
static void ${1:intercept}(${2:args}) { ${0} }
|
||||
snippet mm
|
||||
@ManyToMany
|
||||
${0}
|
||||
snippet mo
|
||||
@ManyToOne
|
||||
${0}
|
||||
snippet om
|
||||
@OneToMany${1:(cascade=CascadeType.ALL)}
|
||||
${0}
|
||||
snippet oo
|
||||
@OneToOne
|
||||
${1}
|
||||
##
|
||||
## Basic Java packages and import
|
||||
snippet im
|
||||
import ${0}
|
||||
snippet j.b
|
||||
java.beans.
|
||||
snippet j.i
|
||||
java.io.
|
||||
snippet j.m
|
||||
java.math.
|
||||
snippet j.n
|
||||
java.net.
|
||||
snippet j.u
|
||||
java.util.
|
||||
##
|
||||
## Class
|
||||
snippet cl
|
||||
class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
|
||||
snippet pcl
|
||||
public class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
|
||||
snippet in
|
||||
interface ${1:`vim_snippets#Filename("$1", "untitled")`} ${2:extends Parent}
|
||||
snippet tc
|
||||
public class ${1:`vim_snippets#Filename("$1")`} extends ${0:TestCase}
|
||||
##
|
||||
## Class Enhancements
|
||||
snippet ext
|
||||
extends ${0}
|
||||
snippet imp
|
||||
implements ${0}
|
||||
##
|
||||
## Comments
|
||||
snippet /*
|
||||
/*
|
||||
* ${0}
|
||||
*/
|
||||
##
|
||||
## Constants
|
||||
snippet co
|
||||
static public final ${1:String} ${2:var} = ${3};
|
||||
snippet cos
|
||||
static public final String ${1:var} = "${2}";
|
||||
##
|
||||
## Control Statements
|
||||
snippet case
|
||||
case ${1}:
|
||||
${0}
|
||||
snippet def
|
||||
default:
|
||||
${0}
|
||||
snippet el
|
||||
else
|
||||
snippet eif
|
||||
else if (${1}) ${0}
|
||||
snippet if
|
||||
if (${1}) ${0}
|
||||
snippet sw
|
||||
switch (${1}) {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Create a Method
|
||||
snippet m
|
||||
${1:void} ${2:method}(${3}) ${4:throws }
|
||||
##
|
||||
## Create a Variable
|
||||
snippet v
|
||||
${1:String} ${2:var}${3: = null}${4};
|
||||
##
|
||||
## Declaration for ArrayList
|
||||
snippet d.al
|
||||
List<${1:Object}> ${2:list} = new ArrayList<$1>();${0}
|
||||
## Declaration for HashMap
|
||||
snippet d.hm
|
||||
Map<${1:Object}, ${2:Object}> ${3:map} = new HashMap<$1, $2>();${0}
|
||||
## Declaration for HashSet
|
||||
snippet d.hs
|
||||
Set<${1:Object}> ${2:set} = new HashSet<$1>();${0}
|
||||
## Declaration for Stack
|
||||
snippet d.st
|
||||
Stack<${1:Object}> ${2:stack} = new Stack<$1>();${0}
|
||||
##
|
||||
## Singleton Pattern
|
||||
snippet singlet
|
||||
private static class Holder {
|
||||
private static final ${1:`vim_snippets#Filename("$1")`} INSTANCE = new $1();
|
||||
}
|
||||
|
||||
private $1() { }
|
||||
|
||||
public static $1 getInstance() {
|
||||
return Holder.INSTANCE;
|
||||
}
|
||||
##
|
||||
## Enhancements to Methods, variables, classes, etc.
|
||||
snippet ab
|
||||
abstract ${0}
|
||||
snippet fi
|
||||
final ${0}
|
||||
snippet st
|
||||
static ${0}
|
||||
snippet sy
|
||||
synchronized ${0}
|
||||
##
|
||||
## Error Methods
|
||||
snippet err
|
||||
System.err.print("${0:Message}");
|
||||
snippet errf
|
||||
System.err.printf("${1:Message}", ${0:exception});
|
||||
snippet errln
|
||||
System.err.println("${0:Message}");
|
||||
##
|
||||
## Exception Handling
|
||||
snippet as
|
||||
assert ${1:test} : "${2:Failure message}";
|
||||
snippet ae
|
||||
assertEquals("${1:Failure message}", ${2:expected}, ${3:actual});
|
||||
snippet aae
|
||||
assertArrayEquals("${1:Failure message}", ${2:expecteds}, ${3:actuals});
|
||||
snippet af
|
||||
assertFalse("${1:Failure message}", $2);
|
||||
snippet at
|
||||
assertTrue("${1:Failure message}", $2);
|
||||
snippet an
|
||||
assertNull("${1:Failure message}", ${2:object});
|
||||
snippet ann
|
||||
assertNotNull("${1:Failure message}", ${2:object});
|
||||
snippet ass
|
||||
assertSame("${1:Failure message}", ${2:expected}, ${3:actual});
|
||||
snippet asns
|
||||
assertNotSame("${1:Failure message}", ${2:expected}, ${3:actual});
|
||||
snippet fa
|
||||
fail("${1:Failure message}");
|
||||
snippet ca
|
||||
catch(${1:Exception} ${2:e}) ${0}
|
||||
snippet thr
|
||||
throw ${0}
|
||||
snippet ths
|
||||
throws ${0}
|
||||
snippet try
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch(${1:Exception} ${2:e}) {
|
||||
}
|
||||
snippet tryf
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch(${1:Exception} ${2:e}) {
|
||||
} finally {
|
||||
}
|
||||
##
|
||||
## Find Methods
|
||||
snippet findall
|
||||
List<${1:listName}> ${2:items} = $1.findAll();
|
||||
snippet findbyid
|
||||
${1:var} ${2:item} = $1.findById(${3});
|
||||
##
|
||||
## Javadocs
|
||||
snippet /**
|
||||
/**
|
||||
* ${0}
|
||||
*/
|
||||
snippet @au
|
||||
@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`
|
||||
snippet @br
|
||||
@brief ${0:Description}
|
||||
snippet @fi
|
||||
@file ${0:`vim_snippets#Filename("$1")`}.java
|
||||
snippet @pa
|
||||
@param ${0:param}
|
||||
snippet @re
|
||||
@return ${0:param}
|
||||
##
|
||||
## Logger Methods
|
||||
snippet debug
|
||||
Logger.debug(${1:param});
|
||||
snippet error
|
||||
Logger.error(${1:param});
|
||||
snippet info
|
||||
Logger.info(${1:param});
|
||||
snippet warn
|
||||
Logger.warn(${1:param});
|
||||
##
|
||||
## Loops
|
||||
snippet enfor
|
||||
for (${1} : ${2}) ${0}
|
||||
snippet for
|
||||
for (${1}; ${2}; ${3}) ${0}
|
||||
snippet wh
|
||||
while (${1:true}) ${0}
|
||||
snippet wht
|
||||
while (true) ${0}
|
||||
##
|
||||
## Main method
|
||||
snippet psvm
|
||||
public static void main (String[] args) {
|
||||
${0}
|
||||
}
|
||||
snippet main
|
||||
public static void main (String[] args) {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Print Methods
|
||||
snippet sout
|
||||
System.out.println(${0});
|
||||
snippet serr
|
||||
System.err.println(${0});
|
||||
snippet print
|
||||
System.out.print("${0:Message}");
|
||||
snippet printf
|
||||
System.out.printf("${1:Message}", ${0:args});
|
||||
snippet println
|
||||
System.out.println(${0});
|
||||
snippet printlna
|
||||
System.out.println(Arrays.toString(${0}));
|
||||
##
|
||||
## Render Methods
|
||||
snippet ren
|
||||
render(${1:param});
|
||||
snippet rena
|
||||
renderArgs.put("${1}", ${2});
|
||||
snippet renb
|
||||
renderBinary(${1:param});
|
||||
snippet renj
|
||||
renderJSON(${1:param});
|
||||
snippet renx
|
||||
renderXml(${1:param});
|
||||
##
|
||||
## Setter and Getter Methods
|
||||
snippet set
|
||||
${1:public} void set${3:}(${2:String} ${0:}){
|
||||
this.$4 = $4;
|
||||
}
|
||||
snippet get
|
||||
${1:public} ${2:String} get${3:}(){
|
||||
return this.${0:};
|
||||
}
|
||||
##
|
||||
## Terminate Methods or Loops
|
||||
snippet re
|
||||
return ${0}
|
||||
snippet br
|
||||
break;
|
||||
##
|
||||
## Test Methods
|
||||
snippet t
|
||||
public void test${1:Name}() throws Exception {
|
||||
${0}
|
||||
}
|
||||
snippet test
|
||||
@Test
|
||||
public void test${1:Name}() throws Exception {
|
||||
${0}
|
||||
}
|
||||
##
|
||||
## Utils
|
||||
snippet Sc
|
||||
Scanner
|
||||
##
|
||||
## Miscellaneous
|
||||
snippet action
|
||||
public static void ${1:index}(${2:args}) { ${0} }
|
||||
snippet rnf
|
||||
notFound(${1:param});
|
||||
snippet rnfin
|
||||
notFoundIfNull(${1:param});
|
||||
snippet rr
|
||||
redirect(${1:param});
|
||||
snippet ru
|
||||
unauthorized(${1:param});
|
||||
snippet unless
|
||||
(unless=${1:param});
|
|
@ -1,72 +0,0 @@
|
|||
snippet #!
|
||||
#!/usr/bin/env lua
|
||||
$1
|
||||
snippet local
|
||||
local ${1:x} = ${0:1}
|
||||
snippet fun
|
||||
function ${1:fname}(${2:...})
|
||||
$0
|
||||
end
|
||||
snippet for
|
||||
for ${1:i}=${2:1},${3:10} do
|
||||
${0:print(i)}
|
||||
end
|
||||
snippet forp
|
||||
for ${1:i},${2:v} in pairs(${3:table_name}) do
|
||||
$0
|
||||
end
|
||||
snippet fori
|
||||
for ${1:i},${2:v} in ipairs(${3:table_name}) do
|
||||
$0
|
||||
end
|
||||
snippet if
|
||||
if $1 then
|
||||
$2
|
||||
end
|
||||
snippet ife
|
||||
if $1 then
|
||||
${2:-- if condition}
|
||||
else
|
||||
${0:-- else}
|
||||
end
|
||||
snippet elif
|
||||
elseif $1 then
|
||||
$0
|
||||
snippet repeat
|
||||
repeat
|
||||
$1
|
||||
until $0
|
||||
snippet while
|
||||
while $1 do
|
||||
$0
|
||||
end
|
||||
snippet wh
|
||||
while ${1:true} do
|
||||
${0}
|
||||
end
|
||||
snippet wht
|
||||
while true do
|
||||
${0}
|
||||
end
|
||||
snippet print
|
||||
print("${1:string}")
|
||||
snippet pr
|
||||
print($0)
|
||||
snippet prs
|
||||
print("$0")
|
||||
snippet prf
|
||||
print(string.format("${1:%s}"$0))
|
||||
snippet wr
|
||||
io.write($0)
|
||||
snippet wrs
|
||||
io.write("$0")
|
||||
snippet wrf
|
||||
io.write(string.format("${1:%s}"$0))
|
||||
snippet fwr
|
||||
io.${1:stderr}:write($0)
|
||||
snippet fwrs
|
||||
io.${1:stderr}:write("$0")
|
||||
snippet fwrf
|
||||
io.${1:stderr}:write(string.format("${2:%s}"$0))
|
||||
snippet req
|
||||
require('${1:mod}')
|
|
@ -1,690 +0,0 @@
|
|||
snippet <?
|
||||
<?php
|
||||
|
||||
${0:${VISUAL}}
|
||||
snippet dst "declare(strict_types=1)"
|
||||
declare(strict_types=${1:1});
|
||||
snippet ec
|
||||
echo ${0};
|
||||
snippet <?e
|
||||
<?php echo ${0} ?>
|
||||
# this one is for php5.4
|
||||
snippet <?=
|
||||
<?=${0}?>
|
||||
snippet ?=
|
||||
<?= ${0} ?>
|
||||
snippet ?
|
||||
<?php ${0} ?>
|
||||
snippet ?f
|
||||
<?php foreach ($${1:vars} as $${2:$var}): ?>
|
||||
${0:${VISUAL}}
|
||||
<?php endforeach ?>
|
||||
snippet ?i
|
||||
<?php if ($${1:var}): ?>
|
||||
${0:${VISUAL}}
|
||||
<?php endif ?>
|
||||
snippet ns
|
||||
namespace ${1:Foo\Bar\Baz};
|
||||
|
||||
${0:${VISUAL}}
|
||||
snippet c
|
||||
class ${1:`vim_snippets#Filename()`}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet i
|
||||
interface ${1:`vim_snippets#Filename()`}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet t.
|
||||
\$this->
|
||||
snippet f
|
||||
function ${1}(${3})
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# method
|
||||
snippet m
|
||||
${1:protected} function ${2:foo}()
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet sm "PHP Class Setter"
|
||||
/**
|
||||
* Sets the value of ${1:foo}
|
||||
*
|
||||
* @param ${2:string} $$1 ${3:description}
|
||||
*
|
||||
* @return ${4:`vim_snippets#Filename()`}
|
||||
*/
|
||||
${5:public} function set${6:$1}(${7:$2 }$$1)
|
||||
{
|
||||
$this->${8:$1} = $$1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
snippet gm "PHP Class Getter Setter"
|
||||
/**
|
||||
* Gets the value of ${1:foo}
|
||||
*
|
||||
* @return ${2:string}
|
||||
*/
|
||||
${3:public} function get${4:$1}()
|
||||
{
|
||||
return $this->${5:$1};
|
||||
}
|
||||
#setter
|
||||
snippet $s
|
||||
${1:$foo}->set${2:Bar}(${0});
|
||||
#getter
|
||||
snippet $g
|
||||
${1:$foo}->get${0:Bar}();
|
||||
# Tertiary conditional
|
||||
snippet =?:
|
||||
$${1:foo} = ${2:true} ? ${3:a} : ${0};
|
||||
snippet ?:
|
||||
${1:true} ? ${2:a} : ${0}
|
||||
snippet t "$retVal = (condition) ? a : b"
|
||||
$${1:retVal} = ($2) ? ${3:a} : ${4:b};
|
||||
# Predefined variables
|
||||
snippet C
|
||||
$_COOKIE['${1:variable}']
|
||||
snippet E
|
||||
$_ENV['${1:variable}']
|
||||
snippet F
|
||||
$_FILES['${1:variable}']
|
||||
snippet G "_GET array"
|
||||
$_GET['${1:variable}']
|
||||
snippet P "_POST array"
|
||||
$_POST['${1:variable}']
|
||||
snippet R
|
||||
$_REQUEST['${1:variable}']
|
||||
snippet S
|
||||
$_SERVER['${1:variable}']
|
||||
snippet SS
|
||||
$_SESSION['${1:variable}']
|
||||
snippet get "get"
|
||||
$_GET['${1}']
|
||||
snippet post "post"
|
||||
$_POST['${1}']
|
||||
snippet session "session"
|
||||
$_SESSION['${1}']
|
||||
# the following are old ones
|
||||
snippet inc
|
||||
include '${1:file}';
|
||||
snippet inc1
|
||||
include_once '${1:file}';
|
||||
snippet req
|
||||
require '${1:file}';
|
||||
snippet req1
|
||||
require_once '${1:file}';
|
||||
# Start Docblock
|
||||
snippet /*
|
||||
/**
|
||||
* ${0}
|
||||
*/
|
||||
# Class - post doc
|
||||
snippet doc_cp
|
||||
/**
|
||||
* ${1:undocumented class}
|
||||
*
|
||||
* @package ${2:default}
|
||||
* @subpackage ${3:default}
|
||||
* @author ${4:`g:snips_author`}
|
||||
*/
|
||||
# Class Variable - post doc
|
||||
snippet doc_vp
|
||||
/**
|
||||
* ${1:undocumented class variable}
|
||||
*
|
||||
* @var ${2:string}
|
||||
*/
|
||||
# Class Variable
|
||||
snippet doc_v
|
||||
/**
|
||||
* ${3:undocumented class variable}
|
||||
*
|
||||
* @var ${4:string}
|
||||
*/
|
||||
${1:var} $${2};
|
||||
|
||||
# Class attribute with short comment
|
||||
snippet att
|
||||
/** @var ${3:string} */
|
||||
${1:public} $${2};
|
||||
|
||||
# Class
|
||||
snippet doc_c
|
||||
/**
|
||||
* ${3:undocumented class}
|
||||
*
|
||||
* @package ${4:default}
|
||||
* @subpackage ${5:default}
|
||||
* @author ${6:`g:snips_author`}
|
||||
*/
|
||||
${1:}class ${2:}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
} // END $1class $2
|
||||
# Constant Definition - post doc
|
||||
snippet doc_dp
|
||||
/**
|
||||
* ${1:undocumented constant}
|
||||
*/
|
||||
# Constant Definition
|
||||
snippet doc_d
|
||||
/**
|
||||
* ${3:undocumented constant}
|
||||
*/
|
||||
define(${1}, ${2});
|
||||
# Function - post doc
|
||||
snippet doc_fp
|
||||
/**
|
||||
* ${1:undocumented function}
|
||||
*
|
||||
* @return ${2:void}
|
||||
* @author ${3:`g:snips_author`}
|
||||
*/
|
||||
# Function signature
|
||||
snippet doc_s
|
||||
/**
|
||||
* ${4:undocumented function}
|
||||
*
|
||||
* @return ${5:void}
|
||||
* @author ${6:`g:snips_author`}
|
||||
*/
|
||||
${1}function ${2}(${3});
|
||||
# Function
|
||||
snippet doc_f
|
||||
/**
|
||||
* ${4:undocumented function}
|
||||
*
|
||||
* @return ${5:void}
|
||||
* @author ${6:`g:snips_author`}
|
||||
*/
|
||||
${1}function ${2}(${3})
|
||||
{${0}
|
||||
}
|
||||
# Header
|
||||
snippet doc_h
|
||||
/**
|
||||
* ${1}
|
||||
*
|
||||
* @author ${2:`g:snips_author`}
|
||||
* @version ${3:$Id$}
|
||||
* @copyright ${4:$2}, `strftime('%d %B, %Y')`
|
||||
* @package ${0:default}
|
||||
*/
|
||||
snippet doc_i "interface someClass {}"
|
||||
/**
|
||||
* $1
|
||||
* @package ${2:default}
|
||||
* @author ${3:`!v g:snips_author`}
|
||||
**/
|
||||
interface ${1:someClass}
|
||||
{${4}
|
||||
}
|
||||
snippet inheritdoc "@inheritdoc docblock"
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
# Interface
|
||||
snippet interface
|
||||
/**
|
||||
* ${2:undocumented class}
|
||||
*
|
||||
* @package ${3:default}
|
||||
* @author ${4:`g:snips_author`}
|
||||
*/
|
||||
interface ${1:`vim_snippets#Filename()`}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# Trait
|
||||
snippet trait
|
||||
/**
|
||||
* ${2:undocumented class}
|
||||
*
|
||||
* @package ${3:default}
|
||||
* @author ${4:`g:snips_author`}
|
||||
*/
|
||||
trait ${1:`vim_snippets#Filename()`}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# class ...
|
||||
snippet class
|
||||
/**
|
||||
* ${1}
|
||||
*/
|
||||
class ${2:`vim_snippets#Filename()`}
|
||||
{
|
||||
${3}
|
||||
/**
|
||||
* ${4}
|
||||
*/
|
||||
${5:public} function ${6:__construct}(${7:argument})
|
||||
{
|
||||
${0}
|
||||
}
|
||||
}
|
||||
snippet nc
|
||||
namespace ${1:`substitute(substitute(expand("%:h"), '\v^\w+\/(\u)', '\1', ''), '\/', '\\\', 'g')`};
|
||||
|
||||
${2:abstract }class ${3:`vim_snippets#Filename()`}
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
# define(...)
|
||||
snippet def "define('VARIABLE_NAME', 'definition')"
|
||||
define('${1:VARIABLE_NAME}', ${2:'definition'});
|
||||
# defined(...)
|
||||
snippet def?
|
||||
${1}defined('${2}')
|
||||
snippet wh "while (condition) { ... }"
|
||||
while ($1) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet do "do { ... } while (condition)"
|
||||
do {
|
||||
${0:${VISUAL}}
|
||||
} while (${1});
|
||||
snippet if "if (condition) { ... }"
|
||||
if (${1}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet ifn "if (!condition) { ... }"
|
||||
if (!${1}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet ifil "<?php if (condition): ?> ... <?php endif; ?>"
|
||||
<?php if (${1}): ?>
|
||||
${0:${VISUAL}}
|
||||
<?php endif; ?>
|
||||
snippet ife "if (cond) { ... } else { ... }"
|
||||
if (${1}) {
|
||||
${0:${VISUAL}}
|
||||
} else {
|
||||
${2}
|
||||
}
|
||||
snippet ifeil "<?php if (condition): ?> ... <?php else: ?> ... <?php endif; ?>"
|
||||
<?php if (${1}): ?>
|
||||
${0:${VISUAL}}
|
||||
<?php else: ?>
|
||||
${2}
|
||||
<?php endif; ?>
|
||||
snippet el "else { ... }"
|
||||
else {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet eif "elseif(condition) { ... }"
|
||||
elseif (${1}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet switch "switch($var) { case 'xyz': ... default: .... }"
|
||||
switch ($${1:variable}) {
|
||||
case '${2:value}':
|
||||
${3}
|
||||
break;
|
||||
${0}
|
||||
default:
|
||||
${4}
|
||||
break;
|
||||
}
|
||||
snippet case "case 'value': ... break"
|
||||
case '${1:value}':
|
||||
${0:${VISUAL}}
|
||||
break;
|
||||
snippet for "for ($i = 0; $i < $count; $i++) { ... }"
|
||||
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet foreach "foreach ($var as $value) { .. }"
|
||||
foreach ($${1:variable} as $${2:value}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet foreachil "<?php foreach ($var as $value): ?> ... <?php endforeach; ?>"
|
||||
<?php foreach ($${1:variable} as $${2:value}): ?>
|
||||
${0:${VISUAL}}
|
||||
<?php endforeach; ?>
|
||||
snippet foreachk "foreach ($var as $key => $value) { .. }"
|
||||
foreach ($${1:variable} as $${2:key} => $${3:value}) {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet foreachkil "<?php foreach ($var as $key => $value): ?> ... <?php endforeach; ?>"
|
||||
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
|
||||
${0:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
snippet array "$... = ['' => ]"
|
||||
$${1:arrayName} = ['${2}' => ${3}];
|
||||
snippet try "try { ... } catch (Exception $e) { ... }"
|
||||
try {
|
||||
${0:${VISUAL}}
|
||||
} catch (${1:Exception} $e) {
|
||||
}
|
||||
# lambda with closure
|
||||
snippet lambda
|
||||
${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {
|
||||
${0}
|
||||
};
|
||||
# pre_dump();
|
||||
snippet pd
|
||||
echo '<pre>'; var_dump(${0}); echo '</pre>';
|
||||
# pre_dump(); die();
|
||||
snippet pdd
|
||||
echo '<pre>'; var_dump(${1}); echo '</pre>'; die(${0:});
|
||||
snippet vd
|
||||
var_dump(${0});
|
||||
snippet vdd
|
||||
var_dump(${1}); die(${0:});
|
||||
snippet pr
|
||||
print_r(${0});
|
||||
snippet prs
|
||||
print_r(${0}, 1);
|
||||
snippet vdf
|
||||
error_log(print_r($${1:foo}, true), 3, '${2:/tmp/debug.log}');
|
||||
snippet http_redirect
|
||||
header ("HTTP/1.1 301 Moved Permanently");
|
||||
header ("Location: ".URL);
|
||||
exit();
|
||||
snippet log "error_log(var_export($var, true));"
|
||||
error_log(var_export(${1}, true));
|
||||
snippet var "var_export($var)"
|
||||
var_export(${1});
|
||||
snippet ve "Dumb debug helper in HTML"
|
||||
echo '<pre>' . var_export(${1}, 1) . '</pre>';
|
||||
snippet pc "Dumb debug helper in cli"
|
||||
var_export($1);$0
|
||||
# Getters & Setters
|
||||
snippet gs "PHP Class Getter Setter"
|
||||
/**
|
||||
* Gets the value of ${1:foo}
|
||||
*
|
||||
* @return ${2:string}
|
||||
*/
|
||||
public function get${3:$1}()
|
||||
{
|
||||
return $this->${4:$1};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of $1
|
||||
*
|
||||
* @param $2 $$1 ${5:description}
|
||||
*
|
||||
* @return ${6:`vim_snippets#Filename()`}
|
||||
*/
|
||||
public function set$3(${7:$2 }$$1)
|
||||
{
|
||||
$this->$4 = $$1;
|
||||
return $this;
|
||||
}
|
||||
# anotation, get, and set, useful for doctrine
|
||||
snippet ags
|
||||
/**
|
||||
* ${1:description}
|
||||
*
|
||||
* @${0}
|
||||
*/
|
||||
${2:protected} $${3:foo};
|
||||
|
||||
public function get${4:$3}()
|
||||
{
|
||||
return $this->$3;
|
||||
}
|
||||
|
||||
public function set$4(${5:$4 }$${6:$3})
|
||||
{
|
||||
$this->$3 = $$6;
|
||||
return $this;
|
||||
}
|
||||
snippet rett
|
||||
return true;
|
||||
snippet retf
|
||||
return false;
|
||||
snippet am
|
||||
$${1:foo} = array_map(function($${2:v}) {
|
||||
${0}
|
||||
return $$2;
|
||||
}, $$1);
|
||||
snippet aw
|
||||
array_walk($${1:foo}, function(&$${2:v}, $${3:k}) {
|
||||
$$2 = ${0};
|
||||
});
|
||||
# static var assign once
|
||||
snippet static_var
|
||||
static $${1} = null;
|
||||
if (is_null($$1)){
|
||||
$$1 = ${2};
|
||||
}
|
||||
snippet CSVWriter
|
||||
<?php
|
||||
|
||||
class CSVWriter {
|
||||
public function __construct($file_or_handle, $sep = "\t", $quot = '"'){
|
||||
$args = func_get_args();
|
||||
$mode = isset($opts['mode']) ? $opts['mode'] : 'w';
|
||||
|
||||
$this->f =
|
||||
is_string($file_or_handle)
|
||||
? fopen($file_or_handle, $mode)
|
||||
: $file_or_handle;
|
||||
|
||||
$this->fputcsv_args = [$this->f, null, $sep, $quot];
|
||||
|
||||
if (!$this->f) throw new Exception('bad file descriptor');
|
||||
}
|
||||
|
||||
public function write($row){
|
||||
$this->fputcsv_args[1] =& $row;
|
||||
call_user_func_array('fputcsv', $this->fputcsv_args);
|
||||
}
|
||||
|
||||
public function close(){
|
||||
if (!is_null($this->f))
|
||||
fclose($this->f);
|
||||
$this->f = null;
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
$this->close();
|
||||
}
|
||||
|
||||
}
|
||||
snippet CSVIterator
|
||||
|
||||
// http://snipplr.com/view.php?codeview&id=1986 // modified
|
||||
class CSVIterator implements Iterator
|
||||
{
|
||||
private $f;
|
||||
private $curr;
|
||||
private $rowCounter;
|
||||
|
||||
/* opts keys:
|
||||
* row_size
|
||||
* escape
|
||||
* enclosure
|
||||
* delimiter
|
||||
*/
|
||||
public function __construct( $file_or_handle, $opts = [4096, ','] )
|
||||
{
|
||||
$d = function($n) use(&$opts){ return isset($opts[$n]) ? $opts[$n] : false; };
|
||||
|
||||
$this->combine = $d('combine');
|
||||
$this->headers = $d('headers');
|
||||
$this->headerCheckFunction = $d('header_check_function');
|
||||
|
||||
$this->f =
|
||||
is_string($file_or_handle)
|
||||
? fopen( $file_or_handle, 'r' )
|
||||
: $file_or_handle;
|
||||
if (!$this->f) throw new Exception('bad file descriptor');
|
||||
$this->fgetcsv_args = [
|
||||
$this->f,
|
||||
isset($opts['row_size']) ? $opts['row_size'] : 4096,
|
||||
isset($opts['delimiter']) ? $opts['delimiter'] : ',',
|
||||
isset($opts['enclosure']) ? $opts['enclosure'] : '"',
|
||||
isset($opts['escape']) ? $opts['escape'] : '\\',
|
||||
];
|
||||
$this->start();
|
||||
}
|
||||
|
||||
protected function readRow(){
|
||||
$this->curr = call_user_func_array('fgetcsv', $this->fgetcsv_args );
|
||||
$this->rowCounter++;
|
||||
if ($this->rowCounter == 1){
|
||||
$this->processHeader();
|
||||
} elseif ($this->curr) {
|
||||
$this->processRow();
|
||||
}
|
||||
}
|
||||
|
||||
public function processHeader(){
|
||||
if ($this->headers || $this->combine){
|
||||
$this->header = $this->curr;
|
||||
if ($this->headerCheckFunction){
|
||||
$f = $this->headerCheckFunction;
|
||||
$f($this->header);
|
||||
}
|
||||
$this->readRow();
|
||||
}
|
||||
}
|
||||
|
||||
public function processRow(){
|
||||
if ($this->combine)
|
||||
$this->curr = array_combine($this->header, $this->curr);
|
||||
}
|
||||
|
||||
public function start(){
|
||||
$this->rowCounter = 0;
|
||||
rewind( $this->f );
|
||||
$this->readRow();
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
$this->start();
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
$curr = $this->curr;
|
||||
$this->readRow();
|
||||
return $curr;
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return $this->rowCounter;
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
return $this->curr;
|
||||
}
|
||||
|
||||
public function valid(){
|
||||
if( !$this->next() )
|
||||
{
|
||||
fclose( $this->f );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} // end class
|
||||
# phpunit
|
||||
snippet ase "$this->assertEquals($a, $b)"
|
||||
$this->assertEquals(${1:$expected}, ${2:$actual});
|
||||
snippet asne "$this->assertNotEquals($a, $b)"
|
||||
$this->assertNotEquals(${1:$expected}, ${2:$actual});
|
||||
snippet asf "$this->assertFalse($a)"
|
||||
$this->assertFalse(${1});
|
||||
snippet ast "$this->assertTrue($a)"
|
||||
$this->assertTrue(${1});
|
||||
snippet asfex "$this->assertFileExists('path/to/file')"
|
||||
$this->assertFileExists(${1:'path/to/file'});
|
||||
snippet asfnex "$this->assertFileNotExists('path/to/file')"
|
||||
$this->assertFileNotExists(${1:'path/to/file'});
|
||||
snippet ascon "$this->assertContains($needle, $haystack)"
|
||||
$this->assertContains(${1:$needle}, ${2:$haystack});
|
||||
snippet asncon "$this->assertNotContains($needle, $haystack)"
|
||||
$this->assertNotContains(${1:$needle}, ${2:$haystack});
|
||||
snippet ascono "$this->assertContainsOnly($needle, $haystack)"
|
||||
$this->assertContainsOnly(${1:$needle}, ${2:$haystack});
|
||||
snippet asconoi "$this->assertContainsOnlyInstancesOf(Example::class, $haystack)"
|
||||
$this->assertContainsOnlyInstancesOf(${1:Example}::class, ${2:$haystack});
|
||||
snippet ashk "$this->assertArrayHasKey($key, $array)"
|
||||
$this->assertArrayHasKey(${1:$key}, ${2:$array});
|
||||
snippet asnhk "$this->assertArrayNotHasKey($key, $array)"
|
||||
this->assertArrayNotHasKey(${1:$key}, ${2:$array});
|
||||
snippet ascha "$this->assertClassHasAttribute($name, Example::class)"
|
||||
$this->assertClassHasAttribute(${1:$attributeName}, ${2:Example}::class);
|
||||
snippet asi "$this->assertInstanceOf(Example::class, $actual)"
|
||||
$this->assertInstanceOf(${1:Example}::class, ${2:$actual});
|
||||
snippet asit "$this->assertInternalType('string', $actual)"
|
||||
$this->assertInternalType(${1:'string'}, ${2:actual});
|
||||
snippet asco "$this->assertCount($count, $haystack)"
|
||||
$this->assertCount(${1:$expectedCount}, ${2:$haystack});
|
||||
snippet asnco "$this->assertNotCount($count, $haystack)"
|
||||
$this->assertNotCount(${1:$count}, ${2:$haystack});
|
||||
snippet assub "$this->assertArraySubset($subset, $array)"
|
||||
$this->assertArraySubset(${1:$subset}, ${2:$array});
|
||||
snippet asnu "$this->assertNull($a)"
|
||||
$this->assertNull(${1});
|
||||
snippet asnnu "$this->assertNotNull($a)"
|
||||
$this->assertNotNull(${1});
|
||||
snippet test "public function testXYZ() { ... }"
|
||||
public function test${1}()
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet setup "protected function setUp() { ... }"
|
||||
protected function setUp()
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet teardown "protected function tearDown() { ... }"
|
||||
protected function tearDown()
|
||||
{
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet proph "$observer = $this->prophesize(SomeClass::class);"
|
||||
$${1:observer} = $this->prophesize(${2:SomeClass}::class);
|
||||
snippet mock "$mock = $this->createMock(SomeClass::class);"
|
||||
$${1:mock} = $this->createMock(${2:SomeClass}::class);
|
||||
snippet exp "phpunit expects"
|
||||
expects($this->${1:once}())
|
||||
->method('${2}')
|
||||
->with(${3})
|
||||
->willReturn(${4});
|
||||
snippet testcmt "phpunit comment with group"
|
||||
/**
|
||||
* @group ${1}
|
||||
*/
|
||||
snippet fail "$this->fail()"
|
||||
$this->fail(${1});
|
||||
snippet marki "$this->markTestIncomplete()"
|
||||
$this->markTestIncomplete(${1});
|
||||
snippet marks "$this->markTestSkipped()"
|
||||
$this->markTestSkipped(${1});
|
||||
# end of phpunit snippets
|
||||
snippet te "throw new Exception()"
|
||||
throw new ${1:Exception}("${2:Error Processing Request}");
|
||||
snippet fpc "file_put_contents" b
|
||||
file_put_contents(${1:file}, ${2:content}${3:, FILE_APPEND});$0
|
||||
snippet sr "str_replace"
|
||||
str_replace(${1:search}, ${2:replace}, ${3:subject})$0
|
||||
snippet ia "in_array"
|
||||
in_array(${1:needle}, ${2:haystack})$0
|
||||
snippet is "isset"
|
||||
isset(${1:var})$0
|
||||
snippet isa "isset array"
|
||||
isset($${1:array}[${2:key}])$0
|
||||
snippet in "is_null"
|
||||
is_null($${1:var})$0
|
||||
snippet fe "file_exists"
|
||||
file_exists(${1:file})$0
|
||||
snippet id "is_dir"
|
||||
is_dir(${1:path})$0
|
|
@ -1,252 +0,0 @@
|
|||
#################
|
||||
# Rust Snippets #
|
||||
#################
|
||||
|
||||
# Functions
|
||||
snippet fn "Function definition"
|
||||
fn ${1:function_name}(${2})${3} {
|
||||
${0}
|
||||
}
|
||||
snippet pfn "Function definition"
|
||||
pub fn ${1:function_name}(${2})${3} {
|
||||
${0}
|
||||
}
|
||||
snippet afn "Async function definition"
|
||||
async fn ${1:function_name}(${2})${3} {
|
||||
${0}
|
||||
}
|
||||
snippet pafn "Async function definition"
|
||||
pub async fn ${1:function_name}(${2})${3} {
|
||||
${0}
|
||||
}
|
||||
snippet bench "Bench function" b
|
||||
#[bench]
|
||||
fn ${1:bench_function_name}(b: &mut test::Bencher) {
|
||||
b.iter(|| {
|
||||
${0}
|
||||
})
|
||||
}
|
||||
snippet new "Constructor function"
|
||||
pub fn new(${2}) -> ${1:Self} {
|
||||
$1 { ${3} }
|
||||
}
|
||||
snippet main "Main function"
|
||||
pub fn main() {
|
||||
${0}
|
||||
}
|
||||
snippet let "let variable declaration with type inference"
|
||||
let ${1} = ${2};
|
||||
snippet lett "let variable declaration with explicit type annotation"
|
||||
let ${1}: ${2} = ${3};
|
||||
snippet letm "let mut variable declaration with type inference"
|
||||
let mut ${1} = ${2};
|
||||
snippet lettm "let mut variable declaration with explicit type annotation"
|
||||
let mut ${1}: ${2} = ${3};
|
||||
snippet pri "print!"
|
||||
print!("${1}");
|
||||
snippet pri, "print! with format param"
|
||||
print!("${1}{${2}}", ${3});
|
||||
snippet pln "println!"
|
||||
println!("${1}");
|
||||
snippet pln, "println! with format param"
|
||||
println!("${1}{${2}}", ${3});
|
||||
snippet fmt "format!"
|
||||
format!("${1}{${2}}", ${3});
|
||||
snippet d "dbg! debugging macro"
|
||||
dbg!(${0:${VISUAL}})
|
||||
snippet d; "dbg! debugging macro statement"
|
||||
dbg!(&${1});
|
||||
${0}
|
||||
# Modules
|
||||
snippet ec "extern crate"
|
||||
extern crate ${1:sync};
|
||||
snippet ecl "extern crate log"
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
snippet mod
|
||||
mod ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||
${0}
|
||||
} /* $1 */
|
||||
# Testing
|
||||
snippet as "assert!"
|
||||
assert!(${1:predicate});
|
||||
snippet ase "assert_eq!"
|
||||
assert_eq!(${1:expected}, ${2:actual});
|
||||
snippet test "Unit test function"
|
||||
#[test]
|
||||
fn ${1:function_name}_test() {
|
||||
${0}
|
||||
}
|
||||
snippet testmod "Test module" b
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::${1:*};
|
||||
|
||||
test${0}
|
||||
}
|
||||
snippet ig "#[ignore]"
|
||||
#[ignore]
|
||||
# Attributes
|
||||
snippet allow "allow lint attribute" b
|
||||
#[allow(${1:unused_variables})]
|
||||
snippet cfg "cfg attribute" b
|
||||
#[cfg(${1:target_os = "linux"})]
|
||||
snippet feat "feature attribute" b
|
||||
#![feature(${1:plugin})]
|
||||
snippet der "#[derive(..)]" b
|
||||
#[derive(${1:Debug})]
|
||||
snippet attr "#[..]" b
|
||||
#[${1:inline}]
|
||||
snippet crate "Define create meta attributes"
|
||||
// Crate name
|
||||
#![crate_name = "${1:crate_name}"]
|
||||
// Additional metadata attributes
|
||||
#![desc = "${2:Description.}"]
|
||||
#![license = "${3:BSD}"]
|
||||
#![comment = "${4:Comment.}"]
|
||||
// Specify the output type
|
||||
#![crate_type = "${5:lib}"]
|
||||
# Common types
|
||||
snippet opt "Option<T>"
|
||||
Option<${1:i32}>
|
||||
snippet res "Result<T, E>"
|
||||
Result<${1:&str}, ${2:()}>
|
||||
# Control structures
|
||||
snippet if
|
||||
if ${1} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet ife "if / else"
|
||||
if ${1} {
|
||||
${2:${VISUAL}}
|
||||
} else {
|
||||
${0}
|
||||
}
|
||||
snippet ifl "if let (...)"
|
||||
if let ${1:Some($2)} = $3 {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet el "else"
|
||||
else {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet eli "else if"
|
||||
else if ${1} {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet mat "match pattern"
|
||||
match ${1} {
|
||||
${2} => ${3}
|
||||
}
|
||||
snippet case "Case clause of pattern match"
|
||||
${1:_} => ${2:expression}
|
||||
snippet = "=> "
|
||||
=> $0
|
||||
snippet loop "loop {}" b
|
||||
loop {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet wh "while loop"
|
||||
while $1 {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet whl "while let (...)"
|
||||
while let ${1:Some($2)} = $3 {
|
||||
${0:${VISUAL}}
|
||||
}
|
||||
snippet for "for ... in ... loop"
|
||||
for ${1:i} in ${2} {
|
||||
${0}
|
||||
}
|
||||
# TODO commenting
|
||||
snippet todo "TODO comment"
|
||||
// TODO: $0
|
||||
snippet fixme "FIXME comment"
|
||||
// FIXME: $0
|
||||
# Struct
|
||||
snippet st "Struct definition"
|
||||
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||
${0}
|
||||
}
|
||||
snippet impl "Struct/Trait implementation"
|
||||
impl ${1:Type/Trait}${2: for $3} {
|
||||
${0}
|
||||
}
|
||||
snippet stn "Struct with new constructor"
|
||||
pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||
${0}
|
||||
}
|
||||
|
||||
impl$2 $1$2 {
|
||||
pub fn new(${4}) -> Self {
|
||||
$1 { ${5} }
|
||||
}
|
||||
}
|
||||
snippet ty "Type alias"
|
||||
type ${1:NewName} = $2;
|
||||
snippet enum "enum definition"
|
||||
enum ${1:Name} {
|
||||
${2},
|
||||
}
|
||||
snippet penum "pub enum definition"
|
||||
pub enum ${1:Name} {
|
||||
${2},
|
||||
}
|
||||
# Traits
|
||||
snippet trait "Trait definition"
|
||||
trait ${1:Name} {
|
||||
${0}
|
||||
}
|
||||
snippet drop "Drop trait implementation (destructor)"
|
||||
impl Drop for $1 {
|
||||
fn drop(&mut self) {
|
||||
${0}
|
||||
}
|
||||
}
|
||||
# Statics
|
||||
snippet ss "static string declaration"
|
||||
static ${1}: &'static str = "${0}";
|
||||
snippet stat "static item declaration"
|
||||
static ${1}: ${2:usize} = ${0};
|
||||
# Concurrency
|
||||
snippet spawn "spawn a thread"
|
||||
thread::spawn(${1:move }|| {
|
||||
${0}
|
||||
});
|
||||
snippet chan "Declare (Sender, Receiver) pair of asynchronous channel()"
|
||||
let (${1:tx}, ${2:rx}): (Sender<${3:i32}>, Receiver<${4:i32}>) = channel();
|
||||
# Implementations
|
||||
snippet asref "AsRef trait implementation"
|
||||
impl AsRef<${1:Ref}> for ${2:Type} {
|
||||
fn as_ref(&self) -> &${3:$1} {
|
||||
&self.${0:field}
|
||||
}
|
||||
}
|
||||
snippet asmut "AsMut trait implementation"
|
||||
impl AsMut<${1:Ref}> for ${2:Type} {
|
||||
fn as_mut(&mut self) -> &mut ${3:$1} {
|
||||
&mut self.${0:field}
|
||||
}
|
||||
}
|
||||
snippet fd "Struct field definition" w
|
||||
${1:name}: ${2:Type},
|
||||
snippet || "Closure, anonymous function (inline)" i
|
||||
${1:move }|$2| { $3 }
|
||||
snippet |} "Closure, anonymous function (block)" i
|
||||
${1:move }|$2| {
|
||||
$3
|
||||
}
|
||||
snippet macro "macro_rules!" b
|
||||
macro_rules! ${1:name} {
|
||||
(${2:matcher}) => (
|
||||
$3
|
||||
)
|
||||
}
|
||||
snippet boxp "Box::new()"
|
||||
Box::new(${0:${VISUAL}})
|
||||
snippet rc "Rc::new()"
|
||||
Rc::new(${0:${VISUAL}})
|
||||
snippet unim "unimplemented!()"
|
||||
unimplemented!()
|
||||
snippet use "use ...;" b
|
||||
use ${1:std::$2};
|
|
@ -1,36 +0,0 @@
|
|||
snippet +
|
||||
(+ ${1}
|
||||
${0})
|
||||
|
||||
snippet -
|
||||
(- ${1}
|
||||
${0})
|
||||
|
||||
snippet /
|
||||
(/ ${1}
|
||||
${0})
|
||||
|
||||
snippet *
|
||||
(* ${1}
|
||||
${0})
|
||||
|
||||
# Definition
|
||||
snippet def
|
||||
(define (${1:name})
|
||||
${0:definition})
|
||||
|
||||
# Definition with lambda
|
||||
snippet defl
|
||||
(define ${1:name}
|
||||
(lambda (x)(${0:definition})))
|
||||
|
||||
# Condition
|
||||
snippet cond
|
||||
(cond ((${1:predicate}) (${2:action}))
|
||||
((${3:predicate}) (${0:action})))
|
||||
|
||||
# If statement
|
||||
snippet if
|
||||
(if (${1:predicate})
|
||||
(${2:true-action})
|
||||
(${0:false-action}))
|
|
@ -1,26 +0,0 @@
|
|||
snippet tbl
|
||||
create table ${1:table} (
|
||||
${0:columns}
|
||||
);
|
||||
snippet col
|
||||
${1:name} ${2:type} ${3:default ''} ${0:not null}
|
||||
snippet ccol
|
||||
${1:name} varchar2(${2:size}) ${3:default ''} ${0:not null}
|
||||
snippet ncol
|
||||
${1:name} number ${3:default 0} ${0:not null}
|
||||
snippet dcol
|
||||
${1:name} date ${3:default sysdate} ${0:not null}
|
||||
snippet ind
|
||||
create index ${0:$1_$2} on ${1:table}(${2:column});
|
||||
snippet uind
|
||||
create unique index ${1:name} on ${2:table}(${0:column});
|
||||
snippet tblcom
|
||||
comment on table ${1:table} is '${0:comment}';
|
||||
snippet colcom
|
||||
comment on column ${1:table}.${2:column} is '${0:comment}';
|
||||
snippet addcol
|
||||
alter table ${1:table} add (${2:column} ${0:type});
|
||||
snippet seq
|
||||
create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${0:1};
|
||||
snippet s*
|
||||
select * from ${0:table}
|
|
@ -1,437 +0,0 @@
|
|||
#version 1
|
||||
#PREAMBLE
|
||||
#documentclass without options
|
||||
snippet dcl \documentclass{}
|
||||
\\documentclass{${1:class}} ${0}
|
||||
#documentclass with options
|
||||
snippet dclo \documentclass[]{}
|
||||
\\documentclass[${1:options}]{${2:class}} ${0}
|
||||
|
||||
snippet tmplt "Template"
|
||||
\\documentclass{${1:article}}
|
||||
|
||||
\\usepackage{import}
|
||||
\\usepackage{pdfpages}
|
||||
\\usepackage{transparent}
|
||||
\\usepackage{xcolor}
|
||||
$2
|
||||
|
||||
\\newcommand{\incfig}[2][1]{%
|
||||
\def\svgwidth{#1\columnwidth}
|
||||
\import{./figures/}{#2.pdf_tex}
|
||||
}
|
||||
$3
|
||||
\\pdfsuppresswarningpagegroup=1
|
||||
|
||||
\\begin{document}
|
||||
$0
|
||||
\\end{document}
|
||||
|
||||
#newcommand
|
||||
snippet nc \newcommand
|
||||
\\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
|
||||
#usepackage
|
||||
snippet up \usepackage
|
||||
\\usepackage[${1:options}]{${2:package}} ${0}
|
||||
#newunicodechar
|
||||
snippet nuc \newunicodechar
|
||||
\\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}} ${0}
|
||||
#DeclareMathOperator
|
||||
snippet dmo \DeclareMathOperator
|
||||
\\DeclareMathOperator{${1}}{${2}} ${0}
|
||||
|
||||
#DOCUMENT
|
||||
# \begin{}...\end{}
|
||||
snippet begin \begin{} ... \end{} block
|
||||
\\begin{${1:env}}
|
||||
${0:${VISUAL}}
|
||||
\\end{$1}
|
||||
|
||||
# Maketitle
|
||||
snippet mkt maketitle
|
||||
\\maketitle
|
||||
|
||||
# Tabular
|
||||
snippet tab tabular (or arbitrary) environment
|
||||
\\begin{${1:tabular}}{${2:c}}
|
||||
${0:${VISUAL}}
|
||||
\\end{$1}
|
||||
snippet thm thm (or arbitrary) environment with optional argument
|
||||
\\begin[${1:author}]{${2:thm}}
|
||||
${0:${VISUAL}}
|
||||
\\end{$2}
|
||||
snippet center center environment
|
||||
\\begin{center}
|
||||
${0:${VISUAL}}
|
||||
\\end{center}
|
||||
# Align(ed)
|
||||
snippet ali align(ed) environment
|
||||
\\begin{align${1:ed}}
|
||||
\\label{eq:${2}}
|
||||
${0:${VISUAL}}
|
||||
\\end{align$1}
|
||||
# Gather(ed)
|
||||
snippet gat gather(ed) environment
|
||||
\\begin{gather${1:ed}}
|
||||
${0:${VISUAL}}
|
||||
\\end{gather$1}
|
||||
# Equation
|
||||
snippet eq equation environment
|
||||
\\begin{equation}
|
||||
${0:${VISUAL}}
|
||||
\\end{equation}
|
||||
# Equation
|
||||
snippet eql Labeled equation environment
|
||||
\\begin{equation}
|
||||
\\label{eq:${2}}
|
||||
${0:${VISUAL}}
|
||||
\\end{equation}
|
||||
# Equation
|
||||
snippet eq* unnumbered equation environment
|
||||
\\begin{equation*}
|
||||
${0:${VISUAL}}
|
||||
\\end{equation*}
|
||||
# Unnumbered Equation
|
||||
snippet \ unnumbered equation: \[ ... \]
|
||||
\\[
|
||||
${0:${VISUAL}}
|
||||
\\]
|
||||
# Equation array
|
||||
snippet eqnarray eqnarray environment
|
||||
\\begin{eqnarray}
|
||||
${0:${VISUAL}}
|
||||
\\end{eqnarray}
|
||||
# Label
|
||||
snippet lab \label
|
||||
\\label{${1:eq:}${2:fig:}${3:tab:}${0}}
|
||||
# Enumerate
|
||||
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 item itemize environment
|
||||
\\begin{itemize}
|
||||
\\item ${0}
|
||||
\\end{itemize}
|
||||
snippet it \item
|
||||
\\item ${1:${VISUAL}}
|
||||
# Description
|
||||
snippet desc description environment
|
||||
\\begin{description}
|
||||
\\item[${1}] ${0}
|
||||
\\end{description}
|
||||
# Endless new item
|
||||
snippet ]i \item (recursive)
|
||||
\\item ${1}
|
||||
${0:]i}
|
||||
# Matrix
|
||||
snippet mat smart matrix environment
|
||||
\\begin{${1:p/b/v/V/B/small}matrix}
|
||||
${0:${VISUAL}}
|
||||
\\end{$1matrix}
|
||||
# Cases
|
||||
snippet cas cases environment
|
||||
\\begin{cases}
|
||||
${1:equation}, &\\text{ if }${2:case}\\
|
||||
${0:${VISUAL}}
|
||||
\\end{cases}
|
||||
# Split
|
||||
snippet spl split environment
|
||||
\\begin{split}
|
||||
${0:${VISUAL}}
|
||||
\\end{split}
|
||||
# Part
|
||||
snippet part document \part
|
||||
\\part{${1:part name}} % (fold)%
|
||||
\\label{prt:${2:$1}}
|
||||
${0}
|
||||
% part $2 (end)
|
||||
# Chapter
|
||||
snippet cha \chapter
|
||||
\\chapter{${1:chapter name}}%
|
||||
\\label{cha:${2:$1}}
|
||||
${0}
|
||||
# Section
|
||||
snippet sec \section
|
||||
\\section{${1:section name}}%
|
||||
\\label{sec:${2:$1}}
|
||||
${0}
|
||||
# Section without number
|
||||
snippet sec* \section*
|
||||
\\section*{${1:section name}}%
|
||||
\\label{sec:${2:$1}}
|
||||
${0}
|
||||
# Sub Section
|
||||
snippet sub \subsection
|
||||
\\subsection{${1:subsection name}}%
|
||||
\\label{sub:${2:$1}}
|
||||
${0}
|
||||
# Sub Section without number
|
||||
snippet sub* \subsection*
|
||||
\\subsection*{${1:subsection name}}%
|
||||
\\label{sub:${2:$1}}
|
||||
${0}
|
||||
# Sub Sub Section
|
||||
snippet ssub \subsubsection
|
||||
\\subsubsection{${1:subsubsection name}}%
|
||||
\\label{ssub:${2:$1}}
|
||||
${0}
|
||||
# Sub Sub Section without number
|
||||
snippet ssub* \subsubsection*
|
||||
\\subsubsection*{${1:subsubsection name}}%
|
||||
\\label{ssub:${2:$1}}
|
||||
${0}
|
||||
# Paragraph
|
||||
snippet par \paragraph
|
||||
\\paragraph{${1:paragraph name}}%
|
||||
\\label{par:${2:$1}}
|
||||
${0}
|
||||
# Sub Paragraph
|
||||
snippet subp \subparagraph
|
||||
\\subparagraph{${1:subparagraph name}}%
|
||||
\\label{subp:${2:$1}}
|
||||
${0}
|
||||
snippet ni \noindent
|
||||
\\noindent
|
||||
${0}
|
||||
#References
|
||||
snippet itd description \item
|
||||
\\item[${1:description}] ${0:item}
|
||||
snippet figure reference to a figure
|
||||
${1:Figure}~\\ref{${2:fig:}}
|
||||
snippet table reference to a table
|
||||
${1:Table}~\\ref{${2:tab:}}
|
||||
snippet listing reference to a listing
|
||||
${1:Listing}~\\ref{${2:list}}
|
||||
snippet section reference to a section
|
||||
${1:Section}~\\ref{sec:${2}} ${0}
|
||||
snippet page reference to a page
|
||||
${1:page}~\\pageref{${2}} ${0}
|
||||
snippet index \index
|
||||
\\index{${1:index}} ${0}
|
||||
#Citations
|
||||
snippet citen \citen
|
||||
\\citen{${1}} ${0}
|
||||
# natbib citations
|
||||
snippet citep \citep
|
||||
\\citep{${1}} ${0}
|
||||
snippet citet \citet
|
||||
\\citet{${1}} ${0}
|
||||
snippet cite \cite[]{}
|
||||
\\cite[${1}]{${2}} ${0}
|
||||
snippet citea \citeauthor
|
||||
\\citeauthor{${1}} ${0}
|
||||
snippet citey \citeyear
|
||||
\\citeyear{${1}} ${0}
|
||||
snippet fcite \footcite[]{}
|
||||
\\footcite[${1}]{${2}}${0}
|
||||
#Formating text: italic, bold, underline, small capital, emphase ..
|
||||
snippet ita italic text
|
||||
\\textit{${1:${VISUAL:text}}}${0}
|
||||
snippet bf bold face text
|
||||
\\textbf{${1:${VISUAL:text}}}${0}
|
||||
snippet under underline text
|
||||
\\underline{${1:${VISUAL:text}}}${0}
|
||||
snippet over overline text
|
||||
\\overline{${1:${VISUAL:text}}}${0}
|
||||
snippet emp emphasize text
|
||||
\\emph{${1:${VISUAL:text}}}${0}
|
||||
snippet sc small caps text
|
||||
\\textsc{${1:${VISUAL:text}}}${0}
|
||||
#Choosing font
|
||||
snippet sf sans serife text
|
||||
\\textsf{${1:${VISUAL:text}}}${0}
|
||||
snippet rm roman font text
|
||||
\\textrm{${1:${VISUAL:text}}}${0}
|
||||
snippet tt typewriter (monospace) text
|
||||
\\texttt{${1:${VISUAL:text}}}${0}
|
||||
snippet tsub subscripted text
|
||||
\\textsubscript{${1:${VISUAL:text}}}${0}
|
||||
snippet tsup superscripted text
|
||||
\\textsuperscript{${1:${VISUAL:text}}}${0}
|
||||
#Math font
|
||||
snippet mf mathfrak
|
||||
\\mathfrak{${1:${VISUAL:text}}}${0}
|
||||
snippet mc mathcal
|
||||
\\mathcal{${1:${VISUAL:text}}}${0}
|
||||
snippet ms mathscr
|
||||
\\mathscr{${1:${VISUAL:text}}}${0}
|
||||
#misc
|
||||
snippet ft \footnote
|
||||
\\footnote{${1:${VISUAL:text}}}${0}
|
||||
snippet fig figure environment (includegraphics)
|
||||
\\begin{figure}
|
||||
\\begin{center}
|
||||
\\includegraphics[scale=${1}]{Figures/${2}}
|
||||
\\end{center}
|
||||
\\caption{${3}}
|
||||
\\label{fig:${4}}
|
||||
\\end{figure}
|
||||
${0}
|
||||
snippet tikz figure environment (tikzpicture)
|
||||
\\begin{figure}[htpb]
|
||||
\\begin{center}
|
||||
\\begin{tikzpicture}[scale=${1:1}, transform shape]
|
||||
${2}
|
||||
\\end{tikzpicture}
|
||||
\\end{center}
|
||||
\\caption{${3}}%
|
||||
\\label{fig:${4}}
|
||||
\\end{figure}
|
||||
${0}
|
||||
snippet subfig subfigure environment
|
||||
\\begin{subfigure}[${1}]{${2:\\textwidth}}
|
||||
\\begin{center}
|
||||
${3}
|
||||
\\end{center}
|
||||
\\caption{${4}}
|
||||
\\label{fig:${5}}
|
||||
\\end{subfigure}
|
||||
${0}
|
||||
snippet tikzcd tikzcd environment in equation
|
||||
\\begin{equation}
|
||||
\\begin{tikzcd}
|
||||
${1}
|
||||
\\end{tikzcd}
|
||||
\\end{equation}
|
||||
${0}
|
||||
snippet tikzcd* tikzcd environment in equation*
|
||||
\\begin{equation*}
|
||||
\\begin{tikzcd}
|
||||
${1}
|
||||
\\end{tikzcd}
|
||||
\\end{equation*}
|
||||
${0}
|
||||
#math
|
||||
snippet stackrel \stackrel{}{}
|
||||
\\stackrel{${1:above}}{${2:below}} ${0}
|
||||
snippet frac \frac{}{}
|
||||
\\frac{${1:num}}{${2:denom}} ${0}
|
||||
snippet sum \sum^{}_{}
|
||||
\\sum^{${1:n}}_{${2:i=1}} ${0}
|
||||
snippet lim \lim_{}
|
||||
\\lim_{${1:n \\to \\infty}} ${0}
|
||||
snippet frame frame environment
|
||||
\\begin{frame}[${1:t}]
|
||||
\frametitle{${2:title}}
|
||||
\framesubtitle{${3:subtitle}}
|
||||
${0:${VISUAL}}
|
||||
\\end{frame}
|
||||
snippet block block environment
|
||||
\\begin{block}{${1:title}}
|
||||
${0:${VISUAL}}
|
||||
\\end{block}
|
||||
snippet alert alert text
|
||||
\\alert{${1:${VISUAL:text}}} ${0}
|
||||
snippet alertblock alertblock environment
|
||||
\\begin{alertblock}{${1:title}}
|
||||
${0:${VISUAL}}
|
||||
\\end{alertblock}
|
||||
snippet example exampleblock environment
|
||||
\\begin{exampleblock}{${1:title}}
|
||||
${0:${VISUAL}}
|
||||
\\end{exampleblock}
|
||||
snippet col2 two-column environment
|
||||
\\begin{columns}
|
||||
\\begin{column}{0.5\\textwidth}
|
||||
${1}
|
||||
\\end{column}
|
||||
\\begin{column}{0.5\\textwidth}
|
||||
${0}
|
||||
\\end{column}
|
||||
\\end{columns}
|
||||
snippet multicol2 two-column environment with multicol
|
||||
\\begin{multicols}{2}
|
||||
${1}
|
||||
\columnbreak
|
||||
${0}
|
||||
\\end{multicols}
|
||||
snippet \{ \{ \}
|
||||
\\{ ${0} \\}
|
||||
#delimiter
|
||||
snippet lr left right
|
||||
\\left${1} ${0:${VISUAL}} \\right$1
|
||||
snippet lr( left( right)
|
||||
\\left( ${0:${VISUAL}} \\right)
|
||||
snippet lr| left| right|
|
||||
\\left| ${0:${VISUAL}} \\right|
|
||||
snippet lr{ left\{ right\}
|
||||
\\left\\{ ${0:${VISUAL}} \\right\\}
|
||||
snippet lr[ left[ right]
|
||||
\\left[ ${0:${VISUAL}} \\right]
|
||||
snippet lra langle rangle
|
||||
\\langle ${0:${VISUAL}} \\rangle
|
||||
# Code listings
|
||||
snippet lst
|
||||
\\begin{listing}[language=${1:language}]
|
||||
${0:${VISUAL}}
|
||||
\\end{listing}
|
||||
snippet lsi
|
||||
\\lstinline|${1}| ${0}
|
||||
# Hyperlinks
|
||||
snippet url
|
||||
\\url{${1}} ${0}
|
||||
snippet href
|
||||
\\href{${1}}{${2}} ${0}
|
||||
# URL from Clipboard.
|
||||
snippet urlc
|
||||
\\url{`@+`} ${0}
|
||||
snippet hrefc
|
||||
\\href{`@+`}{${1}} ${0}
|
||||
# enquote from package csquotes
|
||||
snippet enq enquote
|
||||
\\enquote{${1:${VISUAL:text}}} ${0}
|
||||
# Time derivative
|
||||
snippet ddt time derivative
|
||||
\\frac{d}{dt} {$1} {$0}
|
||||
# Limit
|
||||
snippet lim limit
|
||||
\\lim_{{$1}} {{$2}} {$0}
|
||||
# Partial derivative
|
||||
snippet pdv partial derivation
|
||||
\\frac{\\partial {$1}}{\\partial {$2}} {$0}
|
||||
# Second order partial derivative
|
||||
snippet ppdv second partial derivation
|
||||
\\frac{\\partial^2 {$1}}{\\partial {$2} \\partial {$3}} {$0}
|
||||
# Ordinary derivative
|
||||
snippet dv derivative
|
||||
\\frac{d {$1}}{d {$2}} {$0}
|
||||
# Summation
|
||||
snippet summ summation
|
||||
\\sum_{{$1}} {$0}
|
||||
# Shorthand for time derivative
|
||||
snippet dot dot
|
||||
\\dot{{$1}} {$0}
|
||||
# Shorthand for second order time derivative
|
||||
snippet ddot ddot
|
||||
\\ddot{{$1}} {$0}
|
||||
# Vector
|
||||
snippet vec vector
|
||||
\\vec{{$1}} {$0}
|
||||
# Bar
|
||||
snippet bar bar
|
||||
\\bar{{$1}} {$0}
|
||||
# Cross product
|
||||
snippet \x cross product
|
||||
\\times {$0}
|
||||
# Dot product
|
||||
snippet . dot product
|
||||
\\cdot {$0}
|
||||
# Integral
|
||||
snippet int integral
|
||||
\\int_{{$1}}^{{$2}} {$3} \\: d{$4} {$0}
|
||||
# Right arrow
|
||||
snippet ra rightarrow
|
||||
\\rightarrow {$0}
|
||||
# Long right arrow
|
||||
snippet lra longrightarrow
|
||||
\\longrightarrow {$0}
|
Loading…
Reference in New Issue