Move SublimeSnippets files to new repository voussoir/sublime.

This commit is contained in:
Ethan Dalool 2020-08-10 20:37:47 -07:00
parent dacf71cbb4
commit 8fa87f6c3c
19 changed files with 0 additions and 411 deletions

View file

@ -1,40 +0,0 @@
[
{ "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}},
{ "keys": ["ctrl+shift+m"], "command": "toggle_minimap"},
{ "keys": ["alt+shift+."], "command": "insert_snippet", "args": { "name": "Packages/XML/long-tag.sublime-snippet" }},
{ "keys": ["shift+delete"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"}},
{ "keys": ["ctrl+shift+enter"], "command": "insert", "args": {"characters": "\n#"}},
{ "keys": ["f4"], "command": "timestamp" },
// Auto-pair backticks
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$|;)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double", "match_all": true }
]
},
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }
]
},
{ "keys": ["`"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
]
},
{ "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "`$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^`", "match_all": true }
]
}
]

View file

@ -1,7 +0,0 @@
{
"line_numbers": true,
"gutter": true,
"wrap_width": 120,
"word_wrap": false,
"scroll_past_end": true
}

View file

@ -1,11 +0,0 @@
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_face": "Consolas",
"font_size": 9,
"rulers":
[
80,
100
],
"scroll_speed": 0
}

View file

