]> id.pley.net Git - dotfiles.git/blobdiff - zsh_webkit_login
Added subl support.
[dotfiles.git] / zsh_webkit_login
index 555e6d54db6c0f9103e9ff645ac9e6f7313a3c7d..af71a2b3e83464f57b91c14779feddd6a79293c7 100644 (file)
@@ -19,3 +19,25 @@ _webkit_dirs() { compadd $( for dir in ~/Projects/WebKit.*; do echo ${dir##*.};
 _switchto() { _arguments '1:dir:_webkit_dirs' }
 
 compdef _switchto switchto
+
+if [[ $( has subl ) == 'yes' ]]; then
+    export GUI_EDITOR="subl -w"
+elif [[ $( has bbedit ) == 'yes' ]]; then
+    export GUI_EDITOR="bbedit -w"
+elif [[ $( has mate_wait ) == 'yes' ]]; then
+    export GUI_EDITOR="mate_wait"
+else
+    export GUI_EDITOR="vim"
+fi
+
+if [[ -z "$SSH_TTY" ]]; then
+    export EDITOR="$GUI_EDITOR"
+    export SVN_LOG_EDITOR="$GUI_EDITOR"
+    export GIT_SEQUENCE_EDITOR="$GUI_EDITOR"
+else
+    export EDITOR=vim
+    export SVN_LOG_EDITOR=vim
+    export GIT_SEQUENCE_EDITOR=vim
+fi
+
+switchto git