Skip to content

Sublime Text

September 29, 2023
April 2, 2015

Now I mostly use vscode.

Sublime Text: The text editor you'll fall in love with
Sublime Text Issues

Sublime Text 4 - News - Sublime HQ

Must Read Docs

Documentation - Sublime Text
Sublime Text Community Documentation

Project Files

Projects - Sublime Text 3 Documentation
Sublime Text 2 Project Bliss - Tuts+ Code Tutorial

{
  "folders": [
    {
      "path": "src",
      "folder_exclude_patterns": ["backup"],
      "follow_symlinks": true
    },
    {
      "path": "docs",
      "name": "Documentation",
      "file_exclude_patterns": ["*.css"]
    }
  ],
  "settings": {
    "tab_size": 8
  },
  "build_systems": [
    {
      "name": "List",
      "shell_cmd": "ls -l"
    }
  ]
}
{
    "folders":
    [
        { // theme
            "path": "/C/wamp/www/wordpress/wp-content/themes/twentyeleven",
            "name": "Twenty Eleven Theme",
            "file_exclude_patterns":[
                "._*",
                "*.ico",
                "*.swf"
            ],
            "folder_exclude_patterns": [
                "images"
            ]
        },
        { // plugins folder
            "path": "/C/wamp/www/wordpress/wp-content/plugins",
            "name": "Plugins Folder",
            "file_exclude_patterns":[
                "._*", // you need to specify this *again*
                "*.bak",
                "*.sample",
                "*.tar",
                "*.tgz",
                "*.zip"
            ],
            "folder_exclude_patterns": [
                "akismet"//,
                // add any other plugins you wish to exclude
            ]
        }
    ],
    "settings":
    {
        "tab_size": 4
    }
}

PATH setting

"TERM environment variable not set." when Python build (on mac) - Technical Support - Sublime Forum
Troubleshooting > Debugging PATH problems — SublimeLinter documentation

Make sure your shell do not echo anything to the console when you login.

import os; os.environ['PATH'] in Sublime Console
$SHELL -l -c 'echo ${PATH}' in terminal, used by SublimeLinter

Hacking the PATH variable in Sublime Text
Setting environment variables on login in OS X • Serge Émond
int3h/SublimeFixMacPath: A Sublime Text 2/3 plugin to set the PATH correctly on OS X

Customization after install

Home · mrmartineau/SublimeTextSetupWiki Wiki
Perfect Workflow in Sublime Text 2 - Tuts+ Course
Sublime Text Perfect Workflow - YouTube
Getting Started with SublimeText - YouTube
Sublime Text Tutorials - YouTube
Tag Archive for "sublime-text" | Scotch
Sublime Text Packages
15 Awesome Sublime Text Plugins For Web Development - Tutorialzine
dreikanter/sublime-bookmarks: Sublime Text essential plugins and resources

Sublimetext commands and shortcuts | ShortcutFoo

Console

