Permalink
Browse files

Add menu items for accessing/setting the plugin's options

  • Loading branch information...
1 parent fda15e9 commit 39676e5621323ba66fc0fa4e2e67a2bf7b9366c8 @victorporof committed Sep 8, 2013
@@ -5,8 +5,11 @@
"command": "htmlprettify"
}, {
"caption": "Set Prettify Preferences",
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
}, {
+ "caption": "Set Plugin Options",
+ "command": "htmlprettify_set_plugin_options"
+ }, {
"caption": "Set Keyboard Shortcuts",
"command": "htmlprettify_set_keyboard_shortcuts"
}, {
@@ -3,7 +3,10 @@
"command": "htmlprettify"
}, {
"keys": ["ctrl+alt+h", "p"],
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+}, {
+ "keys": ["ctrl+alt+h", "o"],
+ "command": "htmlprettify_set_plugin_options"
}, {
"keys": ["ctrl+alt+h", "k"],
"command": "htmlprettify_set_keyboard_shortcuts"
@@ -3,7 +3,10 @@
"command": "htmlprettify"
}, {
"keys": ["super+alt+h", "p"],
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+}, {
+ "keys": ["super+alt+h", "o"],
+ "command": "htmlprettify_set_plugin_options"
}, {
"keys": ["super+alt+h", "k"],
"command": "htmlprettify_set_keyboard_shortcuts"
@@ -3,7 +3,10 @@
"command": "htmlprettify"
}, {
"keys": ["ctrl+alt+h", "p"],
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+}, {
+ "keys": ["shift+alt+h", "o"],
+ "command": "htmlprettify_set_plugin_options"
}, {
"keys": ["ctrl+alt+h", "k"],
"command": "htmlprettify_set_keyboard_shortcuts"
View
@@ -88,13 +88,17 @@ def run(self, edit):
class PreSaveFormatListner(sublime_plugin.EventListener):
def on_pre_save(self, view):
settings = sublime.load_settings(SETTINGS_FILE)
- if(settings.get("format_on_save") == True):
+ if settings.get("format_on_save") == True:
view.run_command("htmlprettify")
-class HtmlprettifySetPrefsCommand(sublime_plugin.TextCommand):
+class HtmlprettifySetPrettifyPrefsCommand(sublime_plugin.TextCommand):
def run(self, edit):
open_jsbeautify_rc(self.view.window())
+class HtmlprettifySetPluginOptionsCommand(sublime_plugin.TextCommand):
+ def run(self, edit):
+ open_htmlprettify_sublime_settings(self.view.window())
+
class HtmlprettifySetKeyboardShortcutsCommand(sublime_plugin.TextCommand):
def run(self, edit):
open_jshint_sublime_keymap(self.view.window(), {
@@ -3,7 +3,10 @@
"command": "htmlprettify"
}, {
"caption": "HTMLPrettify: Set Prettify Preferences",
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+}, {
+ "caption": "HTMLPrettify: Set Plugin Options",
+ "command": "htmlprettify_set_plugin_options"
}, {
"caption": "HTMLPrettify: Set Keyboard Shortcuts",
"command": "htmlprettify_set_keyboard_shortcuts"
@@ -3,5 +3,5 @@
// https://github.com/victorporof/Sublime-HTMLPrettify#oh-noez-command-not-found
// http://nodejs.org/#download
"node_path": "/usr/local/bin/node",
- "format_on_save": true
-}
+ "format_on_save": false
+}
View
@@ -8,7 +8,10 @@
"command": "htmlprettify"
}, {
"caption": "Set Prettify Preferences",
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+ }, {
+ "caption": "Set Plugin Options",
+ "command": "htmlprettify_set_plugin_options"
}, {
"caption": "Set Keyboard Shortcuts",
"command": "htmlprettify_set_keyboard_shortcuts"
@@ -28,7 +31,10 @@
"command": "htmlprettify"
}, {
"caption": "Set Prettify Preferences",
- "command": "htmlprettify_set_prefs"
+ "command": "htmlprettify_set_prettify_prefs"
+ }, {
+ "caption": "Set Plugin Options",
+ "command": "htmlprettify_set_plugin_options"
}, {
"caption": "Set Keyboard Shortcuts",
"command": "htmlprettify_set_keyboard_shortcuts"

0 comments on commit 39676e5

Please sign in to comment.