Commits

Ollie Rutherfurd committed ea73df7

inital commit from thinkpad

Comments (0)

Files changed (13)

+syntax: glob
+*.cache
+*.pyc

Base File.sublime-settings

+{
+	"color_scheme": "Packages/Textmate-Themes/Tomorrow.tmTheme",
+	"font_face": "Cousine",
+	"font_size": 11,
+	"highlight_line": true,
+	"rulers":
+	[
+		80
+	],
+	"tab_completion": false,
+	"vintage_start_in_command_mode": true
+}

Default (Linux).sublime-keymap

+[
+	{ "keys": ["j", "j"], "command": "exit_insert_mode",
+		"context":
+		[
+			{ "key": "setting.command_mode", "operand": false },
+			{ "key": "setting.is_widget", "operand": false }
+		]
+	},
+	{ "keys": ["ctrl+w"], "command": "delete_word", "args": { "forward": false },
+		"context":
+		[
+			{ "key": "setting.command_mode", "operand": false },
+			{ "key": "setting.is_widget", "operand": false }
+		]
+	},
+	{ "keys": ["alt+pagedown"], "command": "goto_next_group",
+	  "args": { "forward": true }
+	},
+	{ "keys": ["alt+pageup"], "command": "goto_next_group",
+	  "args": { "forward": false }
+	},
+	{
+		"keys": ["ctrl+0"],
+		"command": "set_layout",
+		"args":
+		{
+			"cols": [0.0, 1.0],
+			"rows": [0.0, 1.0],
+			"cells": [[0, 0, 1, 1]]
+		}
+	},
+	{
+		"keys": ["ctrl+w", "v"],
+		"command": "set_layout",
+		"args":
+		{
+			"cols": [0.0, 0.5, 1.0],
+			"rows": [0.0, 1.0],
+			"cells": [[0, 0, 1, 1], [1, 0, 2, 1]]
+		},
+		"context": [
+			{ "key": "setting.command_mode", "operand": true },
+			{ "key": "setting.is_widget", "operand": false }
+		]
+	},
+	{
+		"keys": ["ctrl+shift+o"],
+		"command": "open_filename_under_cursor"
+	},
+	{ "keys": ["/"], "command": "close_tag_on_slash",
+		"context": [
+		{ "key": "setting.command_mode", "operand": false },
+		{ "key": "setting.is_widget", "operand": false }
+      ]
+	}
+]

Default (OSX).sublime-keymap

+[
+]

Default (Windows).sublime-keymap

+[
+]

Global.sublime-settings

+{
+	"file_exclude_patterns":
+	[
+		"*.a",
+		"*.class",
+		"*.db",
+		"*.dll",
+		"*.dylib",
+		"*.exe",
+		"*.idb",
+		"*.lib",
+		"*.marks",
+		"*.ncb",
+		"*.o",
+		"*.obj",
+		"*.orig",
+		"*.pdb",
+		"*.psd",
+		"*.pyc",
+		"*.pyo",
+		"*.sdf",
+		"*.so",
+		"*.suo",
+		".DS_Store"
+	],
+	"folder_exclude_patterns":
+	[
+		".svn",
+		".git",
+		".hg",
+		"CVS",
+		"build",
+		"env",
+		"target"
+	],
+	"ignored_packages":
+	[
+		"alternative_autocompletion",
+		"SublimeTagmatcher",
+		"SublimeBrackets"
+	],
+	"sublimelinter_gutter_marks": true,
+	"theme": "Soda Light.sublime-theme"
+}

