mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-26 01:57:26 +08:00
Compare commits
No commits in common. "115cee17015e4b5665e16dc4fd15c53e06a22f9a" and "6101106916147b1716ff2d5de4a53260e7607bae" have entirely different histories.
115cee1701
...
6101106916
@ -1,12 +1,10 @@
|
|||||||
# Put files in this folder to add your own custom functionality.
|
# You can put files here to add functionality separated per file, which
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization
|
# will be ignored by git.
|
||||||
#
|
# Files on the custom/ directory will be automatically loaded by the init
|
||||||
# Files in the custom/ directory will be:
|
# script, in alphabetical order.
|
||||||
# - loaded automatically by the init script, in alphabetical order
|
|
||||||
# - loaded last, after all built-ins in the lib/ directory, to override them
|
# For example: add yourself some shortcuts to projects you often work on.
|
||||||
# - ignored by git by default
|
|
||||||
#
|
|
||||||
# Example: add custom/shortcuts.zsh for shortcuts to your local projects
|
|
||||||
#
|
#
|
||||||
# brainstormr=~/Projects/development/planetargon/brainstormr
|
# brainstormr=~/Projects/development/planetargon/brainstormr
|
||||||
# cd $brainstormr
|
# cd $brainstormr
|
||||||
|
#
|
||||||
|
|||||||
@ -1,3 +1,2 @@
|
|||||||
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
||||||
# here will override ones with the same name in the main plugins directory.
|
# here will override ones with the same name in the main plugins directory.
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
# Put your custom themes in this folder.
|
# Put your custom themes in this folder.
|
||||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes
|
|
||||||
#
|
|
||||||
# Example:
|
# Example:
|
||||||
|
|
||||||
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
|
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
|
||||||
|
|||||||
@ -17,13 +17,9 @@ if ! type autoenv_init >/dev/null; then
|
|||||||
/usr/local/bin
|
/usr/local/bin
|
||||||
/usr/share/autoenv-git
|
/usr/share/autoenv-git
|
||||||
~/Library/Python/bin
|
~/Library/Python/bin
|
||||||
.venv/bin
|
|
||||||
venv/bin
|
|
||||||
env/bin
|
|
||||||
.env/bin
|
|
||||||
)
|
)
|
||||||
for d ( $install_locations ); do
|
for d ( $install_locations ); do
|
||||||
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
if [[ -e $d/activate.sh ]]; then
|
||||||
autoenv_dir=$d
|
autoenv_dir=$d
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@ -33,7 +29,7 @@ if ! type autoenv_init >/dev/null; then
|
|||||||
# Look for Homebrew path as a last resort
|
# Look for Homebrew path as a last resort
|
||||||
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
||||||
d=$(brew --prefix)/opt/autoenv
|
d=$(brew --prefix)/opt/autoenv
|
||||||
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
if [[ -e $d/activate.sh ]]; then
|
||||||
autoenv_dir=$d
|
autoenv_dir=$d
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -50,12 +46,8 @@ END
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# Load autoenv
|
# Load autoenv
|
||||||
if [[ -e $autoenv_dir/activate ]]; then
|
|
||||||
source $autoenv_dir/activate
|
|
||||||
else
|
|
||||||
source $autoenv_dir/activate.sh
|
source $autoenv_dir/activate.sh
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
[[ $? != 0 ]] && return $?
|
[[ $? != 0 ]] && return $?
|
||||||
|
|
||||||
|
|||||||
@ -254,7 +254,6 @@ These features allow to pause a branch development and switch to another one (_"
|
|||||||
| work_in_progress | Echoes a warning if the current branch is a wip |
|
| work_in_progress | Echoes a warning if the current branch is a wip |
|
||||||
| gwip | Commit wip branch |
|
| gwip | Commit wip branch |
|
||||||
| gunwip | Uncommit wip branch |
|
| gunwip | Uncommit wip branch |
|
||||||
| gunwipall | Uncommit `--wip--` commits recursively |
|
|
||||||
|
|
||||||
### Deprecated functions
|
### Deprecated functions
|
||||||
|
|
||||||
|
|||||||
@ -27,20 +27,6 @@ function work_in_progress() {
|
|||||||
command git -c log.showSignature=false log -n 1 2>/dev/null | grep -q -- "--wip--" && echo "WIP!!"
|
command git -c log.showSignature=false log -n 1 2>/dev/null | grep -q -- "--wip--" && echo "WIP!!"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Same as `gunwip` but recursive
|
|
||||||
# "Unwips" all recent `--wip--` commits in loop until there is no left
|
|
||||||
function gunwipall() {
|
|
||||||
while true; do
|
|
||||||
commit_message=$(git rev-list --max-count=1 --format="%s" HEAD)
|
|
||||||
if [[ $commit_message =~ "--wip--" ]]; then
|
|
||||||
git reset "HEAD~1"
|
|
||||||
(( $? )) && return 1
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if main exists and use instead of master
|
# Check if main exists and use instead of master
|
||||||
function git_main_branch() {
|
function git_main_branch() {
|
||||||
command git rev-parse --git-dir &>/dev/null || return
|
command git rev-parse --git-dir &>/dev/null || return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user