From 7410dc3876bc791e73986acb706de2fb3699d346 Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Fri, 29 Aug 2014 09:57:42 +0200 Subject: [PATCH 1/3] Added autocomplete for tmuxinator configs in subdirs --- plugins/tmuxinator/_tmuxinator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator index cd227b7df..eee4158e6 100644 --- a/plugins/tmuxinator/_tmuxinator +++ b/plugins/tmuxinator/_tmuxinator @@ -25,7 +25,7 @@ case $state in args) case $line[1] in start|open|copy|delete) - _configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`) + _configs=(`find ~/.tmuxinator -name \*.yml | sed -re 's:.*\.tmuxinator/(.*)\.yml:\1:'`) _values 'configs' $_configs ret=0 ;; From 8312243fb139b916df2397a17ee49cd78f5f6bcb Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Fri, 29 Aug 2014 10:01:06 +0200 Subject: [PATCH 2/3] Added vi mode support for gnzh theme --- themes/gnzh.zsh-theme | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index 3c6b8a409..e6031ecb7 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -31,7 +31,34 @@ else eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH fi -local return_code="%(?..%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" +set-return-code() { + typeset -g return_code="" + if [[ $__prompt_status != 0 ]]; then + return_code="%{$PR_RED%}$__prompt_status ↵%{$PR_NO_COLOR%}" + fi +} + +set-rps1() { + local mode='' + if [[ $KEYMAP = vicmd ]]; then + mode='%{$PR_RED%}[CMD]%{$PR_NO_COLOR%}' + fi + RPS1="${return_code} ${mode}" + zle reset-prompt +} + +zle-line-init() { + typeset -g __prompt_status="$?" + set-return-code + set-rps1 +} + +zle-keymap-select() { + set-rps1 +} + +zle -N zle-keymap-select +zle -N zle-line-init local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' From 4c44b8921e0f03fc7691fd36d68dcebf3e83e62c Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Fri, 29 Aug 2014 10:03:46 +0200 Subject: [PATCH 3/3] Added support for chruby in gnzh theme --- themes/gnzh.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/gnzh.zsh-theme b/themes/gnzh.zsh-theme index e6031ecb7..7e3f468b7 100644 --- a/themes/gnzh.zsh-theme +++ b/themes/gnzh.zsh-theme @@ -65,10 +65,10 @@ local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' local rvm_ruby='' if which rvm-prompt &> /dev/null; then rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi +elif which rbenv &> /dev/null; then + rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' +elif which chruby &> /dev/null; then + rvm_ruby='%{$PR_RED%}‹$(chruby | (grep "*" || echo system) | sed "s/ \* //")›%{$PR_NO_COLOR%}' fi local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}'