1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-05 20:57:46 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Marc Cornellà
6ebf27b8d3 Revert "Remove redundant bashcompinit calls"
This reverts commit f776af2a1f.

Fixes #9314
2020-10-05 17:20:02 +02:00
Marc Cornellà
fbb2b56c7e fino: stop bold with prompt sequence
Fixes weird bug when completing.
2020-10-05 12:05:47 +02:00
Matsievskiy S.V
b4093819a8
fino: fix dangling "using" and clean up (#9307)
Co-authored-by: Matsievskiy S.V <matsievskiysv@gmail.com>
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-10-05 11:42:22 +02:00
6 changed files with 29 additions and 12 deletions

View File

@ -64,6 +64,7 @@ fi
# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back
if command -v aws_completer &> /dev/null; then
autoload -Uz bashcompinit && bashcompinit
complete -C aws_completer aws
else
function _awscli-homebrew-installed() {

View File

@ -10,8 +10,11 @@ if (( ${+commands[compleat]} )); then
local setup="${prefix}/share/compleat-1.0/compleat_setup"
if [[ -f "$setup" ]]; then
if ! bashcompinit >/dev/null 2>&1; then
autoload -U bashcompinit
bashcompinit -i
fi
source "$setup"
fi
unset prefix setup
fi

View File

@ -99,4 +99,6 @@ alias drvg="drush variable-get"
alias drvs="drush variable-set"
# Enable drush autocomplete support
autoload bashcompinit
bashcompinit
source $(dirname $0)/drush.complete.sh

View File

@ -1,3 +1,4 @@
(( $+commands[stack] )) || return
autoload -U +X bashcompinit && bashcompinit
source <(stack --bash-completion-script stack)

View File

@ -138,6 +138,7 @@ alias wpwm='wp widget move'
alias wpwu='wp widget update'
autoload -U +X bashcompinit && bashcompinit
# bash completion for the `wp` command
_wp_complete() {

View File

@ -11,26 +11,35 @@
#
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
function virtualenv_prompt_info {
[[ -n ${VIRTUAL_ENV} ]] || return
echo "${ZSH_THEME_VIRTUALENV_PREFIX:=[}${VIRTUAL_ENV:t}${ZSH_THEME_VIRTUALENV_SUFFIX:=]}"
}
function prompt_char {
git branch >/dev/null 2>/dev/null && echo "±" && return
echo '○'
command git branch &>/dev/null && echo "±" || echo '○'
}
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
}
local ruby_env='using%{$FG[243]%} $(ruby_prompt_info)'
local ruby_env='$(ruby_prompt_info)'
local git_info='$(git_prompt_info)'
local virtualenv_info='$(virtualenv_prompt_info)'
local prompt_char='$(prompt_char)'
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env}
PROMPT="╭─${FG[040]}%n ${FG[239]}at ${FG[033]}$(box_name) ${FG[239]}in %B${FG[226]}%~%b${git_info}${ruby_env}${virtualenv_info}
╰─${prompt_char}%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
ZSH_THEME_GIT_PROMPT_PREFIX=" ${FG[239]}on%{$reset_color%} ${FG[255]}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
ZSH_THEME_RUBY_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="${FG[202]}✘✘✘"
ZSH_THEME_GIT_PROMPT_CLEAN="${FG[040]}✔"
ZSH_THEME_RUBY_PROMPT_PREFIX=" ${FG[239]}using${FG[243]} "
ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}"
export VIRTUAL_ENV_DISABLE_PROMPT=1
ZSH_THEME_VIRTUALENV_PREFIX=" ${FG[239]}using${FG[243]} «"
ZSH_THEME_VIRTUALENV_SUFFIX="»%{$reset_color%}"