#!/usr/bin/env python3 import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 """) # 'if' snippets. bsnip( "if", "if ... then ... end if;", r""" if $1 then $0 end if; """, ) bsnip( "ifclk", "if clk'event and clk = '1' then ... end if;", r""" if clk'event and clk = '1' then
#!/usr/bin/env python3 import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 """) wsnip( "ca", "$(call ", """ $(call $0 """, aliases=["call"], ) wsnip( "cs", "$(call S.", """ $(call S.$0 """, aliases=[],
#!/usr/bin/env python # vim:set fileencoding=utf8: import os import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" global !p from sniputil import betterVisual endglobal """) bsnip("chap", "Chapter/Title", r""" # $0 """) bsnip("sect", "Section", r""" ## $0 """, aliases=["h1"]) bsnip("subsec", "Subsection", r""" ### $0 """, aliases=["h2"])
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 extends c """)
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr from sniputil import put put(r""" priority -5 global !p from sniputil import betterVisual endglobal """) # Title snippets. def tsnip(trigger, desc, char, withOverline=False, flags="b", aliases=[], trimBody=True): """Title snippet.""" line = "`!p snip.rv = len(t[1]) * %r`\n" % char body = "" if withOverline: body = body + line body = body + "${1:" + desc + "}\n" + line + "\n$0\n"
#!/usr/bin/env python # vim:set fileencoding=utf8: import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" global !p from sniputil import betterVisual endglobal """) bsnip("docstring", "docstring for func or type", r""" /** * ${1:Brief description.} * * ${0:Full description.} */ """, flags="b", aliases=["doc", "/**"]) # Javadoc. wabbr("@param", "@param ${1:inParam} ${0:@todo Description of $1.}", aliases=["@p", "@pi", "@po", "@pio"]) wabbr("@return", "@return ", aliases=["@re", "@ret", "@retval", "@rv"]) wabbr("todo", "/** @todo ${1:Description of what's TO DO.} */") wabbr("bug", "/** @bug ${1:Description of BUG.} */")
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr # Snippets are now cleared in "clearsnippets" directory. put("extends c\n")
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr from sniputil import put put(r""" priority -5 global !p from sniputil import autoPeriod endglobal """) bsnip("#!", "#!/usr/bin/env python...", r""" #!/usr/bin/env python # vim:set fileencoding=utf8: # """) # 'if' snippets. bsnip("if", "if ...:<CR>", r""" if $1: $0 """)
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 """) # 'if' snippets. bsnip("if", "if ... then ... end if;", r""" if $1 then $0 end if; """) bsnip("ifclk", "if clk'event and clk = '1' then ... end if;", r""" if clk'event and clk = '1' then $0 end if; """) bsnip("else", "else ...", r""" else
# vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 global !p from sniputil import betterVisual from sniputil import autoPeriod endglobal """) # 'if' snippets. bsnip("if", "if (...) {...}", r""" if ($1) { `!p betterVisual(snip)`$0 } """) bsnip("else", "else {...}", r""" else {
from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr # Snippets are now cleared in "clearsnippets" directory. #put("clearsnippets\n") put(r""" global !p def betterVisual(snip, contIndentLevel=1): import textwrap text = textwrap.dedent(snip.v.text) for i, line in enumerate(text.splitlines()): if i == 0: snip.rv = snip.mkline(line) snip.shift(contIndentLevel) elif line.strip(): snip += line else: # Avoid indentation for empty lines. snip.rv += "\n" endglobal """) # 'if' snippets. bsnip("if", "if (...) {...}", r""" if ($1) { `!p betterVisual(snip)`$0 }
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 global !p from sniputil import betterVisual from sniputil import autoPeriod endglobal """) # 'if' snippets. bsnip("if", "if (...) {...}", r""" if ($1) { `!p betterVisual(snip)`$0 } """) bsnip("else", "else {...}", r"""
# vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 global !p from sniputil import betterVisual endglobal """) # 'if' snippets. bsnip("if", "if (...) {...}", r""" if ($1) { `!p betterVisual(snip)`$0 } """) bsnip("else", "else {...}", r""" else {
from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr bsnip("docstring", "docstring for func or type", r""" /** * ${1:Brief description.} * * ${0:Full description.} */ """, flags="b!", aliases=["doc", "/**"]) # Javadoc. wabbr("@param", "@param ${1:inParam} ${0:@todo Description of $1.}", aliases=["@p", "@pi", "@po", "@pio"]) wabbr("@return", "@return ", aliases=["@re", "@ret", "@retval", "@rv"]) wabbr("todo", "/** @todo ${1:Description of what's TO DO.} */") wabbr("bug", "/** @bug ${1:Description of BUG.} */") put(r""" snippet printf "printf('...', ...);" w! System.out.printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/} endsnippet snippet pf "printf('...', ...);" w! System.out.printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/} endsnippet """)
#!/usr/bin/env python # vim:set fileencoding=utf8: import os import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put("extends markdown\n") bsnip("ab", "Acked-by: ...", r""" Acked-by: John Szakmeister <*****@*****.**> """) bsnip("sob", "Signed-off-by: ...", r""" Signed-off-by: John Szakmeister <*****@*****.**> """) bsnip("rb", "Reviewed-by: ...", r""" Reviewed-by: John Szakmeister <*****@*****.**> """)
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import put from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr put(r""" priority -5 """) wsnip("call", "$(call )",""" $(call $0) """, aliases=["c"]) wsnip("v", "$()",""" $($0) """, aliases=[]) bsnip("def", "define funcName...endef $(call S.def,funcName)",""" define $1 $0 endef $(call S.def,$1) """, aliases=[])
#!/usr/bin/env python # vim:set fileencoding=utf8: import sys import re import setpypath from sniputil import snip, bsnip, wsnip from sniputil import abbr, babbr, wabbr from sniputil import put put(r""" priority -5 global !p from sniputil import betterVisual endglobal """) # Title snippets. def tsnip(trigger, desc, char, withOverline=False, flags="b", aliases=[], trimBody=True): """Title snippet."""