Skip to content

Instantly share code, notes, and snippets.

@kaste
kaste / TidyUp.py
Created April 21, 2013 17:04
Automatically close old tabs in sublime 2
import sublime
import sublime_plugin
import time
DEFAULT_KEEP_OPEN = 8
class TidyUpCommand(sublime_plugin.EventListener):
@kaste
kaste / README.md
Last active May 25, 2017 12:56
Improved? find_under_expand for sublime

initial version: http://www.sublimetext.com/forum/viewtopic.php?f=5&t=10821

"It's handy if you're a terrible human being and use single-letter variable names other than [u-z] (because there's really no better way to refer to texture coordinates and vector components than with UVW and XYZ), which ⌘D will punish you for doing by finding every instance of that character. So, your best bet is to just not be an absolutely loathsome person who uses single letter variables (like all you horrible web developers do), but if you happen to be someone the entire world should despise because you absolutely cannot resist the allure of single letter variables like the absolutely awful depth-spawn that you might be, then this plugin is probably for you.

It's also handy if you have variable names that share words, like event and event_name and event_id, in which case ⌘D will unintentionally hate you and you're not an awful person, just unlucky. In those cases, it's probably fairly useful, though chances are you could ⌘K⌘D a

@kaste
kaste / Main.sublime-menu
Last active June 24, 2017 14:31
PyTest magic test runner
[
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
app.directive('rewriteAsSpan', function($compile){
return {
restrict: 'A',
template: '<span />',
replace: true,
// we transclude the element because when it gets replaced with the span
// we want all the properties from the original element
transclude: 'element',