1
0
mirror of https://github.com/amix/vimrc synced 2025-07-03 05:55:00 +08:00

Merge branch 'pr/2'

This commit is contained in:
geezuslucifer@gmail.com
2020-03-20 10:10:45 -05:00
1315 changed files with 30338 additions and 18193 deletions

View File

@ -11,6 +11,12 @@ priority -60
##############
global !p
from vimsnippets import foldmarker, make_box, get_comment_format
LOREM = """
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod \
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At \
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, \
no sea takimata sanctus est Lorem ipsum dolor sit amet.
"""
endglobal
snippet box "A nice box with the current comment symbol" b
@ -56,11 +62,8 @@ endsnippet
##########################
# LOREM IPSUM GENERATORS #
##########################
snippet lorem "Lorem Ipsum - 50 Words" b
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
snippet "lorem(([1-4])?[0-9])?" "Lorem Ipsum" r
`!p snip.rv = " ".join(LOREM.split()[:int(match.group(1))]) if match.group(1) else LOREM`
endsnippet
##########################
@ -104,7 +107,7 @@ endsnippet
# Misc #
##########
snippet uuid "Random UUID" w
`!p if not snip.c: import uuid; snip.rv = uuid.uuid4()`
`!p if not snip.c: import uuid; snip.rv = str(uuid.uuid4())`
endsnippet
# vim:ft=snippets:

View File

@ -333,6 +333,10 @@ snippet mailto "HTML <a mailto: >" w
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
endsnippet
snippet tel "HTML <a tel: >" w
<a href="tel:+${1:XX1234567890}">${2:call me}</a>
endsnippet
snippet main "<main>"
<main>
${1:main content}

View File

@ -1,6 +1,6 @@
priority -50
snippet #! "shebang"
snippet #! "#!/usr/bin/env node" b
#!/usr/bin/env node
endsnippet

View File

@ -3,7 +3,7 @@ priority -50
#################################
# Snippets for the Lua language #
#################################
snippet #! "Shebang header" b
snippet #! "#!/usr/bin/env lua" b
#!/usr/bin/env lua
$0
endsnippet

View File

@ -1,25 +1,55 @@
priority -50
global !p
# A overkill(dirty) table with automatic alignment feature
def create_table(snip):
# retrieving single line from current string and treat it like tabstops count
placeholders_string = snip.buffer[snip.line].strip()[2:].split("x",1)
rows_amount = int(placeholders_string[0])
columns_amount = int(placeholders_string[1])
# retrieving single line from current string and treat it like tabstops count
placeholders_string = snip.buffer[snip.line].strip()
rows_amount = int(placeholders_string[0])
columns_amount = int(placeholders_string[1])
# erase current line
snip.buffer[snip.line] = ''
prefix_str = "from vimsnippets import display_width;"
# create anonymous snippet with expected content and number of tabstops
anon_snippet_title = ' | '.join(['$' + str(col) for col in range(1,columns_amount+1)]) + "\n"
anon_snippet_delimiter = ':-|' * (columns_amount-1) + ":-\n"
anon_snippet_body = ""
for row in range(1,rows_amount+1):
anon_snippet_body += ' | '.join(['$' + str(row*columns_amount+col) for col in range(1,columns_amount+1)]) + "\n"
anon_snippet_table = anon_snippet_title + anon_snippet_delimiter + anon_snippet_body
# erase current line
snip.buffer[snip.line] = ""
# expand anonymous snippet
snip.expand_anon(anon_snippet_table)
# create anonymous snippet with expected content and number of tabstops
anon_snippet_title = "| "
anon_snippet_delimiter = "|"
for col in range(1, columns_amount+1):
sync_rows = [x*columns_amount+col for x in range(rows_amount+1)]
sync_str = ",".join(["t[{0}]".format(x) for x in sync_rows])
max_width_str = "max(list(map(display_width, [" + sync_str + "])))"
cur_width_str = "display_width(t[" + str(col) + "])"
rv_val = "(" + max_width_str + "-" + cur_width_str + ")*' '"
anon_snippet_title += "${" + str(col) + ":head" + str(col)\
+ "}`!p " + prefix_str + "snip.rv=" + rv_val + "` | "
anon_snippet_delimiter += ":`!p " + prefix_str + "snip.rv = "\
+ max_width_str + "*'-'" + "`-|"
anon_snippet_title += "\n"
anon_snippet_delimiter += "\n"
anon_snippet_body = ""
for row in range(1, rows_amount+1):
body_row = "| "
for col in range(1, columns_amount+1):
sync_rows = [x*columns_amount+col for x in range(rows_amount+1)]
sync_str = ",".join(["t[{0}]".format(x) for x in sync_rows])
max_width_str = "max(list(map(display_width, [" + sync_str + "])))"
cur_width_str = "display_width(t[" + str(row*columns_amount+col) + "])"
rv_val = "(" + max_width_str + "-" + cur_width_str + ")*' '"
placeholder = "R{0}C{1}".format(row, col)
body_row += "${" + str(row*columns_amount+col) + ":" + placeholder\
+ "}`!p " + prefix_str + "snip.rv=" + rv_val + "` | "
body_row += "\n"
anon_snippet_body += body_row
anon_snippet_table = anon_snippet_title + anon_snippet_delimiter + anon_snippet_body
# expand anonymous snippet
snip.expand_anon(anon_snippet_table)
endglobal
###########################
@ -101,8 +131,9 @@ snippet fnt "Footnote"
[^$1]:${2:Text}
endsnippet
pre_expand "create_table(snip)"
snippet "tb(\d+x\d+)" "Customizable table" br
post_jump "create_table(snip)"
snippet "tb([1-9][1-9])" "Fancy table" br
`!p snip.rv = match.group(1)`
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,2 @@
extends matlab

View File

@ -67,7 +67,8 @@ endsnippet
snippet exec "Exec resource type" b
exec { '${1:command}':
refreshonly => true,
command => "${2:$1}",
user => "${3:root}",
}
endsnippet

View File

