This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// NOTE: The filename in the example is "Default.sublime-keymap, but you | |
// should put this in your own user and platform specific key bindings, | |
// such as "Default (Linux).sublime-keymap" or such. | |
// | |
// That would be the file that opens when you use the | |
// "Preferences > Key Bindings" menu item. | |
// For more details on how this binding works, see: https://youtu.be/1CkAkpNs28M | |
// Here the binding is using the standard build key; this is different on MacOS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
from urllib.parse import quote, unquote | |
class SetUpButtonsCommand(sublime_plugin.TextCommand): | |
""" | |
When executed, this command checks the current file for all items that | |
match the regular expression and adds a phantom that alows for copying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
from fnmatch import fnmatch | |
# Related Reading: | |
# https://forum.sublimetext.com/t/auto-scroll-to-bottom-tail-log-files/69156 | |
# | |
# For any opened file that matches one of the globs set out below, this will | |
# cause the view of the file to jump to the bottom whenever the file reloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
from os.path import isabs, isfile, normpath, realpath, dirname, join | |
# Related reading: | |
# https://forum.sublimetext.com/t/forbid-st-from-opening-non-project-files-in-the-projects-window/68989 | |
# The name of the window specific setting that determines if the functionality | |
# of this plugin is enabled or not, and an indication of whether the plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import functools | |
import re | |
# The key the key that we use to add regions for the word currently under the | |
# cursor (when that is turned on), the style of the regions added, and the | |
# scope that represents the color to use when words are highlighted. | |
CURRENT_WORD_KEY='_sel_word' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Add to your own custom key bindings file using 'Preferences > Key Bindings'; set the keys as | |
// desired for your own use. | |
{ "keys": ["super+t"], | |
"command": "switch_group", | |
"args": {"forward": true } | |
}, | |
{ "keys": ["super+ctrl+t"], | |
"command": "switch_group", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class VariableHoverEventListener(sublime_plugin.EventListener): | |
def get_hover_token(self, tokens, point): | |
""" | |
Given a list of tokens, find the one that's at the point given. | |
""" | |
for index, item in enumerate(tokens): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import Pywin32.setup | |
import win32com.client | |
import win32api | |
import os | |
settings_file = "StataEditor.sublime-settings" | |
def plugin_loaded(): | |
global settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ClientCredentialsAuthProvider } = require('@twurple/auth'); | |
const { ApiClient } = require('@twurple/api'); | |
const { NgrokAdapter } = require('@twurple/eventsub-ngrok'); | |
const { EventSubListener } = require('@twurple/eventsub'); | |
async function testEventSub() { | |
// Create an auth provider tied to our application's client ID and secret. | |
const authProvider = new ClientCredentialsAuthProvider( | |
process.env.TWITCHBOT_CLIENT_ID, |
NewerOlder