Color Scheme & Theme
1. Press ctrl/command+shift+p, p, c, i, Enter: Type Soda, install Theme - Soda among the search results.
2. Press ctrl/command+shift+p, p, c, i, Enter: Type Monokai, install Theme - Monokai Pro among the search results.
3. Select Preferences-Color Scheme... from the top menu, select Monokai Pro from the drop-down list.
4. Select Preferences-Theme... from the top menu, select Soda Dark 3 from the drop-down list.
Other Visual Tweaks
1. Select Preferences-Settings from the top menu, copy & paste the following code right after the { in the first line of the right tab, and then press ctrl/command+s:
"caret_style": "phase", // a caret will fade in and out rather than blink "draw_white_space": "none", // do not display dots when dragging whitespaces "fade_fold_buttons": false, // make code folding arrows always visible (true: not visible until you hover over the gutter) "font_options": [ // "gdi" // font-rendering option; Windows-only ], "font_size": 11, "highlight_line": true, "highlight_modified_tabs": true, "line_padding_bottom": 1, "line_padding_top": 1, // "soda_classic_tabs": true, // for Soda theme // "soda_folder_icons": true, // for Soda theme "trim_trailing_white_space_on_save": true, // remove redundant whitespaces when saving the file "word_wrap": true, // make lines auto-break
- Some options in this code are commented out, considering that environment differs per users. If you want to apply them, just remove the // in front of the line in question.
Set Default New File to Stata
1. Press ctrl/command+shift+p, p, c, i, Enter: Search and install Default File Type.
2. Press ctrl+n, copy & paste the following code and save it with file name of default_file_type.sublime-settings:
{ "default_new_file_syntax": "Packages/StataEditor/StataEditor.tmLanguage", "use_current_file_syntax": false, }
3. Press ctrl+n, copy & paste the following code and save it with file name of default_syntax.py:
# AppData\Roaming\Sublime Text 3\Packages\User\default_syntax.py import sublime, sublime_plugin class DefaultSyntaxCommand(sublime_plugin.EventListener): def on_new(self, view): # Replacewith desired default language # Check in AppData\Local\Sublime Text 3\Cache view.set_syntax_file('Packages/StataEditor/StataEditor.tmLanguage')
2. Press command+n, copy & paste the following code and save it with file name of default_file_type.sublime-settings:
{ "default_new_file_syntax": "Packages/Stata Improved Editor/Stata.tmLanguage", "use_current_file_syntax": false, }
3. Press command+n, copy & paste the following code and save it with file name of default_syntax.py:
# AppData\Roaming\Sublime Text 3\Packages\User\default_syntax.py import sublime, sublime_plugin class DefaultSyntaxCommand(sublime_plugin.EventListener): def on_new(self, view): # Replacewith desired default language # Check in AppData\Local\Sublime Text 3\Cache view.set_syntax_file('Packages/Stata Improved Editor/Stata.tmLanguage')
4. Select Preferences-Browse Packages... from the top menu, move 2 new files to the User folder in that path.
5. Now Stata’s syntax will be highlighted by default when you create a new file(you don’t need to manually set syntax via View-Syntax from the top menu or save current file with a .do extension).
Highlighting {}, [], (), ""
1. Press ctrl/command+shift+p, p, c, i, Enter: Search and install BracketHighlighter.
2. Select Preferences-Package Settings-BracketHighlighter-Bracket Settings from the top menu, copy & paste the following code in the right tab, and then press ctrl/command+s:
{ "bracket_styles": { "default": { "style": "solid" } }, }
Highlighting & Inserting Color Codes
1. Press ctrl/command+shift+p, p, c, i, Enter: Search and install Color Highlight.
2. Press ctrl/command+shift+p, p, c, i, Enter: Search and install ColorPicker.
3. Select Preferences-Package Settings-Color Highlight Settings from the top menu, replace whole content of the right tab with the following code, and then press ctrl/command+s:
{ "user": { "gutter_icon": "square", }, }
4. Now if hex codes or color names exist in your do-file, you can see corresponding colors directly while editing the do-file in Sublime Text as in the following example.
- (If not works) Press ctrl/command+shift+p, c and select Color Highlight: Reset.
grstyle set color blue: background grstyle set color #ab9df2
5. ctrl+shift+c: shortcut for the pop-up colorpicker window; you can insert a hex code of a selected color.
- (If not works) Select Preferences-Key Bindings from the top menu, copy & paste the following code right after the [ in the first line of the right tab, press ctrl+s:
{ "keys": ["ctrl+shift+c"], "command": "color_pick", },
5. command+shift+c: shortcut for the pop-up colorpicker window; you can insert a hex code of a selected color.
- (If not works) Select Preferences-Key Bindings from the top menu, copy & paste the following code right after the [ in the first line of the right tab, press command+s:
{ "keys": ["super+shift+c"], "command": "color_pick", },
Read & Edit CJK Characters
1. Press ctrl/command+shift+p, p, c, i, Enter: Search and install ConvertToUTF8.
- (If necessary) You can edit and save files which encodings are CJK via File-Set File Encoding to from the top menu.