-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,343 additions
and
34 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>app</key> | ||
<string>com.bohemiancoding.sketch3</string> | ||
<key>build</key> | ||
<integer>7799</integer> | ||
<key>commit</key> | ||
<string>e645bc992e78ea0d8f54ab21bcdc83987015d34b</string> | ||
<key>fonts</key> | ||
<array/> | ||
<key>length</key> | ||
<integer>63693</integer> | ||
<key>version</key> | ||
<integer>36</integer> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
36 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Updating: | ||
- Re-jigger caching/filtering behaviour? | ||
Currently, `locate` results are purged before caching. This means that files on disks currently not connected will disappear for up to a week. Is it better to store all the results and filter them on retrieval (in `sublime.py`) or will `mdfind` likely pick them up? | ||
- Is an option to force reload from `locate` a viable alternative? | ||
Probably! | ||
Interface: | ||
- Offer a way to edit `settings.json` via Alfred? | ||
Lots of work, and anyone using Sublime Text should, nay must, be able to handle editing a JSON file. Not much of an ST user if you can't… |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
title: Sublime Text Projects for Alfred 2 Help | ||
|
||
# Sublime Text Projects for Alfred 2 # | ||
|
||
View, filter and open Sublime Text (2 and 3) projects files saved on your Mac. | ||
|
||
![](https://raw.githubusercontent.com/deanishe/alfred-sublime-text/master/demo.gif "") | ||
|
||
- [Usage](#usage) | ||
- [How it works](#howitworks) | ||
+ [Excludes](#excludes) | ||
+ [find](#find) | ||
+ [locate](#locate) | ||
* [Turning on locate](#turningonlocate) | ||
* [Forcing an update](#forcinganupdate) | ||
- [Settings](#settings) | ||
|
||
## Usage ## | ||
|
||
- `.st [<query>]` — List/filter your `.sublime-project` files | ||
+ `↩` — Open result in Sublime Text | ||
+ `⌘+↩` — Reveal file in Finder | ||
- `.stconfig` — Show the current settings | ||
- `.sthelp` — View this help file | ||
|
||
**Note**: You can currently only alter the settings by editing the `settings.json` file by hand. Hit `↩` on the **Edit Configuration** item to open it in your default JSON editor. | ||
|
||
## How it works ## | ||
|
||
By default, the workflow uses `mdfind` (which in turn uses Spotlight's index) to find all the `.sublime-project` files on your system. | ||
|
||
Unfortunately, `mdfind` won't find hidden files or files in hidden directories. Thus, you can also add additional search directories, which will be searched for `.sublime-project` files using `find`, and/or turn on the `locate` database. | ||
|
||
**Note**: Although it can take several seconds to perform the search with `find` and/or `locate`, the results are cached and the cache is updated in the background, so the Workflow will always remain responsive, although it might take a few seconds for newly-added files to show up in the results. | ||
|
||
### Excludes ### | ||
|
||
As `locate` in particular will likely return a lot of results you don't want to see, such as `.sublime-project` files that are part of apps' bundles, you can also add globbing patterns to the `settings.json` file, and paths that match these patterns will be ignored. | ||
|
||
See [Settings](#settings) for more details. | ||
|
||
### find ### | ||
|
||
`find` is a common UNIX command for recursively searching directories. In contrast to `mdfind` and `locate`, it does not use a pre-compiled database, so it shouldn't be used on large directory hierarchies. `locate` (see [below](#locate)) is a better option for such directories. Unfortunately, the `locate` database is updated infrequently, so you might want to consider [forcing an update](#forcinganupdate). | ||
|
||
By default, the directories `~/.config` and `~/.dotfiles` are added to the configuration, but will be ignored if they don't exist. | ||
|
||
### locate ### | ||
|
||
`locate` is a common UNIX command that maintains a list of all files on your system to enable (relatively) fast searching. | ||
|
||
By default, its database is only updated once a week (on Saturdays at 3.15 a.m. on OSX). It is *a lot* slower than `mdfind` (which uses the Spotlight index), but also indexes hidden files. | ||
|
||
So, if you have Sublime Project files stored in hidden directories, you might want to consider turning on `locate`. | ||
|
||
#### Turning on locate #### | ||
|
||
Execute the following command in `Terminal` to activate `locate`: | ||
|
||
``` | ||
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist | ||
``` | ||
|
||
#### Forcing an update #### | ||
|
||
Execute the following command in `Terminal` to force an update of the `locate` database: | ||
|
||
``` | ||
sudo /usr/libexec/locate.updatedb | ||
``` | ||
|
||
## Settings ## | ||
|
||
The workflow configuration is stored in `setttings.json` in the Workflow's data directory. It's assumed that as a user of Sublime Text, you know how to edit a JSON file ;) | ||
|
||
You can view the settings (and open `settings.json` in your editor) by entering `.stconfig` in Alfred. | ||
|
||
The default config file looks like this: | ||
|
||
``` | ||
{ | ||
"excludes": [ | ||
"/Applications/*.app/*" | ||
], | ||
"locatedb_cached": 0, | ||
"search_directories": [ | ||
"~/.dotfiles", | ||
"~/.config" | ||
] | ||
} | ||
``` | ||
|
||
Add [globbing patterns](https://docs.python.org/2/library/fnmatch.html#module-fnmatch) to the `excludes` list to remove them from the results. | ||
|
||
Add hidden directories to `search_directories` if you want them to be searched, too. | ||
|
||
**Note**: Hidden directories will be searched with `find`, so don't add large directory hierarchies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.