2019-04-15 07:55:18 -07:00
|
|
|
# sublime
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
Plugin for [Sublime Text](https://www.sublimetext.com/), a cross platform text and code editor,
|
|
|
|
available for Linux, macOS, and Windows.
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
To use the plugin, add `sublime` to the plugins array of your zshrc file:
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
```zsh
|
|
|
|
plugins=(... sublime)
|
|
|
|
```
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
Sublime Text has to be installed to use the plugin.
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
## Usage
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
The plugin defines several aliases, such as:
|
2015-02-24 05:58:50 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
- `st`: opens Sublime Text. If passed a file or directory, Sublime Text will open it.
|
2015-02-24 06:05:58 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
- `stt`: open Sublime Text on the current directory.
|
2016-08-14 18:00:19 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
- `sst`: if `sudo` is available, `sst` will open Sublime Text with root permissions, so that
|
|
|
|
you can modify any file or directory that you pass it. Useful to edit system files.
|
2016-08-14 18:00:19 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
There are also a few functions available:
|
2018-01-22 20:23:36 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
- `find_project` (or `stp` alias): if called, the function will search for a `.sublime-project` file
|
|
|
|
on the current directory or its parents, until it finds none.
|
2018-01-22 20:23:36 -07:00
|
|
|
|
2019-04-15 07:55:18 -07:00
|
|
|
If there is no `.sublime-project` file but the current folder is in a Git repository, it will open
|
|
|
|
Sublime Text on the root directory of the repository.
|
|
|
|
|
|
|
|
If there is no Git repository, it will then open Sublime Text on the current directory.
|
|
|
|
|
|
|
|
- `create_project` (or `stn` alias): if called without an argument, create a stub `.sublime-project`
|
|
|
|
file in the current working directory, if one does not already exist. If passed a directory, create
|
|
|
|
a stub `.sublime-project` file in it.
|