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
%YAML 1.2 | |
--- | |
# See http://www.sublimetext.com/docs/3/syntax.html | |
file_extensions: | |
- lang | |
scope: source.lang | |
contexts: | |
main: | |
- match: '//' | |
scope: punctuation.definition.comment.lang |
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 | |
watcher = None | |
class SettingsWatcher(): | |
def __init__(self): | |
self.removed = set() | |
self.settings = sublime.load_settings("Preferences.sublime-settings") | |
self.cached_ignored = set(self.settings.get("ignored_packages", [])) |
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 threading import Thread | |
def background_work(target, value): | |
# We're in some anonymous thread; if we care, this makes sure that we | |
# execute the callback in the main thread. | |
sublime.set_timeout(target.result_of_operation(value), 1) | |
class UselessCommand(sublime_plugin.WindowCommand): |
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
{ | |
"target": "my_exec", | |
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"", | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++", | |
"exe_path": "something.exe", | |
"variants": |
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 | |
# This is a modified version of the Default/font.py file that ships with | |
# sublime, which includes versions of the increase and decrease font size | |
# commands that limit the size the font can be at each extreme. | |
# This includes an event listener that catches any attempt to use the | |
# "standard" font commands and rewrites the command to use these ones instead. |
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 os, sys, codecs | |
import thread | |
import subprocess | |
import functools | |
import time | |
# This is the exec.py file taken from the Default package in Sublime Text 2.0.2 | |
# which has been modified to use incremental decoding of build system output | |
# the way it's done in Sublime Text 3. |
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 | |
def fold(view): | |
view.run_command("fold_by_level", {"level": 2}) | |
def plugin_loaded(): | |
for window in sublime.windows(): | |
for view in window.views(): | |
fold(view) |
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 os | |
import textwrap | |
# Related Reading: | |
# https://forum.sublimetext.com/t/overriding-default-latex-snippet-in-user-folder-not-working/35900 |
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 the Stack Overflow Question: | |
# https://stackoverflow.com/questions/49897187/sublime-text-3-simple-plug-in-that-changes-color-theme-depending-on-remote-host | |
class ExampleCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
view = self.view |
OlderNewer