Skip to content

Instantly share code, notes, and snippets.

View OdatNurd's full-sized avatar

Terence Martin OdatNurd

View GitHub Profile
@OdatNurd
OdatNurd / HTML.sublime-syntax
Created February 15, 2019 19:22
HTML Syntax from Sublime Text 3 - 3176 modified to support GLSL
%YAML 1.2
---
name: HTML
file_extensions:
- html
- htm
- shtml
- xhtml
- inc
- tmpl
@OdatNurd
OdatNurd / output.txt
Last active February 14, 2019 19:56
Use AST to parse Sublime API files
sublime
-------
sublime.version()
sublime.platform()
sublime.arch()
sublime.channel()
sublime.executable_path()
sublime.executable_hash()
sublime.packages_path()
sublime.installed_packages_path()
@OdatNurd
OdatNurd / Adaptive.sublime-theme
Last active May 7, 2024 16:01
Patched Adaptive.sublime-theme for modifying the color of files in the sidebar based on their git status
[
// VCS badges
{
"class": "vcs_status_badge",
"parents": [{"class": "file_system_entry", "attributes": ["untracked"]}],
"layer0.texture": "Theme - Default/common/status_untracked.png",
"layer0.tint": "color(var(--yellowish) blend(rgb(255, 255, 255) 60%))",
"layer0.opacity": 1.0,
"content_margin": 6
},
@OdatNurd
OdatNurd / Context.sublime-menu
Created November 8, 2018 20:39
Dirt simple integration to Sublime Merge from Sublime Text
[
{ "command": "smerge_search" },
]
@OdatNurd
OdatNurd / example.py
Created November 5, 2018 06:34
Generating a Sublime color scheme
import sublime
import sublime_plugin
import os
_scheme_mappings = {
"entity.anchor.text": "string.quoted",
"punctuation.anchor": "string.quoted",
"entity.link.text": "storage",
@OdatNurd
OdatNurd / Default.sublime-commands
Created June 20, 2018 22:14
Sample Sublime Plugin to implement a buffer panel
[
{
"caption": "BufferList: Show Buffers",
"command": "show_buffers",
"args": {
"give_focus": true
}
}
]
@OdatNurd
OdatNurd / Default.sublime-keymap
Created June 18, 2018 23:22
Sample Sublime Plugin for a buzzword lorem ipsum that can generate multiple paragraphs at once
[
// 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 / Python.sublime-build
Last active May 7, 2019 12:57
A version of the exec command from Sublime Text 3 modified to buffer output to the panel by lines
{
"target": "buffered_exec",
"cancel": {"kill": true},
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
@OdatNurd
OdatNurd / rsubl_listener.py
Created April 18, 2018 17:26
Detecting when a file is opened via rsubl in Sublime (from Stack Overflow)
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
@OdatNurd
OdatNurd / snippet_override.py
Created March 29, 2018 17:51
Allows placement of Sublime snippet overrides in the User folder, automatically creating empty overrides to mask the packaged version
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