Plugin for Sublime Text, a cross platform text and code editor, available for Linux, Mac OS X, and Windows.
- Clone this repository somewhere on your machine. This guide will assume
~/.zsh/sublime
.
git clone https://github.com/valentinocossar/sublime.git ~/.zsh/sublime
- Add the following to your
.zshrc
:
source ~/.zsh/sublime/sublime.plugin.zsh
- Start a new terminal session.
- Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)
git clone https://github.com/valentinocossar/sublime.git $ZSH_CUSTOM/plugins/sublime
- Add the plugin to the list of plugins for Oh My Zsh to load:
plugins=(sublime)
- Start a new terminal session.
-
If
st
command is called without an argument, launch Sublime Text. -
If
st
is passed a directory,cd
to it and open it in Sublime Text (in the current window, if there is one open, it is equivalent tosubl -a
). -
If
st
is passed a file, open it in Sublime Text (in the current window, if there is one open, it is equivalent tosubl -a
). -
If
stt
command is called, opening the current folder in Sublime Text (in the current window, if there is one open, it is equivalent tosubl -a .
orst .
). -
If
sst
command is called, it is likesudo st
, opening the file or folder in Sublime Text (in the current window, if there is one open, it is equivalent tosudo subl -a
). Useful for editing system protected files. -
If
stp
command is called, it find a.sublime-project
file by traversing up the directory structure. If there is no.sublime-project
file, but if the current folder is a Git repo, opens up the root directory of the repo. If the current folder is not a Git repo, then opens up the current directory (in the current window, if there is one open).