@ -1,30 +0,0 @@
<snippet>
<content><![CDATA[
import argparse
import sys
def $1_argparse(args):
return $1()
def main(argv):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('required_positional')
parser.add_argument('optional_positional', nargs='?', default=None)
parser.add_argument('-k', '--kwarg', dest='kwarg', default=None)
parser.add_argument('-b', '--boolkwarg', dest='boolkwarg', action='store_true')
parser.set_defaults(func=$1_argparse)
args = parser.parse_args(argv)
return args.func(args)
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
]]></content>
<tabTrigger>argparse</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,32 +0,0 @@
<snippet>
<content><![CDATA[
import argparse
import sys
def $1_argparse(args):
return $1()
def main(argv):
parser = argparse.ArgumentParser(description=__doc__)
subparsers = parser.add_subparsers()
p_$1 = subparsers.add_parser('$1')
p_$1.add_argument('required_positional')
p_$1.add_argument('optional_positional', nargs='?', default=None)
p_$1.add_argument('-k', '--kwarg', dest='kwarg', default=None)
p_$1.add_argument('-b', '--boolkwarg', dest='boolkwarg', action='store_true')
p_$1.set_defaults(func=$1_argparse)
args = parser.parse_args(argv)
return args.func(args)
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
]]></content>
<tabTrigger>argparse_multi</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,15 +0,0 @@
<snippet>
<content><![CDATA[
def main(argv):
return 0
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
]]></content>
<tabTrigger>defmain</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,11 +0,0 @@
<snippet>
<content><![CDATA[
# $1
################################################################################
]]></content>
<tabTrigger>hhh</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,42 +0,0 @@
<snippet>
<content><![CDATA[
from voussoirkit import betterhelp
DOCSTRING = '''
____my__program____
{____my__command____}
TO SEE DETAILS ON EACH COMMAND, RUN
> ____my__program____.py <command> --help
'''.lstrip()
SUB_DOCSTRINGS = dict(
____my__command____='''
____my__command____:
____my__command____description
> ____my__program____.py ____my__command____
flags:
--____my__flag____:
'''.strip(),
)
DOCSTRING = betterhelp.add_previews(DOCSTRING, SUB_DOCSTRINGS)
def main(argv):
return betterhelp.subparser_main(
argv,
parser,
main_docstring=DOCSTRING,
sub_docstrings=SUB_DOCSTRINGS,
)
]]></content>
<tabTrigger>helptext</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,12 +0,0 @@
<snippet>
<content><![CDATA[
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
]]></content>
<tabTrigger>ifmain</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,14 +0,0 @@
<snippet>
<content><![CDATA[
def listget(l, index, default=None):
try:
return l[index]
except IndexError:
return default
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>listget</tabTrigger>
</snippet>

View file

@ -1,11 +0,0 @@
<snippet>
<content><![CDATA[
raise NotImplementedError
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ni</tabTrigger>
<description>raise NotImplementedError</description>
</snippet>

View file

@ -1,18 +0,0 @@
<snippet>
<content><![CDATA[
from voussoirkit import pipeable
def main(argv):
for line in pipeable.go(argv, strip=True, skip_blank=True):
pipeable.output(line)
if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:]))
]]></content>
<tabTrigger>pipeablemain</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,10 +0,0 @@
<snippet>
<content><![CDATA[
System.out.println($1);$0
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>sysout</tabTrigger>
</snippet>

View file

@ -1,11 +0,0 @@
'''
Thank you tpitale
https://gist.github.com/tpitale/11e5a2a152ec67a172f9
'''
import datetime
import sublime, sublime_plugin
class TimestampCommand(sublime_plugin.TextCommand):
def run(self, edit):
timestamp = "%s" % (datetime.datetime.now().strftime("%Y %m %d"))
self.view.insert(edit, self.view.sel()[0].begin(), timestamp)

View file

@ -1,27 +0,0 @@
<snippet>
<content><![CDATA[
self.windowtitle = 'Window'
self.t = tkinter.Tk()
self.t.title(self.windowtitle)
self.w = 800
self.h = 525
self.screenwidth = self.t.winfo_screenwidth()
self.screenheight = self.t.winfo_screenheight()
self.windowwidth = self.w
self.windowheight = self.h
self.windowx = (self.screenwidth-self.windowwidth) / 2
self.windowy = ((self.screenheight-self.windowheight) / 2) - 27
self.geometrystring = '%dx%d+%d+%d' % (self.windowwidth, self.windowheight, self.windowx, self.windowy)
self.t.geometry(self.geometrystring)
self.build_gui_manager()
self.t.mainloop()
]]></content>
<tabTrigger>tkgeometry</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,43 +0,0 @@
<snippet>
<content><![CDATA[
import tkinter
class ScrollingFrame:
def __init__(self, t):
self.t = t
self.frame_primary = tkinter.Frame(t)
#self.frame_primary.pack(expand=True, fill='both')
self.canvas = tkinter.Canvas(self.frame_primary)
self.frame_inner = tkinter.Frame(self.canvas)
self.scrollbar = tkinter.Scrollbar(self.frame_primary, orient='vertical', command=self.canvas.yview)
self.canvas.configure(yscrollcommand=self.scrollbar.set)
self.scrollbar.pack(side='right', fill='y')
self.canvas.pack(expand=True, fill='both')
self.canvas.create_window((0, 0), window=self.frame_inner, anchor='nw')
def frame_inner_fix(*event):
children = self.frame_inner.winfo_children()
if len(children) == 0:
w = 25
else:
w = max(item.winfo_width() for item in children)
h = self.t.winfo_height()
self.canvas.configure(scrollregion=self.canvas.bbox("all"), width=w, height=h)
self.frame_inner.fix = frame_inner_fix
self.frame_primary.bind('<Configure>', self.frame_inner.fix)
def pack(self, *args, **kwargs):
self.frame_primary.pack(*args, **kwargs)
def grid(self, *args, **kwargs):
self.frame_primary.grid(*args, **kwargs)
]]></content>
<tabTrigger>tkscrollframe</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,35 +0,0 @@
<snippet>
<content><![CDATA[
import tkinter
class Application:
def __init__(self):
self.windowtitle = 'Window'
self.t = tkinter.Tk()
self.t.title(self.windowtitle)
w = 800
h = 525
screenwidth = self.t.winfo_screenwidth()
screenheight = self.t.winfo_screenheight()
windowwidth = w
windowheight = h
windowx = (screenwidth-windowwidth) / 2
windowy = ((screenheight-windowheight) / 2) - 27
self.geometrystring = '%dx%d+%d+%d' % (windowwidth, windowheight, windowx, windowy)
self.t.geometry(self.geometrystring)
self.build_gui_manager()
def build_gui_manager(self):
pass
def mainloop(self):
self.t.mainloop()
]]></content>
<tabTrigger>tktemplate</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>

View file

@ -1,10 +0,0 @@
<snippet>
<content><![CDATA[
utf-8
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>uu</tabTrigger>
</snippet>

View file

@ -1,32 +0,0 @@
<snippet>
<content><![CDATA[
<!DOCTYPE html5>
<html>
<head>
{% import "header.html" as header %}
<title>Title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/static/common.css">
<script src="/static/common.js"></script>
<style>
</style>
</head>
<body>
</body>
<script type="text/javascript">
</script>
</html>
]]></content>
<tabTrigger>webpage</tabTrigger>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>