Permalink
Browse files

Version 1.5

- More responsive highlighting (thanks tito); delay setting no longer
needed
- Organize bracket plugins
- Included more configurable custom gutter icons
  • Loading branch information...
1 parent 8f49531 commit 9d42d32348243d4c5b204db44c46b0156392c652 @facelessuser committed Mar 13, 2012
View
@@ -1,3 +1,3 @@
-/*.pyc
+*.pyc
.DS_Store
View
20 BracketHighlighter.py 100644 → 100755
@@ -104,19 +104,29 @@ def init_brackets(self):
}
def get_bracket_settings(self, bracket, opening, closing):
+ # Style
+ highlight_style = self.settings.get(bracket + '_style', "none")
style = sublime.HIDE_ON_MINIMAP
- if self.settings.get(bracket + '_style') == "outline":
+ if highlight_style == "outline":
style |= sublime.DRAW_OUTLINED
- elif self.settings.get(bracket + '_style') == "none":
+ elif highlight_style == "none":
style |= sublime.HIDDEN
- elif self.settings.get(bracket + '_style') == "underline":
+ elif highlight_style == "underline":
style |= sublime.DRAW_EMPTY_AS_OVERWRITE
+
+ # Icon
+ highlight_icon = self.settings.get(bracket + '_icon', "")
+ icon = ""
+ icon_path = self.settings.get("icon_path", "Theme - Default").replace('\\', '/').strip('/')
+ if not highlight_icon == "none" and not highlight_icon == "":
+ icon = "../%s/%s" % (icon_path, highlight_icon)
+
return {
'enable': bool(self.settings.get(bracket + '_enable')),
'scope': self.settings.get(bracket + '_scope'),
'style': style,
- 'underline': (self.settings.get(bracket + '_style') == "underline"),
- 'icon': self.settings.get(bracket + '_icon'),
+ 'underline': (highlight_style == "underline"),
+ 'icon': icon,
'list': map(lambda x: x.lower(), self.settings.get(bracket + '_language_list')),
'filter': self.settings.get(bracket + '_language_filter'),
'open': opening,
@@ -5,20 +5,20 @@
"round_enable" : true,
"square_enable": true,
"angle_enable" : true,
- //Higlight tags if tag is selected. angle_enable must be true for tags to work
- //if you would like to ignore non tags then set ignore_non_tags to true
+ // Higlight tags if tag is selected. angle_enable must be true for tags to work
+ // if you would like to ignore non tags then set ignore_non_tags to true
"tag_enable" : true,
- //don't show non tag angle matches
+ // don't show non tag angle matches
"ignore_non_tags" : false,
- //match brackets only when the cursor is adjacent to one
+ // match brackets only when the cursor is adjacent to one
"match_adjacent_only" : false,
- //exclude or include bracket by language type (example: C++ for C++.tmLanguage)
- //Note: this is particularly useful with Angle. Some languages do not attribute any special scope to angle brackets making it hard
- //to tell when the bracket is beign used in a valid scenario. C++ is a perfect example. It is better to disable completely than
- //to ignore angle. Ignoring will not show angle matches, but will also interfere with other bracket matches.
+ // exclude or include bracket by language type (example: C++ for C++.tmLanguage)
+ // Note: this is particularly useful with Angle. Some languages do not attribute any special scope to angle brackets making it hard
+ // to tell when the bracket is beign used in a valid scenario. C++ is a perfect example. It is better to disable completely than
+ // to ignore angle. Ignoring will not show angle matches, but will also interfere with other bracket matches.
"angle_language_list" : ["HTML","HTML 5","XML","PHP"],
"tag_language_list" : ["HTML","HTML 5","XML","PHP"],
"quote_language_list" : ["Plain text"],
@@ -34,38 +34,41 @@
"round_language_filter" : "blacklist",
"square_language_filter": "blacklist",
- //Scope? (Defined in theme files.) ->
- //Examples: (keyword/string/number)
+ // Scope? (Defined in theme files.)
+ // Examples: (keyword|string|number)
"quote_scope" : "entity.name.class",
"curly_scope" : "entity.name.class",
"round_scope" : "entity.name.class",
"square_scope": "entity.name.class",
"angle_scope" : "entity.name.class",
"tag_scope" : "entity.name.class",
- //Outline? (solid/outline/underline/none) ->
+ // Outline? (solid|outline|underline|none)
"quote_style" : "solid",
"curly_style" : "solid",
"round_style" : "solid",
"square_style": "solid",
"angle_style" : "solid",
"tag_style" : "outline",
- //Icon? (dot/circle/bookmark/cross)
- "quote_icon" : "dot",
- "curly_icon" : "dot",
- "round_icon" : "dot",
- "square_icon": "dot",
- "angle_icon" : "dot",
- "tag_icon" : "dot",
+ // Path to gutter icons (relative to Packages)
+ "icon_path" : "BracketHighlighter/icons",
- //Higlight brackets of tag only instead of entire tag
+ // Icon? (dot|circle|bookmark|quote|curly_bracket|round_bracket|square_bracket|angle_bracket|none)
+ "quote_icon" : "quote",
+ "curly_icon" : "curly_bracket",
+ "round_icon" : "round_bracket",
+ "square_icon": "square_bracket",
+ "angle_icon" : "angle_bracket",
+ "tag_icon" : "angle_bracket",
+
+ // Higlight brackets of tag only instead of entire tag
"tag_brackets_only" : false,
- //Type of tag selection? (html/xhtml)
+ // Type of tag selection? (html/xhtml)
"tag_type" : "html",
- //threshold distance to search
+ // Threshold distance to search
"search_threshold" : 2000,
"tag_search_threshold" : 2000,
"use_search_threshold" : true,
View
186 Default (Linux).sublime-keymap 100644 → 100755
@@ -1,95 +1,95 @@
[
- {
- "keys": ["ctrl+shift+b", "ctrl+shift+b"],
- "command": "bracket_highlighter_key",
- "args": {"lines": true}
- },
- {
- "keys": ["alt+up"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "lines" : true,
- "plugin":
- {
- "type": ["quote","bracket","tag"],
- "command": "bracketselect.select_bracket",
- "args": {"select": "left"}
- }
- }
- },
- {
- "keys": ["alt+down"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "lines" : true,
- "plugin":
- {
- "type": ["quote","bracket","tag"],
- "command": "bracketselect.select_bracket",
- "args": {"select": "right"}
- }
- }
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+s"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "lines" : true,
- "plugin":
- {
- "type": ["quote","bracket","tag"],
- "command": "bracketselect.select_bracket"
- }
- }
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+t"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "ignore": ["quote"],
- "plugin":
- {
- "type": ["tag"],
- "command": "tagnameselect.select_tag"
- }
- }
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+n"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "ignore": ["quote"],
- "plugin":
- {
- "type": ["tag"],
- "command": "tagattrselect.select_attr",
- "args": {"direction": "right"}
- }
- }
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+q"],
- "command": "bracket_highlighter_key",
- "args":
- {
- "plugin": {"type": ["quote"],"command" : "swapquotes.swap_quotes"}
- }
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+j"],
- "command": "swap_brackets"
- },
- {
- "keys": ["ctrl+shift+b","ctrl+shift+["],
- "command": "bracket_highlighter_key",
- "args":
- {
- "plugin": {"type": ["quote", "tag", "bracket"],"command" : "foldbracket.fold_bracket"}
- }
- }
+ {
+ "keys": ["ctrl+shift+b", "ctrl+shift+b"],
+ "command": "bracket_highlighter_key",
+ "args": {"lines": true}
+ },
+ {
+ "keys": ["alt+up"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "lines" : true,
+ "plugin":
+ {
+ "type": ["quote","bracket","tag"],
+ "command": "bracket_plugins.select_bracket",
+ "args": {"select": "left"}
+ }
+ }
+ },
+ {
+ "keys": ["alt+down"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "lines" : true,
+ "plugin":
+ {
+ "type": ["quote","bracket","tag"],
+ "command": "bracket_plugins.select_bracket",
+ "args": {"select": "right"}
+ }
+ }
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+s"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "lines" : true,
+ "plugin":
+ {
+ "type": ["quote","bracket","tag"],
+ "command": "bracket_plugins.select_bracket"
+ }
+ }
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+t"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "ignore": ["quote"],
+ "plugin":
+ {
+ "type": ["tag"],
+ "command": "bracket_plugins.select_tag"
+ }
+ }
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+n"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "ignore": ["quote"],
+ "plugin":
+ {
+ "type": ["tag"],
+ "command": "bracket_plugins.select_attr",
+ "args": {"direction": "right"}
+ }
+ }
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+q"],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "plugin": {"type": ["quote"],"command" : "bracket_plugins.swap_quotes"}
+ }
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+j"],
+ "command": "swap_brackets"
+ },
+ {
+ "keys": ["ctrl+shift+b","ctrl+shift+["],
+ "command": "bracket_highlighter_key",
+ "args":
+ {
+ "plugin": {"type": ["quote", "tag", "bracket"],"command" : "bracket_plugins.fold_bracket"}
+ }
+ }
]
Oops, something went wrong.

0 comments on commit 9d42d32

Please sign in to comment.