From 61ce221bc29bb40df14b16e1f6e261c0c3ab9258 Mon Sep 17 00:00:00 2001 From: Till Salzer Date: Thu, 23 May 2013 11:41:25 +0200 Subject: [PATCH] Sublime plugin should check more locations On OSX, the sublime plugin checks for various possible locations of the Sublime Text application; on Linux, however, only two spots are covered. This change uses the same detection mechanism used for OSX for Linux systems to check for the typical install locations: $HOME/bin/sublime_text /usr/local/bin/sublime_text /usr/bin/sublime_text This allows non-root users on Linux systems to use the plugin without hassle. --- plugins/sublime/sublime.plugin.zsh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh index a2042343a..7bf9d12a6 100755 --- a/plugins/sublime/sublime.plugin.zsh +++ b/plugins/sublime/sublime.plugin.zsh @@ -5,16 +5,18 @@ if [[ $('uname') == 'Linux' ]]; then _sublime_linux_paths=( "$HOME/bin/sublime_text" "/opt/sublime_text/sublime_text" - "/usr/bin/sublime_text" "/usr/local/bin/sublime_text" + "/usr/local/bin/sublime-text" + "/usr/bin/sublime_text" + "/usr/bin/sublime-text" ) - for _sublime_path in $_sublime_linux_paths; do - if [[ -a $_sublime_path ]]; then - st_run() { $_sublime_path $@ >/dev/null 2>&1 &| } - alias st=st_run - break - fi - done + for _sublime_path in $_sublime_linux_paths; do + if [[ -a $_sublime_path ]]; then + st_run() { nohup $_sublime_path $@ > /dev/null 2>&1 &| } + alias st=st_run + break + fi + done elif [[ $('uname') == 'Darwin' ]]; then local _sublime_darwin_paths > /dev/null 2>&1