Skip to content

Instantly share code, notes, and snippets.

View OdatNurd's full-sized avatar

Terence Martin OdatNurd

View GitHub Profile
@OdatNurd
OdatNurd / .python-version
Last active July 8, 2024 03:37
Browse all Sublime Text commands provided by plugins
3.8
@OdatNurd
OdatNurd / Default (Windows).sublime-keymap
Created November 9, 2020 07:21
Setting up a Python REPL in Sublime Text using Terminus
[
// Place the bindings in your user Key bindings for whatever platform you're
// on (also, change the keys as appropriate for your use).
// Send a newline to the Terminus Python REPL, if it's open
{ "keys": ["shift+ctrl+enter"], "command": "terminus_send_string",
"args": {"string": "\n", "tag": "python-repl"},
"context": [
{ "key": "terminus_tag.exists", "operand": "python-repl" },
{ "key": "selector", "operator": "equal", "operand": "source.python" },
@OdatNurd
OdatNurd / Sample Build.sublime-build
Last active September 9, 2020 18:28
Sample plugin for allowing you to select what Makefile to use for a build
{
"target": "makefile_build",
"cancel": {"kill": true},
"shell_cmd": "make -f \\${selected_makefile}",
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "\\${selected_makefile_path}",
"selector": "source.makefile",
"syntax": "Packages/Makefile/Make Output.sublime-syntax",
[
{ "caption": "Input Handlers: Sample 1", "command": "example_one" },
{ "caption": "Input Handlers: Sample 2", "command": "example_two" },
{ "caption": "Input Handlers: Sample 3", "command": "example_three" },
{ "caption": "Input Handlers: Sample 4", "command": "example_four" },
{ "caption": "Input Handlers: Sample 5", "command": "example_five" },
{ "caption": "Input Handlers: Sample 6", "command": "example_six" },
]
@OdatNurd
OdatNurd / runInTerminal.sh
Created August 10, 2020 05:24
Execute arbitrary commands in Terminal on MacOS
#!/bin/sh
osascript - "$@" > /dev/null <<SCRIPT
on run argv
set originalTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to space
tell application "Terminal"
activate
set newTab to do script(argv as text)
@OdatNurd
OdatNurd / Default.sublime-keymap
Created May 2, 2020 04:42
Sublime Text Buzzword Lorem Ipsum
[
// Use our own buzzword lorem ipsum generator. It generates buzzword lorem
// using a rolling stock of 5 paragraphs and lets you generate multiple
// items at once.
{
"keys": ["tab"],
"command": "buzzword_ipsum",
"context": [
{ "key": "selection_empty", "operator": "equal", "operand": "true", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": "^.*lorem\\d*$", "match_all": true },
@OdatNurd
OdatNurd / collect_versions.py
Created March 13, 2020 19:28
Collect minimum build version information for Sublime Text API endpoints
#!/usr/bin/env python3
import os
import ast
import glob
import zipfile
# Classes that are part of the API in general; the source files contain some
# helper classes that are just noise
_classes = [
# From the sublime module
@OdatNurd
OdatNurd / Context.sublime-menu
Last active March 17, 2023 06:03
Example plugin for encrypting and decrypting files from Sublime
[
{ "caption": "-", "id": "end" },
{ "command": "encrypt" },
]
@OdatNurd
OdatNurd / AddItem.sublime-snippet
Last active March 15, 2021 12:48
Multiple choice selection in a Sublime Text snippet (Automatic)
<snippet>
<content><![CDATA[
Item: ${1:ItemName}
Client: ${2:Client Name}
Priority: ${0:Priority}
]]></content>
<tabTrigger>add</tabTrigger>
<description>Add a new item for a client</description>
<scope>text.plain</scope>
</snippet>
@OdatNurd
OdatNurd / AddItem.sublime-snippet
Last active March 15, 2021 12:48
Multiple choice selection in a Sublime Text snippet
<snippet>
<content><![CDATA[
Item: ${1:ItemName}
Client: ${2:Client Name}
Priority: ${0:Priority}
]]></content>
<tabTrigger>add</tabTrigger>
<description>Add a new item for a client</description>
<scope>text.plain</scope>
</snippet>