diff --git a/lib/completion.zsh b/lib/completion.zsh index 52cc5b5..9c2dfec 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -34,9 +34,31 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories cdpath=(.) +# use /etc/hosts and known_hosts for hostname completion +[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(/dev/null| sed -e 's/ /\\ /g') +} + +__vagrant-box () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + _describe -t commands "gem subcommand" _box_arguments + return + ;; + + (options) + case $line[1] in + (repackage|remove) + _arguments ':feature:__box_list' + ;; + esac + ;; + esac +} + + + + +local expl +local -a boxes installed_boxes + +local curcontext="$curcontext" state line +typeset -A opt_args + +_arguments -C \ + ':command:->command' \ + '*::options:->options' + +case $state in + (command) + _describe -t commands "gem subcommand" _1st_arguments + return + ;; + + (options) + case $line[1] in + (help) + _arguments ':feature:__task_list' + ;; + + (box) + __vagrant-box + ;; + esac + ;; +esac diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 0000000..5e9bcf1 --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,3 @@ +fpath=($ZSH/plugins/vagrant $fpath) +autoload -U compinit +compinit -i diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme new file mode 100644 index 0000000..f0ee6a5 --- /dev/null +++ b/themes/bira.zsh-theme @@ -0,0 +1,14 @@ +# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' +local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' +local rvm_ruby='%{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v g)›%{$reset_color%}' +local git_branch='$(git_prompt_info)%{$reset_color%}' + +PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch} +╰─%B$%b " +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"