Use Ctrl+` to enter Sublime's Python console

Install Directory

Data Directory

Package Directory

sublime.packages_path()

Default packages are located at <Install Directory>/Packages.

Package Control

Package Control - the Sublime Text package manager

Follow the instruction to install Package Control via Sublime console.

Installed packages (Package Control > Settings - User):
<DATA>/Packages/User/Package Control.sublime-settings

You can do batch install by editing this file and restarting Sublime Text.

Docs for Package Developers - Package Control
Submitting a Package - Package Control

Extension Development

Sublime Text's extensions are usually compatible with TextMate. This design choice make migration from TextMate easy and helps to build Sublime Text's user base.

It is recommended to use AAAPackageDev to write extensions, which now use YAML over JSON by defaults for the definitions.
PackageResourceViewer is great for viewing files of installed packages (other than visiting the repository).

Extending Sublime Text — Sublime Text Unofficial Documentation

Sublime Text - Plugin Examples
Sublime Text - Plugin API Reference

How to Create a Sublime Text 2 Plugin - Tuts+ Code Tutorial
Creating Sublime Text 3 Plugins – Part 1 | Clark/Nikdel/Powell
Creating Sublime Text 3 Plugins – Part 2 | Clark/Nikdel/Powell

SublimeText/PackageTesting

Page defines commands in <name>.sublime-commands.
Enter sublime.log_commands(True) in console to show commands triggered.

Theme Development

Actually there are two things here:

TextMate Manual » Themes

Online editor:
TmTheme Editor
aziz/tmTheme-Editor

Local editor:
A Guide to Installing ColorSchemeEditor for Sublime Text 3 | MattDMo.com
facelessuser/ColorSchemeEditor

Syntax Development

TextMate Manual » Language Grammars
TextMate Manual » Scope Selectors

Syntax - Sublime Text 3 Documentation new .sublime-syntax
Syntax Definitions — Sublime Text Unofficial Documentation
Syntax Definitions (reference) — Sublime Text Unofficial Documentation
Syntax Definitions — Sublime Text Help (deprecated)

klorenz / SyntaxHighlightTools — Bitbucket has docs on tmPreferences.
MagicStack/syntaxdev: Unit testing framework for Sublime Text and Atom syntaxes.

TmTheme Editor Stats to see what scopes are being recognized by themes.

Sublime Forum • View topic - How to highlight a nested scope?
sublime tmlanguage site:www.sublimetext.com - Google Search

Use Regex101 to test the regex (use gm flags).
https://regex101.com/r/cX0eW3

Snippets Development

Working with Code Snippets in Sublime Text - Hongkiat
Quickly Insert Text & Code with Sublime Text Snippets :: Scott Granneman

Snippets — Sublime Text Unofficial Documentation
Completions Files — Sublime Text Unofficial Documentation

Publishing to Package Control

Docs - Package Control
example-repository.json

My Installed Packages

[Environment Settings - Packages - Package Control](https://packagecontrol.io/packages/Environment Settings)
[Shell Turtlestein - Packages - Package Control](https://packagecontrol.io/packages/Shell Turtlestein)
SublimeREPL - Packages - Package Control

Turn Sublime Text 3 into a JavaScript IDE | CSS-Tricks

Color scheme/Themes

PackageRemark
Base 16 Color Schemes
Dayle Rees Color Schemes
Neon Color SchemeUsing this one
Theme - Cobalt2Using this one
Theme - Flatland
Theme - Soda

color scheme - Labels - Package Control
theme - Labels - Package Control

Syntax/Snippets

PackageRemark
-AngularJS
ApplySyntax
Async Snippets
Awk
BabelSupports ES6 and React JSX babel/babel-sublime#293, SublimeText-Markdown/MarkdownEditing#438
Better CoffeeScript
Better JavaScript
Creole
C Improved
Console API Snippets (JavaScript)
DiagramSyntax only
DocBlockr_Python
Dockerfile Syntax Highlighting
Dotfiles Syntax HighlightingCould have added these rules to ApplySyntax or ShellScript (Bash).sublime-settings
EJS
fish-shell
Gnuplot
GoSublime
INI
JSFormatCurrently only used for JSON
LSPLSP docs
Markdown Extended
MarkdownEditingAlso includes color scheme and snippets for Markdown
Nunjucks Syntax
nginx
OpenGL Shading Language (GLSL)
Python Improved
RAML Syntax Highlighter
Rust Enhanced
SCSS
Tmux
TOML

language syntax - Labels - Package Control
snippets - Labels - Package Control

Plugins

PackageRemark
AdvancedNewFile
AlignTab
AndroidImport
BetterFindBuffer
BracketHighlighter
-C++ Starting Kit
ColorHelper
DataConverter
DocBlockr
EasyMotion
EditorConfig
-Emmet
Filter Lines
Function Name Display
GitHub Tools
Keymaps
Move By Symbols
MarkdownTOC
NodeRequirer
-OmniMarkupPreviewer
Open URLOpen URL with Ctrl+U
OrigamiBetter pane management
SideBarEnhancements
StringEncodeNot char encode
StringUtilities
SublimeCodeIntel
SublimeTmplBAD: it hijacks key combo
SublimeXikiExecutable wiki
Text PastryUseful for creating and modifying selections, see wiki
Terminal
WordHighlight
YAML Nav

Plugins development

PackageRemark
AAAPackageDevTHE plugin for package development
PackageResourceViewerView files in package without the hassle of extrating .sublime-package
ColorSchemeEditor
-SaneSnippetsDefine snippets with sane syntax
ScopeHunterShows scopes, useful for debugging syntax files

Linter

PackageRemark
sublack
SublimeLinter
SublimeLinter-annotationsHighlights TODO, FIXME
Sublime​Linter-cppcheck
SublimeLinter-csslint
SublimeLinter-html-tidyThis causes error in paths
Sublime​Linter-contrib-eslint
SublimeLinter-contrib-htmlhint
SublimeLinter-javac
SublimeLinter-json
SublimeLinter-luacheckLuacheck documentation
SublimeLinter-pyyaml
SublimeLinter-ruby
SublimeLinter-shellcheck

SublimeLinter - Labels - Package Control