mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-24 04:29:25 +02:00
Fix coding styles for ./lib/*
This commit is contained in:
parent
078cd4ae2b
commit
df136ebb99
9 changed files with 85 additions and 77 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
## Bazaar integration
|
## Bazaar integration
|
||||||
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
|
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
|
||||||
function bzr_prompt_info() {
|
function bzr_prompt_info() {
|
||||||
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
|
BZR_CB=$(bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}')
|
||||||
if [ -n "$BZR_CB" ]; then
|
if [ -n "$BZR_CB" ]; then
|
||||||
BZR_DIRTY=""
|
BZR_DIRTY=""
|
||||||
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
|
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
function clipcopy() {
|
function clipcopy() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
local file=$1
|
local file=$1
|
||||||
|
|
||||||
if [[ $OSTYPE == darwin* ]]; then
|
if [[ $OSTYPE == darwin* ]]; then
|
||||||
if [[ -z $file ]]; then
|
if [[ -z $file ]]; then
|
||||||
pbcopy
|
pbcopy
|
||||||
|
|
|
||||||
|
|
@ -72,10 +72,12 @@ function omz_diagnostic_dump() {
|
||||||
if [[ ${#*} > 0 ]]; then
|
if [[ ${#*} > 0 ]]; then
|
||||||
opt_outfile=$1
|
opt_outfile=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${#*} > 1 ]]; then
|
if [[ ${#*} > 1 ]]; then
|
||||||
builtin echo "$thisfcn: error: too many arguments" >&2
|
builtin echo "$thisfcn: error: too many arguments" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$opt_outfile" ]]; then
|
if [[ -n "$opt_outfile" ]]; then
|
||||||
outfile="$opt_outfile"
|
outfile="$opt_outfile"
|
||||||
fi
|
fi
|
||||||
|
|
@ -124,6 +126,7 @@ function _omz_diag_dump_one_big_text() {
|
||||||
for program in $programs; do
|
for program in $programs; do
|
||||||
extra_str="" sha_str=""
|
extra_str="" sha_str=""
|
||||||
progfile=$(builtin which $program)
|
progfile=$(builtin which $program)
|
||||||
|
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
if [[ -e $progfile ]]; then
|
if [[ -e $progfile ]]; then
|
||||||
if builtin whence shasum &>/dev/null; then
|
if builtin whence shasum &>/dev/null; then
|
||||||
|
|
@ -140,6 +143,7 @@ function _omz_diag_dump_one_big_text() {
|
||||||
builtin echo "$program: not found"
|
builtin echo "$program: not found"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
builtin echo
|
builtin echo
|
||||||
builtin echo Command Versions:
|
builtin echo Command Versions:
|
||||||
builtin echo "zsh: $(zsh --version)"
|
builtin echo "zsh: $(zsh --version)"
|
||||||
|
|
@ -350,4 +354,3 @@ function _omz_diag_dump_os_specific_version() {
|
||||||
builtin echo
|
builtin echo
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ function parse_git_dirty() {
|
||||||
function git_remote_status() {
|
function git_remote_status() {
|
||||||
local remote ahead behind git_remote_status git_remote_status_detailed
|
local remote ahead behind git_remote_status git_remote_status_detailed
|
||||||
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
|
||||||
|
|
||||||
if [[ -n ${remote} ]]; then
|
if [[ -n ${remote} ]]; then
|
||||||
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
|
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
|
||||||
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
|
||||||
|
|
@ -56,6 +57,11 @@ function git_remote_status() {
|
||||||
|
|
||||||
echo $git_remote_status
|
echo $git_remote_status
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]; then
|
||||||
|
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
|
||||||
|
fi
|
||||||
|
echo $git_remote_status
|
||||||
}
|
}
|
||||||
|
|
||||||
# Outputs the name of the current branch
|
# Outputs the name of the current branch
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
# Fully supports screen, iterm, and probably most modern xterm and rxvt
|
# Fully supports screen, iterm, and probably most modern xterm and rxvt
|
||||||
# (In screen, only short_tab_title is used)
|
# (In screen, only short_tab_title is used)
|
||||||
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
|
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
|
||||||
function title {
|
function title() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Runs before showing the prompt
|
# Runs before showing the prompt
|
||||||
function omz_termsupport_precmd {
|
function omz_termsupport_precmd() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
|
|
||||||
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
|
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
|
||||||
|
|
@ -60,7 +60,7 @@ function omz_termsupport_precmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Runs before executing the command
|
# Runs before executing the command
|
||||||
function omz_termsupport_preexec {
|
function omz_termsupport_preexec() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@ autoload -U colors && colors
|
||||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
|
|
||||||
# Enable ls colors
|
# Enable ls colors
|
||||||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
if [ "$DISABLE_LS_COLORS" != "true" ]; then
|
||||||
then
|
|
||||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
||||||
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
||||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||||
|
|
@ -27,8 +26,7 @@ setopt auto_cd
|
||||||
setopt multios
|
setopt multios
|
||||||
setopt cdablevars
|
setopt cdablevars
|
||||||
|
|
||||||
if [[ x$WINDOW != x ]]
|
if [[ x$WINDOW != x ]]; then
|
||||||
then
|
|
||||||
SCREEN_NO="%B$WINDOW%b "
|
SCREEN_NO="%B$WINDOW%b "
|
||||||
else
|
else
|
||||||
SCREEN_NO=""
|
SCREEN_NO=""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue