Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Plugins: mactex, sublime text 2 (OS X only for now) #1013

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

ianchesal commented Mar 13, 2012

Am I doing this right now? My first pull request so let me know if this is wrong. Apparently I can't cherry pick commits to put in a request so these are both coming as one request, sorry.

MacTeX - Sets up the PATH for MacTeX access. That's about it right now.

Sublime Text 2 - PATH setup for the command line subl and then some aliases similar to what's in the TextMate bundle.

ianchesal added some commits Feb 8, 2012

@ianchesal ianchesal First instance of the MacTeX plugin
Only ensures that the /usr/texbin and ~/texbin directories are on your
PATH if they're not already there. I'll expand it further to include
some help TeX-specific functions and aliases in the future.
1ac89fc
@ianchesal ianchesal First instance of the Sublime Text 2 plugin
* Sets up PATH on OS X for subl access if it's not already there
* Adds some handle aliases for working with ST2 from the command line

More to come!
47a4798

jedahan commented Mar 13, 2012

If you use separate branches for each plugin you should be able to have two separate pull requests, one for each plugin.

Contributor

ianchesal commented Mar 13, 2012

Thanks! Should I cancel this, resubmit?

jedahan commented Mar 13, 2012

Yeah, I would close this pull request and submit 2 new ones. You can always re-open this request if theres too much trouble doing the branching stuff / it doesn't work right.

@sorin-ionescu sorin-ionescu commented on the diff Mar 13, 2012

plugins/mactex/mactex.plugin.zsh
@@ -0,0 +1,9 @@
+LATEX=`which latex`
+if [[ $LATEX == 'latex not found' ]] ; then
@sorin-ionescu

sorin-ionescu Mar 13, 2012

Contributor
if (( $+commands[latex] )); then
  # stuff
fi
@ianchesal

ianchesal Mar 13, 2012

Contributor

Very cool. That's a whole lot easier than it is in bash. Thanks.

@sorin-ionescu sorin-ionescu commented on the diff Mar 13, 2012

plugins/mactex/mactex.plugin.zsh
@@ -0,0 +1,9 @@
+LATEX=`which latex`
+if [[ $LATEX == 'latex not found' ]] ; then
+ if [ -d /usr/texbin ] ; then
+ export PATH=/usr/texbin:${PATH}
@sorin-ionescu

sorin-ionescu Mar 13, 2012

Contributor

path+=/usr/textbin

@sorin-ionescu sorin-ionescu commented on the diff Mar 13, 2012

plugins/mactex/mactex.plugin.zsh
@@ -0,0 +1,9 @@
+LATEX=`which latex`
+if [[ $LATEX == 'latex not found' ]] ; then
+ if [ -d /usr/texbin ] ; then
+ export PATH=/usr/texbin:${PATH}
+ fi
+ if [ -d ~/texbin ] ; then
+ export PATH=~/texbin;${PATH}
@sorin-ionescu

sorin-ionescu Mar 13, 2012

Contributor

That's supposed to be a colon, not semicolon. Use path+="$HOME/textbin" instead.

@ianchesal

ianchesal Mar 13, 2012

Contributor

Got it.

@sorin-ionescu sorin-ionescu commented on the diff Mar 13, 2012

plugins/sublime-text-2/sublime-text-2.plugin.zsh
@@ -0,0 +1,20 @@
+# sublime-text-2.plugin.zsh
+#
+# An oh-my-zsh plugin for Sublime Text 2
+# Primarily targetted at OS X ST2 users but this might work for
+# Linux as well.
+#
+SUBL=`which subl`
+if [[ $SUBL == 'subl not found' ]] ; then
+ if [[ `uname` == 'Darwin' ]] ; then
@sorin-ionescu

sorin-ionescu Mar 13, 2012

Contributor

if [[ "$OSTYPE" == darwin* ]]; then

stuff

fi

@sorin-ionescu sorin-ionescu commented on the diff Mar 13, 2012

plugins/sublime-text-2/sublime-text-2.plugin.zsh
@@ -0,0 +1,20 @@
+# sublime-text-2.plugin.zsh
+#
+# An oh-my-zsh plugin for Sublime Text 2
+# Primarily targetted at OS X ST2 users but this might work for
+# Linux as well.
+#
+SUBL=`which subl`
+if [[ $SUBL == 'subl not found' ]] ; then
+ if [[ `uname` == 'Darwin' ]] ; then
+ if [ -d /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin ] ; then
@sorin-ionescu

sorin-ionescu Mar 13, 2012

Contributor

The path is not guaranteed. Shouldn't Sublime Text prompt you to install the binary into /usr/local/bin?

@ianchesal

ianchesal Mar 13, 2012

Contributor

ST's official instructions say to create a symlink to the tool in /usr/local/bin but it has to be done manually. There's no install-command-line-tools menu option like you find in BBEdit or TextWrangler. OS X guidelines say /Applications or ~/Applications for .app packages so they're reasonably safe assumptions for places to search.

@sorin-ionescu

sorin-ionescu Mar 14, 2012

Contributor

You can use Spotlight to find its location mdfind 'Sublime Text 2 kMDItemKind:Application'.

@ianchesal ianchesal closed this Mar 13, 2012

@ianchesal ianchesal reopened this Mar 13, 2012

Contributor

ianchesal commented Mar 13, 2012

@sorin-ionescu @jedahan thanks for the comments guys. I'll drop this. Fix it up. Push two new requests.

@ianchesal ianchesal closed this Mar 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment