Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Sublime Text

You're reading from   Mastering Sublime Text When it comes to cross-platform text and source code editing, Sublime Text has few rivals. This book will teach you all its great features and help you develop and publish plugins. A brilliantly inclusive guide.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849698429
Length 110 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Dan Peleg Dan Peleg
Author Profile Icon Dan Peleg
Dan Peleg
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Mastering Sublime Text
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing Sublime Text FREE CHAPTER 2. Code Editing 3. Snippets, Macros, and Key Bindings 4. Customization and Theme Development 5. Unravelling Vintage Mode 6. Testing Using Sublime 7. Debugging Using Sublime 8. Developing Your Own Plugin Index

Getting to know the Data and Packages directories


After the successful installation of Sublime on our system, we can begin to understand what was actually being installed and how can we take advantage of it.

In this section I will use Windows shortcuts. So when I use Ctrl+?, it will be the same as using Command+? on a Mac.

The Data directory

From the official Sublime docs:

Nearly all of the interesting files for users live under the Data directory.

The location of the Data directory is platform-dependent:

  • Windows: %APPDATA%\Sublime Text 3

  • OS X: ~/Library/Application Support/Sublime Text 3

  • Linux: ~/.config/sublime-text-3

We should see at least three directories inside the Data directory:

  • Installed Packages: This contains a copy of every sublime-package installed. It's used to restore packages.

  • Local: This stores all the information about our current and previous session. This is used to restore Sublime to the stage we were in, when we last quit Sublime.

  • Packages: This contains all package folders that Sublime will load.

The Packages directory

The following is written on the official Sublime docs:

"This is a key directory"

This directory contains all the resources for supported programming, markup languages, and custom plugins. We will refer to this folder as Packages.

Tip

We can also access the Packages directory from Sublime's main menu by navigating to Preferences | Browse Packages… on Windows or Linux, and by navigating to Sublime Text | Preferences | Browse Packages… on OS X.

The User package

This package is present at Packages/User and contains all custom plugins, snippets, macros, and user preferences. Let's make our first tweak!

Open Packages/User/Preferences.sublime-settings. We should see the following code:

{
   "font_size": 14,
   "ignored_packages":
   [
      "Vintage"
   ]
}

Try changing the font size and click on Save or Ctrl + S. Our font size has changed! We can also achieve this effect by pressing Ctrl + - to decrease the font size and Ctrl + + to increase the font size. In Linux or Windows, this can also be achieved by holding the Ctrl key while zooming in and out.

Delving into packages, plugins, snippets, and macros

Almost every corner and pixel of Sublime Text can be tweaked, extended, or customized. All this customization is based on JSON, XML, Python, and Sublime files. A package is basically a folder that contains all resources that belong together, and it gives Sublime a new functionality or customization. This is all we need to know for now.

You have been reading a chapter from
Mastering Sublime Text
Published in: Dec 2013
Publisher: Packt
ISBN-13: 9781849698429
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime