Overview

Gem Version Code Climate GPA Code Climate Coverage Gemnasium Status Travis CI Status Gittip

Provides a collection of utilities that aid in Sublime Text management.

Features

  • Creates project metadata (i.e. *.sublime-project files) for easy project switching via the COMMAND+CONTROL+P shortcut.
  • Destroys project metadata (i.e. *.sublime-project and *.sublime-workspace files).
  • Rebuilds recent workspace history (via Project -> Recent Projects) from existing project files (assumes workspaces are in a single directory) so one can easily toggle between up-to-date project information via the COMMAND+CONTROL+P shortcut.

Requirements

  1. Any of the following Ruby VMs:
  2. Sublime Text 2.

Setup

For a secure install, type the following from the command line (recommended):

gem cert --add <(curl -Ls http://www.alchemists.io/gem-public.pem)
gem install sublime_text_kit --trust-policy MediumSecurity

NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while allowing the installation of unsigned dependencies since they are beyond the scope of this gem.

For an insecure install, type the following (not recommended):

gem install sublime_text_kit

You can define settings by creating the following file:

~/.sublime/settings.yml

Example:

---
:project_roots:
  - "~/Dropbox/Development/Misc"
  - "~/Dropbox/Development/OSS"
  - "~/Dropbox/Development/Work"
:workspace_dir: "~/Dropbox/Cache/Sublime"

The project roots are the root level directories to where project folders are located. When project metadata (i.e. *.sublime-project) is generated, the name of the metadata file will be the same name as that of the project folder. All project metadata, regardless of root location, is written to the same workspace directory. If using the example settings shown above and assuming the following directory structure exists...

~/Dropbox/Development/Misc/example
~/Dropbox/Development/OSS/sublime_text_kit

...the project metadata will be created in the workspace directory as follows:

~/Dropbox/Cache/Sublime/example.sublime-project
~/Dropbox/Cache/Sublime/sublime_text_kit.sublime-project

Usage

From the command line, type: stk

stk -e, [--edit]       # Edit settings in default editor (assumes $EDITOR environment variable).
stk -h, [--help=HELP]  # Show this message or get help for a command.
stk -p, [--project]    # Manage project metadata.
stk -s, [--session]    # Manage session data.
stk -v, [--version]    # Show version.

For project options, type: stk --project

-c, [--create], [--no-create]    # Create project metadata.
-D, [--destroy], [--no-destroy]  # Destroy all project metadata.

For session options, type: stk --session

-r, [--rebuild-recent-workspaces]  # Rebuild recent workspaces.

Tests

To test, run:

bundle exec rspec spec

Workflow

The following demonstrates a common workflow that makes you more productive with Sublime Text:

  1. Run: stk -e (define Sublime Text Kit settings for project roots and workspace directory).
  2. Shutdown Sublime Text (i.e. CONTROL+Q).
  3. Run: stk -p -D (optional -- start with a clean slate. WARNING: This deletes all project metadata in the workspace dir).
  4. Run: stk -p -c (creates project metadata so Sublime Text knows where to source the project from).
  5. Run: stk -s -r (rebuilds Sublime Text recent workspace metadata based on the project metadata created in Step #4).
  6. Launch Sublime Text
  7. Type: COMMAND+CONTROL+P to toggle between projects. Notice that you can easily (fuzzy type) project names to jump between them.
  8. Breeze through your project workload with ease. :)

Troubleshooting

  • When rebuilding workspaces, ensure Sublime Text is shutdown or changes won't be applied.
  • When rebuilding workspaces, ensure workspace_dir (as defined via settings.yml) points to a directory containing *.sublime-project files.

Versioning

Read Semantic Versioning for details. Briefly, it means:

  • Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
  • Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
  • Major (X.y.z) - Incremented for any backwards incompatible public API changes.

Contributions

Read CONTRIBUTING for details.

Credits

Developed by Brooke Kuhlmann at Alchemists.

License

Copyright (c) 2014 Alchemists. Read the LICENSE for details.

History

Read the CHANGELOG for details. Built with Gemsmith.