Lite Brite.tmTheme

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>author</key>
+	<string>Cory Dorning</string>
+	<key>name</key>
+	<string>Lite Brite</string>
+	<key>settings</key>
+	<array>
+		<dict>
+			<key>settings</key>
+			<dict>
+				<key>background</key>
+				<string>#161616</string>
+				<key>caret</key>
+				<string>#F8F8F0</string>
+				<key>foreground</key>
+				<string>#F8F8F2</string>
+				<key>invisibles</key>
+				<string>#3B3A32</string>
+				<key>lineHighlight</key>
+				<string>#222222</string>
+				<key>selection</key>
+				<string>#333333</string>
+				<key>findHighlight</key>
+				<string>#999999</string>
+				<key>findHighlightForeground</key>
+				<string>#000000</string>
+				<key>selectionBorder</key>
+				<string>#222218</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Comment</string>
+			<key>scope</key>
+			<string>comment</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#E5B8E3</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>String</string>
+			<key>scope</key>
+			<string>string</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#FFE502</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Number</string>
+			<key>scope</key>
+			<string>constant.numeric</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#AE81FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Built-in constant</string>
+			<key>scope</key>
+			<string>constant.language</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#AE81FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>User-defined constant</string>
+			<key>scope</key>
+			<string>constant.character, constant.other</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#AE81FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Variable</string>
+			<key>scope</key>
+			<string>variable</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Keyword</string>
+			<key>scope</key>
+			<string>keyword</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#FF003F</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Storage</string>
+			<key>scope</key>
+			<string>storage</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#FF003F</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Storage type</string>
+			<key>scope</key>
+			<string>storage.type</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string>italic</string>
+				<key>foreground</key>
+				<string>#0095FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Class name</string>
+			<key>scope</key>
+			<string>entity.name.class</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string>underline</string>
+				<key>foreground</key>
+				<string>#00E811</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Inherited class</string>
+			<key>scope</key>
+			<string>entity.other.inherited-class</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string>italic underline</string>
+				<key>foreground</key>
+				<string>#00E811</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Function name</string>
+			<key>scope</key>
+			<string>entity.name.function</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#00E811</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Function argument</string>
+			<key>scope</key>
+			<string>variable.parameter</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string>italic</string>
+				<key>foreground</key>
+				<string>#FD971F</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Tag name</string>
+			<key>scope</key>
+			<string>entity.name.tag</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#0095FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Tag attribute</string>
+			<key>scope</key>
+			<string>entity.other.attribute-name</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#00E811</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Library function</string>
+			<key>scope</key>
+			<string>support.function</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#0095FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Library constant</string>
+			<key>scope</key>
+			<string>support.constant</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#0095FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Library class/type</string>
+			<key>scope</key>
+			<string>support.type, support.class</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string>italic</string>
+				<key>foreground</key>
+				<string>#0095FF</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Library variable</string>
+			<key>scope</key>
+			<string>support.other.variable</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Invalid</string>
+			<key>scope</key>
+			<string>invalid</string>
+			<key>settings</key>
+			<dict>
+				<key>fontStyle</key>
+				<string></string>
+				<key>foreground</key>
+				<string>#FF003F</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>Invalid deprecated</string>
+			<key>scope</key>
+			<string>invalid.deprecated</string>
+			<key>settings</key>
+			<dict>
+				<key>background</key>
+				<string>#AE81FF</string>
+				<key>foreground</key>
+				<string>#F8F8F0</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>JSON String</string>
+			<key>scope</key>
+			<string>meta.structure.dictionary.json string.quoted.double.json</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#CFCFC2</string>
+			</dict>
+		</dict>
+
+		<dict>
+			<key>name</key>
+			<string>diff.header</string>
+			<key>scope</key>
+			<string>meta.diff, meta.diff.header</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#75715E</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>diff.deleted</string>
+			<key>scope</key>
+			<string>markup.deleted</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#FF003F</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>diff.inserted</string>
+			<key>scope</key>
+			<string>markup.inserted</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#00E811</string>
+			</dict>
+		</dict>
+		<dict>
+			<key>name</key>
+			<string>diff.changed</string>
+			<key>scope</key>
+			<string>markup.changed</string>
+			<key>settings</key>
+			<dict>
+				<key>foreground</key>
+				<string>#FFE502</string>
+			</dict>
+		</dict>
+	</array>
+	<key>uuid</key>
+	<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
+</dict>
+</plist>

Package Control.sublime-settings

+{
+	"auto_upgrade_last_run": 1316612407
+}

Python.sublime-settings

+{
+	"use_tab_stops": true,
+	"translate_tabs_to_spaces": true
+}

close_tag_on_slash.py

+import sublime
+import sublime_plugin
+
+
+class CloseTagOnSlashCommand(sublime_plugin.TextCommand):
+    def run(self, edit):
+        cursorPosition = self.view.sel()[0].begin()
+        previousCharacter = self.view.substr(
+            sublime.Region(cursorPosition - 1, cursorPosition))
+        if '<' == previousCharacter:
+            self.view.erase(edit,
+                sublime.Region(cursorPosition - 1, cursorPosition))
+            self.view.run_command('close_tag')
+            if self.view.sel()[0].begin() < cursorPosition:
+                self.view.insert(edit, cursorPosition - 1, '</')
+        else:
+            self.view.insert(edit, cursorPosition, '/')

goto_next_group.py

+import sublime_plugin
+
+
+class GotoNextGroup(sublime_plugin.WindowCommand):
+    """Move to next or previous group in current window.
+    """
+    def run(self, forward=True):
+        groups = self.window.num_groups()
+        if groups < 2:
+            return
+        group = self.window.active_group()
+        if forward:
+            group += 1
+            if group >= groups:
+                group = 0
+        else:
+            group -= 1
+            if group < 0:
+                group = groups - 1
+        self.window.focus_group(group)

open_filename_under_cursor.py

+import sublime, sublime_plugin
+import os.path, string
+
+VALID_FILENAME_CHARS = "-_.() %s%s%s" % (string.ascii_letters, string.digits, "/:\\")
+
+# { "keys": ["alt+o"], "command": "open_filename_under_cursor" }
+# https://gist.github.com/1186126
+class OpenFilenameUnderCursor(sublime_plugin.TextCommand):
+    def run(self, edit):
+        for region in self.view.sel():
+            # Collect the texts that may possibly be filenames
+            quoted_text = self.get_quoted_selection(region)
+            selected_text = self.get_selection(region)
+            whole_line = self.get_line(region)
+            clipboard = sublime.get_clipboard().strip()
+            default_new_filename = self.create_filename(selected_text)
+
+            # Search for a valid filename from the possible sources: quoted_text, selected_text, whole_line, clipboard
+            # If none of these sources match a valid filename the a new filename will be created from the selected_text
+            filename = default_new_filename
+            for text in (quoted_text, selected_text, whole_line, clipboard):
+                potential_filename = self.get_filename(text)
+                if os.path.isfile(potential_filename):
+                    filename = potential_filename
+                    break
+
+            # If a filename was discovered from one of the sources, then open it
+            if filename:
+                print "Opening file '%s'" % (filename)
+                self.view.window().open_file(filename)
+            else:
+                 print "No filename discovered in the quoted_text, selected_text, whole_line or clipboard"
+
+    def get_selection(self, region):
+        return self.view.substr(region).strip()
+
+    def get_line(self, region):
+        return self.view.substr(self.view.line(region)).strip()
+
+    def get_quoted_selection(self, region):
+        text = self.view.substr(self.view.line(region))
+        position = self.view.rowcol(region.begin())[1]
+        quoted_text = self.expand_within_quotes(text, position, '"')
+        if not quoted_text:
+            quoted_text = self.expand_within_quotes(text, position, '\'')
+        return quoted_text
+
+    def expand_within_quotes(self, text, position, quote_character):
+        open_quote = text.rfind(quote_character, 0, position)
+        close_quote = text.find(quote_character, position)
+        return text[open_quote+1:close_quote] if (open_quote > 0 and close_quote > 0) else ''
+
+    def get_filename(self, text):
+        return text if os.path.isfile(text.strip()) else ''
+
+    def create_filename(self, text):
+        return ''.join(c for c in text if c in VALID_FILENAME_CHARS)

show_buffer_path.py

+import sublime, sublime_plugin
+
+fn = lambda fn: fn or 'untitled'
+
+class ShowBufferPath(sublime_plugin.WindowCommand):
+    """Display path in status bar.
+    """
+    def run(self):
+        view = self.window.active_view()
+        #view.set_status('Path', fn(view.file_name()))
+        sublime.status_message(fn(view.file_name()))
+
+
+class ShowBufferPathOnFocus(sublime_plugin.EventListener)::
+    """Display path in status bar when view gets focus.
+    """
+    def on_activated(self, view):
+        #view.set_status('Path', fn(view.file_name()))
+        sublime.status_message(fn(view.file_name()))