Beginning with Sublime Text 3
My journey started with reading (and watching videos) two good blog entries done by Stuart Herbert:
- “10 Reasons Why I’ve Switched From Netbeans To Sublime Text 2 For PHP Development” and
- “Setting Up Sublime Text 2 For PHP Development“
However, both texts are old and covers Sublime Text 2 only. And both are quite long. If you want a shorter version, updated for Sublime Text 3, then read on…
Note, that this article is filled with many comparisons to that Netbeans. Intentionally. I’ve been using Netbeans for past five or more years. And from the first day, I started using Sublime Text 3, I feel like I’m a newborn developer again. And I finally have super-fast, super-powerful IDE instead of old, slow, buggy, cranky Java-based Netbeans. Whoa! :]
Contents
Warming up…
OK, let’s start. I assume, you have installed newest version of Sublime Text and… that is actually all, what you’ve done so far.
If you haven’t done this yet, I strongly encourage you to read unofficial documentation for Sublime Text 3 editor. It covers nearly every aspect of this great piece of software and it is written very, very well (thank you — Guillermo López-Anglada & The Sublime Text Community). In my opinion, this is a must-read, first step for everyone starting his/her journey with Sublime Text 3.
Note, that this text (and all other my texts about Sublime Text 3) is written from the perspective of a Windows user. However, most of the instructions will only require trivial changes to work on other platforms.
Tweaking up Sublime Text
What you need to know, at this point is, that there are no configuration dialogs, windows or generally any UI to click-through in Sublime Text 3. Actually, nearly everything is customized by editing ST3 configuration files. Default configuration file is very well documented, but it is quite long and may be overwhelming, so spare some time on browsing and understanding it.
If you play with Sublime Text 3 configuration files for the first time, first open both files (default and user) in two separate tabs, by clicking Preferences > Settings — Default and Preferences > Settings — User. Remember to edit only second file (its values overrides everything in default file) and to use default configuration file only as reference and source of information.
Some issues about tweaking ST are covered in Sublime Text 3’s user configuration article.
Small tip: If you like your own order in user configuration file (like I do), then skip this point and tweak up ST after you select proper theme and color scheme (points 2. and 3. below). Package Control plugin (see below) rewrites user configuration file many times, changing order of user flags and removing all necessary spaces between lines. Which may be annoying to purists like me! :]
Package Control
An absolute must to every Sublime Text 3 user is is Will Bond’s Package Control, that automates the job of installing and upgrading plugins. Here you’ll find installation instructions.
After installing it and restarting ST3, you’ll find new menu option: Preferences > Package Control. You’ll use it very often at the stage of suiting Sublime Text to your need. So often, you’ll most certainly regret, it hasn’t got any keyboard short-cut! :] Use Package Control every time you need to install, activate, deactivate or remove any plugin, theme, color scheme etc.
There are two ways to open Package Control and execute one of its commands:
- Select Preferences > Package Control from the menu
- Press Ctrl+Shift+P, type
install
and hit Enter after selectingPackage Control: Install Package
option
With the very same, quick way you can remove package, by doing the same, but typing remove
instead.
Theme and color scheme
Skip this step, if you’re comfortable with default stuff that Sublime Text 3 comes with.
Visual (graphic) stuff for ST3 is separated (as in most IDEs) into two groups:
- A theme controls general layout of entire editor
- While color scheme sets colors used in editor (syntax highlighting)
Some of themes comes with color schemes together. Most of theme and color scheme packages are separate.
One of the most popular themes for Sublime Text (both versions) is Soda. I must admit, that it is pretty good. It has both dark and light versions and is really famous among Sublime Text users.
However, after few days testing, as switched to Nil Theme, which light version is in my opinion more comfortable for eyes. It also ships with color schemes tuned up to editor scheme (see below). If neither Soda nor Nil doesn’t suit you or you want to experiment yourself with something else, there are dozens of other themes at your service.
As for color scheme, I prefer built-in IDLE. If you want something darky or different, there are even more color schemes than themes for you on Package Control website. When I was still experimenting with dark editor, “Pastels on Dark” in built-in themes and installable “Oasis” theme were two of my favorite ones. And “Red Planet” and “Tomorrow” were under strong consideration. If you are using Nil Theme, you may also consider color schemes, that ships with it.
Keep in mind, that changing some settings, like for example font size used by sidebar or tabstrip, reguires your direct edit to theme. So it should be done after you select proper theme for you. This topic is covered in Changing sidebar’s font size in Sublime Text 3 article.
Plugins
It is time for plugins! Sublime Text 3 is powerful and really kicks ass even in its bare, base installation. But, when you power it up with proper combination of plugins, you’re about to open a hell’s door and begin coding in crazy-fast, insanely-comfortable way.
Plugins are to wide and broad to fit into this text, so I moved them to Useful plugins for Sublime Text 3 article.
Projects in Sublime Text 3
Projects are generally speaking second-class citizens in Sublime Text. They’re referred more like folders or paths than full-blown projects, you may know from Netbeans, phpStorm or other IDEs.
There’s an entire menu (Project) to work with project (and workspaces) in Sublime Text 3. However, for very basic usage you don’t actually need them. You simply drag any folder or folders from any soruce and drop them onto ST’s sidebar. That’s all. On every ST restart, all dropped folders and all opened files will be reopened.
If you want to work with projects then keep in mind that you can have only one project opened in one Sublime Text window. Each time you open a new project (using Project > Open Project…) or new folder (using File > Open Folder…), it will be opened in new ST window. The same, if you use project switching function (for example press Ctrl+Alt+P). Newly opened project will replace currently opened one.
Usually you keep each of your projects in separate folders. If you simply want to work with more than one folder / project at once in the same (the only?) window of Sublime Text 3 then simply drag all of them on sidebar and forget about all the projects stuff in ST.
Final words
There are many things, that you will miss, when switching from Netbeans to Sublime Text 3. But, even without them, this IDE really, really kicks ass. Scroll this article to the beginning, if you still doubt that. Read on Netbeans-like keyboard shortcuts in Text 3 post to ease your transition pain.
But, believe me — if you value your time and don’t want to scream at night looking how slow Netbeans is, then you should quickly understand, that there is no other way and that there is no going back.