@ -5,8 +5,12 @@ priority -50
###########################################################################
#! header
snippet #! "Shebang header for python scripts" b
snippet #! "#!/usr/bin/env python" b
#!/usr/bin/env python
$0
endsnippet
snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r
# -*- coding: utf-8 -*-
$0
endsnippet
@ -267,7 +271,7 @@ class ${1:MyClass}(${2:object}):
`!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
def __init__(self$4):
`!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined1.}`!p
`!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined.}`!p
snip.rv = ""
snip >> 2
@ -493,8 +497,8 @@ def __coerce__(self, other):
${25:pass}
endsnippet
snippet deff
def ${1:fname}(`!p snip.rv = vim.eval('indent(".") ? "self" : ""')`$2):
snippet deff "function or class method"
def ${1:fname}(`!p snip.rv = "self, " if snip.indent else ""`$2):
$0
endsnippet

View File

@ -15,8 +15,9 @@ FIELD_TYPES = [
'vector']
endglobal
snippet #! "Hashbang for Rscript (#!)" b
snippet #! "#!/usr/bin/env Rscript" b
#!/usr/bin/env Rscript
$0
endsnippet
snippet setwd "Set workingdir" b

View File

@ -69,7 +69,7 @@ endsnippet
# FIXME: handling literal bracket pair inside of nested tab groups?
snippet tcr "Create references column"
t.references :${1:taggable}${2:, polymorphic ${3:{ :default: '${4:Photo}' \}}}
t.references :${1:taggable}${2:, polymorphic: ${3:{ default: '${4:Photo}' }}}
$0
endsnippet
@ -597,7 +597,7 @@ endsnippet
snippet rest "respond_to"
respond_to do |wants|
wants.${1:html}${2: { $0 \}}
wants.${1:html}${2: { $0 }}
end
endsnippet
@ -655,7 +655,7 @@ t.$0
endsnippet
snippet t. "t.references (tcr)"
t.references :${1:taggable}${2:, polymorphic ${3:{ :default: '${4:Photo}' \}}}
t.references :${1:taggable}${2:, polymorphic: ${3:{ default: '${4:Photo}' }}}
t.$0
endsnippet
@ -780,7 +780,7 @@ verify only: [:$1], session: :user, params: :id, redirect_to {:action: '${2:inde
endsnippet
snippet wants "wants_format"
wants.${1:js|json|html}${2: { $0 \}}
wants.${1:js|json|html}${2: { $0 }}
endsnippet
snippet xdelete "xhr delete"

View File

@ -6,53 +6,43 @@ priority -50
# General Stuff #
###########################################################################
global !p
import vim
from os import path as ospath
from string import Template
import re
from collections import Counter
from vimsnippets import complete, has_cjk, display_width
from vimsnippets import complete
#http://docutils.sourceforge.net/docs/ref/rst/roles.html
TEXT_ROLES = ['emphasis','literal','code','math',
'pep-reference','rfc-reference',
'strong','subscript','superscript',
'title-reference','raw']
# http://docutils.sourceforge.net/docs/ref/rst/roles.html
TEXT_ROLES = ['emphasis', 'literal', 'code', 'math',
'pep-reference', 'rfc-reference',
'strong', 'subscript', 'superscript',
'title-reference', 'raw']
TEXT_ROLES_REGEX = r'\.\.\srole::?\s(w+)'
#http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
# http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
SPECIFIC_ADMONITIONS = ["attention", "caution", "danger",
"error", "hint", "important", "note",
"tip", "warning"]
#http://docutils.sourceforge.net/docs/ref/rst/directives.html
DIRECTIVES = ['topic','sidebar','math','epigraph',
'parsed-literal','code','highlights',
'pull-quote','compound','container','table','csv-table',
'list-table','class','sectnum',
'role','default-role','unicode',
'raw']
# http://docutils.sourceforge.net/docs/ref/rst/directives.html
DIRECTIVES = ['code', 'contents', 'admonition', 'table', 'csv-table', 'list-table',
'class', 'container', 'sidebar', 'topic', 'title',
'role', 'default-role', 'raw']
NONE_CONTENT_DIRECTIVES = ['rubric', 'contents', 'header',
'footer', 'date', 'include', 'title']
# DIRECTIVES_WITHOUT_TITLE means directive arguments equal None
DIRECTIVES_WITHOUT_TITLE = ['math', 'meta', 'parsed-literal', 'line-block',
'header', 'compound', 'highlights', 'pull-quote',
'footer', 'epigraph', 'rubric', 'sectnum']
INCLUDABLE_DIRECTIVES = ['image', 'figure', 'include']
# CJK chars
# http://stackoverflow.com/questions/2718196/find-all-chinese-text-in-a-string-using-python-and-regex
CJK_RE = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一-鿃豈-鶴侮-頻並-龎]', re.UNICODE)
#http://www.pygal.org/en/stable/documentation/types/index.html
# Directives for Subsubsection Definition
DIRECTIVES_FOR_SUBSTITUTION = ['replace', 'unicode', 'date']
# http://www.pygal.org/en/stable/documentation/types/index.html
CHART_TYPES = ["Line", "StackedLine", "HorizontalLine", "Bar", "StackedBar", "HorizontalBar", "Histogram", "XY", "DateLine", "TimeLine", "TimeDeltaLine", "DateTimeLine", "Pie", "Radar", "Box", "Dot", "Funnel", "Gauge", "SolidGauge", "Pyramid", "Treemap"]
def has_cjk(s):
"""Detect if s contains CJK characters."""
return CJK_RE.search(s) is not None
def real_filename(filename):
"""pealeextension name off if possible
# i.e. "foo.bar.png will return "foo.bar"
"""
return ospath.splitext(filename)[0]
return os.path.splitext(filename)[0]
def check_file_exist(rst_path, relative_path):
"""
@ -62,23 +52,10 @@ def check_file_exist(rst_path, relative_path):
:param relative_path: path related to rst file
:return: relative file's absolute path if file exist
"""
abs_path = ospath.join(ospath.dirname(rst_path), relative_path)
if ospath.isfile(abs_path):
abs_path = os.path.join(os.path.dirname(rst_path), relative_path)
if os.path.isfile(abs_path):
return abs_path
try:
rst_char_len = vim.strwidth # Requires Vim 7.3+
except AttributeError:
from unicodedata import east_asian_width
def rst_char_len(s):
"""Return the required over-/underline length for s."""
result = 0
for c in s:
result += 2 if east_asian_width(c) in ('W', 'F') else 1
return result
def make_items(times, leading='+'):
"""
make lines with leading char multitimes
@ -130,45 +107,45 @@ def get_popular_code_type():
endglobal
snippet part "Part" b
`!p snip.rv = rst_char_len(t[1])*'#'`
`!p snip.rv = display_width(t[1])*'#'`
${1:${VISUAL:Part name}}
`!p snip.rv = rst_char_len(t[1])*'#'`
`!p snip.rv = display_width(t[1])*'#'`
$0
endsnippet
snippet chap "Chapter" b
`!p snip.rv = rst_char_len(t[1])*'*'`
`!p snip.rv = display_width(t[1])*'*'`
${1:${VISUAL:Chapter name}}
`!p snip.rv = rst_char_len(t[1])*'*'`
`!p snip.rv = display_width(t[1])*'*'`
$0
endsnippet
snippet sec "Section" b
${1:${VISUAL:Section name}}
`!p snip.rv = rst_char_len(t[1])*'='`
`!p snip.rv = display_width(t[1])*'='`
$0
endsnippet
snippet ssec "Subsection" b
${1:${VISUAL:Subsection name}}
`!p snip.rv = rst_char_len(t[1])*'-'`
`!p snip.rv = display_width(t[1])*'-'`
$0
endsnippet
snippet sssec "Subsubsection" b
${1:${VISUAL:Subsubsection name}}
`!p snip.rv = rst_char_len(t[1])*'^'`
`!p snip.rv = display_width(t[1])*'^'`
$0
endsnippet
snippet para "Paragraph" b
${1:${VISUAL:Paragraph name}}
`!p snip.rv = rst_char_len(t[1])*'"'`
`!p snip.rv = display_width(t[1])*'"'`
$0
endsnippet
@ -228,7 +205,7 @@ endsnippet
# img, inc, fig
snippet id "Includable Directives" b
`!p
real_name=real_filename(ospath.basename(t[2]))
real_name=real_filename(os.path.basename(t[2]))
di=t[1][:2]
link=""
@ -264,23 +241,30 @@ snippet di "Directives" b
$0
endsnippet
snippet nd "None Content Directives" b
.. $1`!p snip.rv=complete(t[1], NONE_CONTENT_DIRECTIVES)`:: $2
snippet dt "Directives without title" b
.. $1`!p snip.rv=complete(t[1], DIRECTIVES_WITHOUT_TITLE)`::
${2:${VISUAL:Content}}
$0
endsnippet
snippet ds "Directives for subscription" b
.. |$1| $2`!p snip.rv=complete(t[2], DIRECTIVES_FOR_SUBSTITUTION)`:: ${3:Content}
$0
endsnippet
snippet sa "Specific Admonitions" b
.. $1`!p snip.rv =complete(t[1], SPECIFIC_ADMONITIONS)`::
.. $1`!p snip.rv =complete(t[1], SPECIFIC_ADMONITIONS)`:: $2
${2:${VISUAL:Content}}
${3:${VISUAL:Content}}
$0
endsnippet
#it will be trigger at start of line or after a word
# it will be trigger at start of line or after a word
snippet ro "Text Roles" w
\ :$1`!p snip.rv=complete(t[1],
TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX,
TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX,
path))`:\`$2\`\
endsnippet
@ -306,7 +290,7 @@ snippet chart "Pygal chart for Nikola" b
.. chart:: $1`!p snip.rv=complete(t[1], CHART_TYPES)`
:title: '${2:Browser usage evolution (in %)}'
:x_labels: [${3:"2002", "2003", "2004", "2005", "2006", "2007"}]
'Firefox', [None, None, 0, 16.6, 25, 31]
'Chrome', [None, None, None, None, None, None]
'IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6]
@ -323,4 +307,5 @@ snippet sid "SideBar" b
${2:${VISUAL:SideBar Content}}
endsnippet
# vim:ft=snippets:
# vim:set list noet sts=0 sw=4 ts=4:

View File

@ -21,7 +21,7 @@ endglobal
# Snippets
#
snippet "^#!" "#!/usr/bin/env ruby" r
snippet #! "#!/usr/bin/env ruby" b
#!/usr/bin/env ruby
$0
endsnippet
@ -307,7 +307,7 @@ end
endsnippet
snippet class "class <class_name> def initialize ... end end"
class ${1:class_name}
class ${1:`!p snip.rv = snip.basename.title().replace('_', '')`}
def initialize(${2:*args})
$0
end
@ -315,7 +315,7 @@ end
endsnippet
snippet module "module"
module ${1:module_name}
module ${1:`!p snip.rv = snip.basename.title().replace('_', '')`}
$0
end
endsnippet

View File

@ -25,22 +25,18 @@ endglobal
###########################################################################
# TextMate Snippets #
###########################################################################
snippet #!
`!p snip.rv = '#!/bin/' + getShell() + "\n\n" `
snippet #! "#!/usr/bin/env (!env)" b
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n" `
endsnippet
snippet !env "#!/usr/bin/env (!env)"
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
endsnippet
snippet sbash "safe bash options"
snippet sbash "safe bash options" b
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
`!p snip.rv ='\n\n' `
endsnippet
snippet temp "Tempfile"
snippet temp "Tempfile" b
${1:TMPFILE}="$(mktemp -t ${3:--suffix=${4:.SUFFIX}} ${2:`!p
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
`}.XXXXXX)"
@ -48,27 +44,27 @@ ${5:${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'}${6/(.+)/" 0 # EXIT\
endsnippet
snippet case "case .. esac (case)"
snippet /case|sw(itch)?/ "case .. esac (case)" rb
case ${1:word} in
${2:pattern} )
$0;;
${0:${VISUAL}};;
esac
endsnippet
snippet elif "elif .. (elif)"
snippet elif "elif .. (elif)" b
elif ${2:[[ ${1:condition} ]]}; then
${0:#statements}
${0:${VISUAL}}
endsnippet
snippet for "for ... done (for)"
snippet for "for ... done (for)" b
for (( i = 0; i < ${1:10}; i++ )); do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
snippet forin "for ... in ... done (forin)"
snippet forin "for ... in ... done (forin)" b
for ${1:i}${2/.+/ in /}${2:words}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
@ -78,21 +74,21 @@ snippet here "here document (here)"
${1/['"`](.+)['"`]/$1/}
endsnippet
snippet if "if ... then (if)"
snippet if "if ... then (if)" b
if ${2:[[ ${1:condition} ]]}; then
${0:#statements}
${0:${VISUAL}}
fi
endsnippet
snippet until "until ... (done)"
snippet until "until ... (done)" b
until ${2:[[ ${1:condition} ]]}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet
snippet while "while ... (done)"
snippet /wh(ile)?/ "while ... (done)" rb
while ${2:[[ ${1:condition} ]]}; do
${0:#statements}
${0:${VISUAL}}
done
endsnippet

View File

@ -85,7 +85,7 @@ snippet fig "Figure environment" b
\begin{figure}[${2:htpb}]
\centering
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
\caption{${4/(\w+)\.\w+/\u$1/}$0}
\caption{${4/(\w+)\.\w+/\u$1/}$0}%
\label{fig:${4/(\w+)\.\w+/$1/}}
\end{figure}
endsnippet
@ -220,4 +220,25 @@ ${2:${VISUAL:code}}
$0
endsnippet
snippet gln "New glossary item" b
\newglossaryentry{${1:identifier}}
{
name={${2:name}},
first={${3:first occurrence}},
sort={${4:sort value}},
description={${0:description}},
}
endsnippet
snippet glnl "New long glossary item" b
\longnewglossaryentry{${1:identifier}}
{
name={${2:name}},
first={${3:first occurrence}},
sort={${4:sort value}},
}
{
${0:description}
}
endsnippet
# vim:ft=snippets:

View File

@ -4,14 +4,9 @@ extends sh
priority -49
snippet #! "shebang" b
#!/bin/zsh
endsnippet
snippet !env "#!/usr/bin/env (!env)" b
snippet #! "#!/usr/bin/env zsh" b
#!/usr/bin/env zsh
$0
endsnippet
# vim:ft=snippets:

View File

@ -1,25 +1,28 @@
"""Helper methods used in UltiSnips snippets."""
import string, vim
import string, vim, re
def complete(tab, opts):
"""
get options that start with tab
get options that match with tab
:param tab: query string
:param opts: list that needs to be completed
:return: a string that start with tab
:return: a string that match with tab
"""
msg = "({0})"
if tab:
opts = [m[len(tab):] for m in opts if m.startswith(tab)]
if len(opts) == 1:
return opts[0]
if not len(opts):
msg = "{0}"
return msg.format("|".join(opts))
el = [x for x in tab]
pat = "".join(list(map(lambda x: x + "\w*" if re.match("\w", x) else x,
el)))
try:
opts = [x for x in opts if re.search(pat, x, re.IGNORECASE)]
except:
opts = [x for x in opts if x.startswith(tab)]
if not len(opts) or str.lower(tab) in list(map(str.lower, opts)):
return ""
cads = "|".join(opts[:5])
if len(opts) > 5: cads += "|..."
return "({0})".format(cads)
def _parse_comments(s):
""" Parses vim's comments option to extract comment format """
@ -69,7 +72,7 @@ def get_comment_format():
commentstring = vim.eval("&commentstring")
if commentstring.endswith("%s"):
c = commentstring[:-2]
return (c, c, c, "")
return (c.rstrip(), c.rstrip(), c.rstrip(), "")
comments = _parse_comments(vim.eval("&comments"))
for c in comments:
if c[0] == "SINGLE_CHAR":
@ -90,3 +93,26 @@ def make_box(twidth, bwidth=None):
def foldmarker():
"Return a tuple of (open fold marker, close fold marker)"
return vim.eval("&foldmarker").split(",")
def display_width(str):
"""Return the required over-/underline length for str."""
try:
# Respect &ambiwidth and &tabstop, but old vim may not support this
return vim.strdisplaywidth(str)
except AttributeError:
# Fallback
from unicodedata import east_asian_width
result = 0
for c in str:
result += 2 if east_asian_width(c) in ('W', 'F') else 1
return result
# http://stackoverflow.com/questions/2718196/find-all-chinese-text-in-a-string-using-python-and-regex
def has_cjk(s):
"""Detect if s contains CJK characters."""
cjk_re = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一-鿃豈-鶴侮-頻並-龎]', re.UNICODE)
return cjk_re.search(s) is not None
# vim:set et sts=0 sw=4 ts=4:

View File

@ -36,45 +36,71 @@ snippet @m "@media mediatype { }"
${2:${VISUAL}}
}${0}
snippet ac
align-content: ${0:stretch};
align-content: ${1:stretch};
snippet ac:s
align-content: start;
snippet ac:e
align-content: end;
snippet ac:c
align-content: center;
snippet ac:fe
align-content: flex-end;
snippet ac:fs
align-content: flex-start;
snippet ac:sa
align-content: space-around;
snippet ac:fe
align-content: flex-end;
snippet ac:sb
align-content: space-between;
snippet ac:s
snippet ac:sa
align-content: space-around;
snippet ac:se
align-content: space-evenly;
snippet ac:st
align-content: stretch;
snippet ac:b
align-content: baseline;
snippet ac:fb
align-content: first baseline;
snippet ac:lb
align-content: last baseline;
snippet ai
align-items: ${0:stretch};
snippet ai:b
align-items: baseline;
align-items: ${1:stretch};
snippet ai:s
align-items: start;
snippet ai:e
align-items: end;
snippet ai:c
align-items: center;
snippet ai:fe
align-items: flex-end;
snippet ai:fs
align-items: flex-start;
snippet ai:s
snippet ai:fe
align-items: flex-end;
snippet ai:st
align-items: stretch;
snippet ai:b
align-items: baseline;
snippet ai:fb
align-items: first baseline;
snippet ai:lb
align-items: last baseline;
snippet as
align-self: ${0};
snippet as:a
align-self: auto;
snippet as:b
align-self: baseline;
align-self: ${1:stretch};
snippet as:s
align-self: start;
snippet as:e
align-self: end;
snippet as:c
align-self: center;
snippet as:fe
align-self: flex-end;
snippet as:st
align-self: stretch;
snippet as:fs
align-self: flex-start;
snippet as:s
align-self: stretch;
snippet as:fe
align-self: flex-end;
snippet as:b
align-self: baseline;
snippet as:fb
align-self: first baseline;
snippet as:lb
align-self: last baseline;
snippet bg+
background: #${1:fff} url(${2}) ${3:0} ${4:0} ${5:no-repeat};${0}
snippet bga
@ -423,6 +449,8 @@ snippet d:b
display: block;
snippet d:cp
display: compact;
snippet d:g
display: grid;
snippet d:f
display: flex;
snippet d:ib
@ -605,24 +633,122 @@ snippet fw:n
font-weight: normal;
snippet f
font: ${1};${0}
snippet g
grid: ${1};
snippet gaf
grid-auto-flow: ${1:row};
snippet gaf+
grid-auto-flow: ${1:row} ${2:dense};
snippet gaf:r
grid-auto-flow: row;
snippet gaf:c
grid-auto-flow: column;
snippet gaf:d
grid-auto-flow: dense;
snippet gaf:rd
grid-auto-flow: row dense;
snippet gaf:cd
grid-auto-flow: column dense;
snippet gar
grid-auto-rows: ${1};
snippet gar:a
grid-auto-rows: auto
snippet gar:mac
grid-auto-rows: max-content;
snippet gar:mic
grid-auto-rows: min-content;
snippet gac
grid-auto-columns: ${1};
snippet gac:a
grid-auto-columns: auto
snippet gac:mac
grid-auto-columns: max-content;
snippet gac:mic
grid-auto-columns: min-content;
snippet gt
grid-template: ${1};
snippet gt+
grid-template: ${1} / ${2};
snippet gtr
grid-template-rows: ${1};
snippet gtc
grid-template-columns: ${1};
snippet gta
grid-template-areas: ${1};
snippet gg
grid-gap: ${1};
snippet gg+
grid-gap: ${1} ${2};
snippet gg:0
grid-gap: 0;
snippet grg
grid-row-gap: ${1};
snippet grg:0
grid-row-gap: 0;
snippet gcg
grid-column-gap: ${1};
snippet gcg:0
grid-column-gap: 0;
snippet gr
grid-row: ${1} / ${2};
snippet grs
grid-row-start: ${1};
snippet gre
grid-row-end: ${1};
snippet gc
grid-column: ${1} / ${2};
snippet gcs
grid-column-start: ${1};
snippet gce
grid-column-end: ${1};
snippet h
height: ${1};${0}
snippet h:a
height: auto;
snippet jc
justify-content: ${0:flex-start};
justify-content: ${1};
snippet jc:s
justify-content: start;
snippet jc:e
justify-content: end;
snippet jc:c
justify-content: center;
snippet jc:fe
justify-content: flex-end;
snippet jc:fs
justify-content: flex-start;
snippet jc:sa
justify-content: space-around;
snippet jc:fe
justify-content: flex-end;
snippet jc:sb
justify-content: space-between;
snippet jc:sa
justify-content: space-around;
snippet jc:se
justify-content: space-evenly;
snippet jc:st
justify-content: stretch;
snippet jc:l
justify-content: left;
snippet jc:r
justify-content: right;
snippet ji
justify-items: ${1:stretch};
snippet ji:s
justify-items: start;
snippet ji:e
justify-items: end;
snippet ji:c
justify-items: center;
snippet ji:st
justify-items: stretch;
snippet js
justify-self: ${1:stretch};
snippet js:s
justify-self: start;
snippet js:e
justify-self: end;
snippet js:c
justify-self: center;
snippet js:st
justify-self: stretch;
snippet l
left: ${1};${0}
snippet l:a
@ -789,6 +915,28 @@ snippet p:2
padding: ${1:0} ${2:0};${0}
snippet p:0
padding: 0;
snippet pc
place-content: ${1};
snippet pc+
place-content: ${1} ${2};
snippet pc:s
place-content: start;
snippet pc:e
place-content: end;
snippet pc:c
place-content: center;
snippet pc:fs
place-content: flex-start;
snippet pc:fe
place-content: flex-end;
snippet pc:sb
place-content: space-between;
snippet pc:sa
place-content: space-around;
snippet pc:se
place-content: space-evenly;
snippet pc:st
place-content: stretch;
snippet pgba
page-break-after: ${1};${0}
snippet pgba:aw
@ -815,6 +963,17 @@ snippet pgbi:a
page-break-inside: auto;
snippet pgbi:av
page-break-inside: avoid;
snippet pi
place-items: ${1:stretch};
snippet pi+
place-items: ${1:stretch} ${2:stretch};
snippet pi:s
place-items: start;
snippet pi:e
place-items: end;
snippet pi:c
place-items: center;
snippet pi:st
snippet pos
position: ${1};${0}
snippet pos:a
@ -825,6 +984,18 @@ snippet pos:r
position: relative;
snippet pos:s
position: static;
snippet ps
place-self: ${1:stretch};
snippet ps+
place-self: ${1:stretch} ${2:stretch};
snippet ps:s
place-self: start;
snippet ps:e
place-self: end;
snippet ps:c
place-self: center;
snippet ps:st
place-self: stretch;
snippet q
quotes: ${1};${0}
snippet q:en

View File

@ -1,9 +1,11 @@
extends html
snippet %
snippet % <% %>
<% ${0} %>
snippet =
snippet = <%= %>
<%= ${0} %>
snippet # <%# %>
<%# ${0} %>
snippet end
<% end %>
snippet for
@ -20,13 +22,35 @@ snippet ife
<% else %>
${0}
<% end %>
snippet ft
snippet cond
<%= cond do %>
<% ${1} -> %>
${2:${VISUAL}}
<% true -> %>
${0}
<% end %>
snippet unless
<%= unless ${1} do %>
${0:${VISUAL}}
<% end %>
snippet ft form_tag
<%= form_tag(${1:"/users"}, method: ${2::post}) %>
${0}
</form>
snippet lin
snippet et error_tag
<%= error_tag ${1:f}, :${2:field} %>
snippet ti text_input
<%= text_input ${1:f}, :${2:field} %>
snippet la label
<%= label ${1:f}, :${2:field}, "${3:Label}" %>
snippet pi password_input
<%= password_input ${1:f}, :${2:password} %>
snippet render
<%= render "${1:index}.html", ${2:var: @var} %>
snippet lin link
<%= link "${1:Submit}", to: ${2:"/users"}, method: ${3::delete} %>
snippet ff
snippet ff form_for
<%= form_for @changeset, ${1:"/users"}, fn f -> %>
${0}

View File

@ -188,6 +188,8 @@ snippet try try .. rescue .. end
snippet pry
require IEx; IEx.pry
${0}
snippet ppry
|> (fn x -> require IEx; IEx.pry; x end).()${0}
snippet qu
quote do
${1}

View File

@ -1,13 +1,13 @@
snippet impl
implicit none
$0
${0}
snippet prog
program ${1:main}
$0
${0}
end program $1
snippet mod
module ${1:modulename}
$0
${0}
end module $1
snippet proc
procedure ${1:name}
@ -25,7 +25,7 @@ snippet doc
! Github: `g:snips_github`
! Description: $1
! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
$0
${0}
snippet dox
!> @brief ${1}
!!
@ -37,45 +37,45 @@ snippet doxp
# Variables definitions
# Boolean
snippet bool
logical :: $0
logical :: ${0}
# Integer
snippet int
integer :: $0
integer :: ${0}
snippet real
real :: $0
real :: ${0}
# Double Precision
snippet double
double precision :: $0
double precision :: ${0}
# Char
snippet str
character(len=${1:*}) :: ${0:}
# Types
snippet type
type(${1:name})
$0
${0}
end type
snippet const
${1:type}, parameter :: $2 = $0
${1:type}, parameter :: $2 = ${0}
snippet arr
${1:type}, ${2:allocatable, }dimension(${3::}) :: $0
${1:type}, ${2:allocatable, }dimension(${3::}) :: ${0}
snippet intent
${1:type}, intent(inout) :: $0
${1:type}, intent(inout) :: ${0}
# Array
snippet /
(/ $1 /) ${2:,&} $0
(/ $1 /) ${2:,&} ${0}
snippet if
if (${1:condition}) then
$0
${0}
end if
snippet case
select case (${1:expr})
case ($2)
case default
$3
end select $0
end select ${0}
snippet do
do ${1:i} = ${2:start}, ${3:end}, ${4:incr}
$0
${0}
end do
snippet dow
do while (${1:condition})
@ -83,21 +83,21 @@ snippet dow
end do
snippet sub
subroutine ${1:name}($2)
$0
${0}
end subroutine $1
snippet func
function ${1:name}($2) result($3)
$0
${0}
end function $1
snippet pr
write(*,*) $0
write(*,*) ${0}
snippet dpr
write(*,*) '$1 = ', $1
snippet read
read(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) $0
read(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) ${0}
snippet write
write(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) $0
write(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) ${0}
snippet open
open(unit = ${1:fp}, file = ${2:filename}, status = ${3:unknown}, iostat = ${4:ierr}) $0
open(unit = ${1:fp}, file = ${2:filename}, status = ${3:unknown}, iostat = ${4:ierr}) ${0}
snippet close
close(unit = ${1:fp}) $0
close(unit = ${1:fp}) ${0}

View File

@ -1,27 +1,74 @@
extends html
snippet assign
<#assign ${1} = ${0:${VISUAL}} />
snippet if
<#if ${1}>
# Freemarker version
snippet ver "${.version}"
\${.version}
# Interpolation
snippet int "${interpolation}"
\${${0:interpolation${VISUAL}}\}
# Interpolation with default string
snippet intd "${interpolation!"default_string"}"
\${${0:interpolation${VISUAL}}!"${1:default_string}"\}
# Comment
snippet com "<#-- comment -->"
<#-- ${0:comment${VISUAL}} -->
# Variable assignment on a single line
snippet ass "<#assign variable_name = value />"
<#assign ${1:variable_name} = ${0:value${VISUAL}} />
# Variable assignments on multiple lines
snippet assm "<#assign <#-- multiple lines --> />"
<#assign
${1:variable_name} = ${0:value${VISUAL}}
/>
# Local variable assignment on a single
snippet loc "<#local variable_name = value />"
<#local ${1:variable_name} = ${0:value${VISUAL}} />
# Local variable assignments on multiple lines
snippet locm "<#local <#-- multiple lines --> />"
<#local
${1:variable_name} = ${0:value${VISUAL}}
/>
# Include Freemarker file
snippet inc "<#include \"file.ftl\" />"
<#include "${0:file.ftl${VISUAL}}" />
# If statement
snippet if "<#if condition>...</#if>"
<#if ${1:true}>
${0:${VISUAL}}
</#if>
snippet ife
<#if ${1}>
${2:${VISUAL}}
# If/else statement
snippet ife "<#if condition>...<#else>...</#if>"
<#if ${1:true}>
${0:${VISUAL}}
<#else>
${0}
${2}
</#if>
snippet list
<#list ${1} as ${2}>
# Iteration over a sequence
snippet lis "<#list sequence as element>...</#list>"
<#list ${1:sequence} as ${2:element}>
${0:${VISUAL}}
</#list>
snippet attempt
# Iteration over an hashmap
snippet lish "<#list hashmap?keys as element>...</#list>"
<#list ${1:hashmap}?keys as ${2:key}>
\${$2\}: \${$1[$2]\}${0:${VISUAL}}
</#list>
# Macro statement
snippet mac "<#macro macro_name param1>...</#macro>"
<#macro ${1:macro_name} ${2:param1}>
${0:${VISUAL}}
</#macro>
# Function statement
snippet fun "<#function function_name param1>...</#function>"
<#function ${1:function_name} ${2:param1}>
${0:${VISUAL}}
</#function>
# Attempt statement (try-catch to prevent runtime exceptions)
snippet att "<#attempt>...<#recover></#attempt>"
<#attempt>
${0:${VISUAL}}
<#recover>
</#attempt>
# Then built-in for booleans
snippet ?th "?then(true, false)"
?then(${1:true}, ${0:false${VISUAL}})

View File

@ -31,9 +31,6 @@ snippet cs "case"
case ${1:value}:
${0:${VISUAL}}
snippet c "const"
const ${1:NAME} = ${0:0}
snippet co "constants with iota"
const (
${1:NAME1} = iota
@ -53,9 +50,6 @@ snippet dfr "defer recover"
}
}()
snippet i "int"
int
snippet im "import"
import (
"${1:package}"
@ -228,6 +222,23 @@ snippet test "test function"
${0:${VISUAL}}
}
snippet testt "table test function"
func Test${1:name}(t *testing.T) {
tests := []struct {
name string
}{
{
name: "${2:test name}",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
${0:${VISUAL}}
})
}
}
snippet bench "benchmark function"
func Benchmark${1:name}(b *testing.B) {
for i := 0; i < b.N; i++ {

View File

@ -9,7 +9,12 @@ snippet fun "function"
function ${1:function_name}(${2}) {
${0:${VISUAL}}
}
<<<<<<< HEAD
snippet fun "async function"
=======
# Asynchronous Function
snippet asf "async function"
>>>>>>> 27ad0d07862847896f691309a544a206783c94d6
async function ${1:function_name}(${2}) {
${0:${VISUAL}}
}
@ -282,6 +287,11 @@ snippet timeout
setTimeout(function () {${0}}${2}, ${1:10});
snippet const
const ${1} = ${0};
<<<<<<< HEAD
=======
snippet constn
const ${1} = new ${0};
>>>>>>> 27ad0d07862847896f691309a544a206783c94d6
snippet let
let ${1} = ${0};
snippet im "import xyz from 'xyz'"

View File

@ -0,0 +1,2 @@
extends matlab

View File

@ -0,0 +1,2 @@
extends markdown

View File

@ -207,7 +207,7 @@ snippet define
}
snippet service
service { "${1:service}" :
service { "${1:service}":
ensure => running,
enable => true,
require => [ Package["${2:package}"], File["${3:file}"], ],
@ -215,7 +215,7 @@ snippet service
}
snippet file
file { "${1:filename}" :
file { "${1:filename}":
ensure => ${2:present},
owner => "${3:root}",
group => "${4:root}",
@ -227,7 +227,7 @@ snippet file
}
snippet archive
archive { "${1:filename}" :
archive { "${1:filename}":
ensure => ${2:present},
url => "http://${3:url}",
extension => "${4:tgz}",
@ -237,7 +237,7 @@ snippet archive
}
snippet firewall
firewall { "${1:comment}" :
firewall { "${1:comment}":
proto => ${2:tcp},
action => ${3:accept},
port => ${4},

View File

@ -19,16 +19,17 @@ snippet -
${0}
#some directive
snippet img:
.. |${0:alias}| image:: ${1:img}
.. |${1:alias}| image:: ${0:img}
snippet fig:
.. figure:: ${1:img}
:alt: ${0:alter text}
:alt: ${2:alter text}
$0
snippet con:
.. contents:: ${1:Table of Contents}
$2
snippet cont:
.. contents::
${0:content}
snippet code:
snippet cod:
.. code:: ${1:type}
${0:write some code}
@ -65,34 +66,36 @@ snippet tod:
.. todo::
${0}
snippet lis:
.. list-table:: ${0:Title}
.. list-table:: ${1:Title}
:header-rows: 1
:stub-columns: 1
:stub-columns: 0
* - x1,y1
- x2,y1
- x3,y1
* - x1,y2
- x2,y2
- x3,y2
* - x1,y3
- x2,y3
- x3,y3
* - ${0:R1C1}
- R1C2
* - R2C1
- R2C2
snippet csv:
.. csv-table:: ${1:Title}
:header-rows: 1
:stub-columns: 0
${0:R1C1}, R1C2
R2C1, R2C2
snippet toc:
.. toctree::
:maxdepth: 2
${0}
snippet dow:
:download:\`${0:text} <${1:path}>\`
:download:\`${1:text} <${0:path}>\`
snippet ref:
:ref:\`${0:text} <${1:path}>\`
:ref:\`${1:text} <${0:path}>\`
snippet doc:
:doc:`${0:text} <${1:path}>`
:doc:\`${1:text} <${0:path}>\`
# CJK optimize, CJK has no space between charaters
snippet *c
\ *${1:Emphasis}*\ ${0}
snippet **c
\ **${1:Strong emphasis}**\ ${0}
# vim:set list noet sts=0 sw=4 ts=4:

View File

@ -232,3 +232,7 @@ snippet macro "macro_rules!" b
}
snippet box "Box::new()"
Box::new(${0:${VISUAL}})
snippet rc "Rc::new()"
Rc::new(${0:${VISUAL}})
snippet unim "unimplemented!()"
unimplemented!()

View File

@ -34,6 +34,72 @@ snippet while
${0:${VISUAL}}
snippet !
!important
snippet ac
align-content: ${0}
snippet ac:s
align-content: start
snippet ac:e
align-content: end
snippet ac:c
align-content: center
snippet ac:fs
align-content: flex-start
snippet ac:fe
align-content: flex-end
snippet ac:sb
align-content: space-between
snippet ac:sa
align-content: space-around
snippet ac:se
align-content: space-evenly
snippet ac:st
align-content: stretch
snippet ac:b
align-content: baseline
snippet ac:fb
align-content: first baseline
snippet ac:lb
align-content: last baseline
snippet ai
align-items: ${0}
snippet ai:s
align-items: start
snippet ai:e
align-items: end
snippet ai:c
align-items: center
snippet ai:fs
align-items: flex-start
snippet ai:fe
align-items: flex-end
snippet ai:st
align-items: stretch
snippet ai:b
align-items: baseline
snippet ai:fb
align-items: first baseline
snippet ai:lb
align-items: last baseline
snippet as
align-self: ${0}
snippet as:s
align-self: start
snippet as:e
align-self: end
snippet as:c
align-self: center
snippet as:st
align-self: stretch
snippet as:fs
align-self: flex-start
snippet as:fe
align-self: flex-end
snippet as:b
align-self: baseline
snippet as:fb
align-self: first baseline
snippet as:lb
align-self: last baseline
snippet bdi:m+
-moz-border-image: url('${1}') ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
snippet bdi:m
@ -411,6 +477,10 @@ snippet d:b
display: block
snippet d:cp
display: compact
snippet d:g
display: grid
snippet d:f
display: flex
snippet d:ib
display: inline-block
snippet d:itb
@ -561,10 +631,122 @@ snippet fw:n
font-weight: normal
snippet f
font: ${0}
snippet g
grid: ${0}
snippet gaf
grid-auto-flow: ${0}
snippet gaf+
grid-auto-flow: ${1:row} ${0:dense}
snippet gaf:r
grid-auto-flow: row
snippet gaf:c
grid-auto-flow: column
snippet gaf:d
grid-auto-flow: dense
snippet gaf:rd
grid-auto-flow: row dense
snippet gaf:cd
grid-auto-flow: column dense
snippet gar
grid-auto-rows: ${0}
snippet gar:a
grid-auto-rows: auto
snippet gar:mac
grid-auto-rows: max-content
snippet gar:mic
grid-auto-rows: min-content
snippet gac
grid-auto-columns: ${0}
snippet gac:a
grid-auto-columns: auto
snippet gac:mac
grid-auto-columns: max-content
snippet gac:mic
grid-auto-columns: min-content
snippet gt
grid-template: ${0}
snippet gt+
grid-template: ${1} / ${0}
snippet gtr
grid-template-rows: ${0}
snippet gtc
grid-template-columns: ${0}
snippet gta
grid-template-areas: ${0}
snippet gg
grid-gap: ${0}
snippet gg+
grid-gap: ${1} ${0}
snippet gg:0
grid-gap: 0
snippet grg
grid-row-gap: ${0}
snippet grg:0
grid-row-gap: 0
snippet gcg
grid-column-gap: ${0}
snippet gcg:0
grid-column-gap: 0
snippet gr
grid-row: ${1} / ${0}
snippet grs
grid-row-start: ${0}
snippet gre
grid-row-end: ${0}
snippet gc
grid-column: ${1} / ${0}
snippet gcs
grid-column-start: ${0}
snippet gce
grid-column-end: ${0}
snippet h
height: ${0}
snippet h:a
height: auto
snippet jc
justify-content: ${0}
snippet jc:s
justify-content: start
snippet jc:e
justify-content: end
snippet jc:c
justify-content: center
snippet jc:fs
justify-content: flex-start
snippet jc:fe
justify-content: flex-end
snippet jc:sb
justify-content: space-between
snippet jc:sa
justify-content: space-around
snippet jc:se
justify-content: space-evenly
snippet jc:st
justify-content: stretch
snippet jc:l
justify-content: left
snippet jc:r
justify-content: right
snippet ji
justify-items: ${0}
snippet ji:s
justify-items: start
snippet ji:e
justify-items: end
snippet ji:c
justify-items: center
snippet ji:st
justify-items: stretch
snippet js
justify-self: ${0}
snippet js:s
justify-self: start
snippet js:e
justify-self: end
snippet js:c
justify-self: center
snippet js:st
justify-self: stretch
snippet l
left: ${0}
snippet l:a
@ -729,6 +911,28 @@ snippet p:2
padding: ${1:0} ${0:0}
snippet p:0
padding: 0
snippet pc
place-content: ${0}
snippet pc+
place-content: ${1} ${0}
snippet pc:s
place-content: start
snippet pc:e
place-content: end
snippet pc:c
place-content: center
snippet pc:fs
place-content: flex-start
snippet pc:fe
place-content: flex-end
snippet pc:sb
place-content: space-between
snippet pc:sa
place-content: space-around
snippet pc:se
place-content: space-evenly
snippet pc:st
place-content: stretch
snippet pgba
page-break-after: ${0}
snippet pgba:aw
@ -755,6 +959,18 @@ snippet pgbi:a
page-break-inside: auto
snippet pgbi:av
page-break-inside: avoid
snippet pi
place-items: ${0}
snippet pi+
place-items: ${1:stretch} ${0:stretch}
snippet pi:s
place-items: start
snippet pi:e
place-items: end
snippet pi:c
place-items: center
snippet pi:st
place-items: stretch
snippet pos
position: ${0}
snippet pos:a
@ -765,6 +981,18 @@ snippet pos:r
position: relative
snippet pos:s
position: static
snippet ps
place-self: ${0}
snippet ps+
place-self: ${1:stretch} ${0:stretch}
snippet ps:s
place-self: start
snippet ps:e
place-self: end
snippet ps:c
place-self: center
snippet ps:st
place-self: stretch
snippet q
quotes: ${0}
snippet q:en

View File

@ -4,10 +4,10 @@ snippet #!
snippet s#!
#!/usr/bin/env sh
set -euo pipefail
set -eu
snippet safe
set -euo pipefail
set -eu
snippet bash
#!/usr/bin/env bash

View File

@ -1,5 +1,71 @@
snippet !
!important
snippet ac
align-content ${0}
snippet ac:s
align-content start
snippet ac:e
align-content end
snippet ac:c
align-content center
snippet ac:fs
align-content flex-start
snippet ac:fe
align-content flex-end
snippet ac:sb
align-content space-between
snippet ac:sa
align-content space-around
snippet ac:se
align-content space-evenly
snippet ac:st
align-content stretch
snippet ac:b
align-content baseline
snippet ac:fb
align-content first baseline
snippet ac:lb
align-content last baseline
snippet ai
align-items ${0}
snippet ai:s
align-items start
snippet ai:e
align-items end
snippet ai:c
align-items center
snippet ai:fs
align-items flex-start
snippet ai:fe
align-items flex-end
snippet ai:st
align-items stretch
snippet ai:b
align-items baseline
snippet ai:fb
align-items first baseline
snippet ai:lb
align-items last baseline
snippet as
align-self ${0}
snippet as:s
align-self start
snippet as:e
align-self end
snippet as:c
align-self center
snippet as:st
align-self stretch
snippet as:fs
align-self flex-start
snippet as:fe
align-self flex-end
snippet as:b
align-self baseline
snippet as:fb
align-self first baseline
snippet as:lb
align-self last baseline
snippet bdi:m+
-moz-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
snippet bdi:m
@ -379,10 +445,12 @@ snippet d:mis
display -moz-inline-stack
snippet d:b
display block
snippet d:f
display flex
snippet d:cp
display compact
snippet d:g
display grid
snippet d:f
display flex
snippet d:ib
display inline-block
snippet d:itb
@ -533,6 +601,74 @@ snippet fw:n
font-weight normal
snippet f
font ${0}
snippet g
grid ${0}
snippet gaf
grid-auto-flow ${0}
snippet gaf+
grid-auto-flow ${1:row} ${0:dense}
snippet gaf:r
grid-auto-flow row
snippet gaf:c
grid-auto-flow column
snippet gaf:d
grid-auto-flow dense
snippet gaf:rd
grid-auto-flow row dense
snippet gaf:cd
grid-auto-flow column dense
snippet gar
grid-auto-rows ${0}
snippet gar:a
grid-auto-rows auto
snippet gar:mac
grid-auto-rows max-content
snippet gar:mic
grid-auto-rows min-content
snippet gac
grid-auto-columns ${0}
snippet gac:a
grid-auto-columns auto
snippet gac:mac
grid-auto-columns max-content
snippet gac:mic
grid-auto-columns min-content
snippet gt
grid-template ${0}
snippet gt+
grid-template ${1} / ${0}
snippet gtr
grid-template-rows ${0}
snippet gtc
grid-template-columns ${0}
snippet gta
grid-template-areas ${0}
snippet gg
grid-gap ${0}
snippet gg+
grid-gap ${1} ${0}
snippet gg:0
grid-gap 0
snippet grg
grid-row-gap ${0}
snippet grg:0
grid-row-gap 0
snippet gcg
grid-column-gap ${0}
snippet gcg:0
grid-column-gap 0
snippet gr
grid-row ${1} / ${0}
snippet grs
grid-row-start ${0}
snippet gre
grid-row-end ${0}
snippet gc
grid-column ${1} / ${0}
snippet gcs
grid-column-start ${0}
snippet gce
grid-column-end ${0}
snippet h
height ${0}
snippet h:a
@ -701,6 +837,28 @@ snippet p:2
padding ${1:0} ${0:0}
snippet p:0
padding 0
snippet pc
place-content ${0}
snippet pc+
place-content ${1} ${0}
snippet pc:s
place-content start
snippet pc:e
place-content end
snippet pc:c
place-content center
snippet pc:fs
place-content flex-start
snippet pc:fe
place-content flex-end
snippet pc:sb
place-content space-between
snippet pc:sa
place-content space-around
snippet pc:se
place-content space-evenly
snippet pc:st
place-content stretch
snippet pgba
page-break-after ${0}
snippet pgba:aw
@ -727,6 +885,18 @@ snippet pgbi:a
page-break-inside auto
snippet pgbi:av
page-break-inside avoid
snippet pi
place-items ${0}
snippet pi+
place-items ${1:stretch} ${0:stretch}
snippet pi:s
place-items start
snippet pi:e
place-items end
snippet pi:c
place-items center
snippet pi:st
place-items stretch
snippet pos
position ${0}
snippet pos:a
@ -737,6 +907,18 @@ snippet pos:r
position relative
snippet pos:s
position static
snippet ps
place-self ${0}
snippet ps+
place-self ${1:stretch} ${0:stretch}
snippet ps:s
place-self start
snippet ps:e
place-self end
snippet ps:c
place-self center
snippet ps:st
place-self stretch
snippet q
quotes ${0}
snippet q:en
@ -993,7 +1175,47 @@ snippet for
for ${1:i} in ${0}
snippet keyf
@keyframes ${0}
snippet jc
justify-content ${0}
snippet jc:s
justify-content start
snippet jc:e
justify-content end
snippet jc:c
justify-content center
snippet jc
justify-content
snippet jc:fs
justify-content flex-start
snippet jc:fe
justify-content flex-end
snippet jc:sb
justify-content space-between
snippet jc:sa
justify-content space-around
snippet jc:se
justify-content space-evenly
snippet jc:st
justify-content space-evenly
snippet jc:l
justify-content left
snippet jc:r
justify-content right
snippet ji
justify-items ${0}
snippet ji:s
justify-items start
snippet ji:e
justify-items end
snippet ji:c
justify-items center
snippet ji:st
justify-items stretch
snippet js
justify-self ${0}
snippet js:s
justify-self start
snippet js:e
justify-self end
snippet js:c
justify-self center
snippet js:st
justify-self stretch

View File

@ -1,7 +1,7 @@
extends verilog
# Foreach Loop
snippet fe
snippet forea
foreach (${1}) begin
${0}
end

View File

@ -222,6 +222,10 @@ 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}
@ -248,7 +252,7 @@ snippet tikz figure environment (tikzpicture)
${2}
\\end{tikzpicture}
\\end{center}
\\caption{${3}}
\\caption{${3}}%
\\label{fig:${4}}
\\end{figure}
${0}

View File

@ -1 +1,43 @@
extends javascript
snippet tconst "ts const"
const ${1}: ${2:any} = ${3};
${0}
snippet tlet "ts let"
let ${1}: ${2:any} = ${3};
${0}
snippet tvar "ts var"
var ${1}: ${2:any} = ${3};
${0}
snippet + "var: type"
${1}: ${0:any}
snippet int "interface"
interface ${1} {
${2}: ${3:any};
${0}
}
snippet intx "interface extends"
interface ${1} extends ${2} {
${3}: ${4:any};
${0}
}
snippet tfun "ts function"
function ${1}(${2}): ${3:any} {
${0}
}
snippet tcla "ts class"
class ${1} {
${2}
constructor(public ${3}: ${4: any}) {
${5}
}
${0}
}
snippet tclax "ts class extends"
class ${1} extends ${2} {
${3}
constructor(public ${4}: ${5: any}) {
${6}
}
${0}
}

View File

@ -61,3 +61,23 @@ snippet mod
module ${1:module_name} (${2});
${0}
endmodule
# For
snippet for
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) begin
${4}
end
# Forever
snippet forev
forever begin
${0}
end
# Function
snippet fun
function ${1:void} ${2:name}(${3});
${0}
endfunction: $2
# Task
snippet task
task ${1:name}(${2});
${0}
endtask: $1

View File

@ -76,3 +76,5 @@ snippet im
imap ${1} ${2}
snippet exe
execute ${1}
snippet filename
`Filename()`

View File

@ -176,3 +176,14 @@ snippet vstore
${1:key}: ${2:value}
}
});
# vue-i18n snippets https://github.com/kazupon/vue-i18n
snippet trans
$t('$1')
# Translation with parameter
snippet transc
$t('$1', { $2: $3 })