From cea941ce42b5d550489367608dd1ac4401151c97 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 23 Jun 2015 17:07:21 -0400 Subject: [PATCH] sublime plugin: make "local" work by wrapping in anon function --- plugins/sublime/sublime.plugin.zsh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index 22cf9822..8934783c 100644 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -1,5 +1,9 @@ +# Sublime Text Aliases + +() { + if [[ "$OSTYPE" == linux* ]]; then - local _sublime_linux_paths > /dev/null 2>&1 + local _sublime_linux_paths _sublime_path _sublime_linux_paths=( "$HOME/bin/sublime_text" "/opt/sublime_text/sublime_text" @@ -19,9 +23,8 @@ if [[ "$OSTYPE" == linux* ]]; then break fi done - elif [[ "$OSTYPE" = darwin* ]]; then - local _sublime_darwin_paths > /dev/null 2>&1 + local _sublime_darwin_paths _sublime_path _sublime_darwin_paths=( "/usr/local/bin/subl" "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" @@ -38,10 +41,9 @@ elif [[ "$OSTYPE" = darwin* ]]; then break fi done - elif [[ "$OSTYPE" = 'cygwin' ]]; then - local _sublime_cygwin_paths > /dev/null 2>&1 - _sublime_cygwin_paths=( + local sublime_cygwin_paths _sublime_path + sublime_cygwin_paths=( "$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe" "$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe" ) @@ -52,9 +54,10 @@ elif [[ "$OSTYPE" = 'cygwin' ]]; then break fi done - fi +} + alias stt='st .' find_project()