mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-16 23:37:55 +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.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization
|
||||
#
|
||||
# Files in the custom/ directory will be:
|
||||
# - loaded automatically by the init script, in alphabetical order
|
||||
# - loaded last, after all built-ins in the lib/ directory, to override them
|
||||
# - ignored by git by default
|
||||
#
|
||||
# Example: add custom/shortcuts.zsh for shortcuts to your local projects
|
||||
#
|
||||
# You can put files here to add functionality separated per file, which
|
||||
# will be ignored by git.
|
||||
# Files on the custom/ directory will be automatically loaded by the init
|
||||
# script, in alphabetical order.
|
||||
|
||||
# For example: add yourself some shortcuts to projects you often work on.
|
||||
#
|
||||
# brainstormr=~/Projects/development/planetargon/brainstormr
|
||||
# cd $brainstormr
|
||||
#
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
# 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.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
# Put your custom themes in this folder.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes
|
||||
#
|
||||
# Example:
|
||||
|
||||
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/share/autoenv-git
|
||||
~/Library/Python/bin
|
||||
.venv/bin
|
||||
venv/bin
|
||||
env/bin
|
||||
.env/bin
|
||||
)
|
||||
for d ( $install_locations ); do
|
||||
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
||||
if [[ -e $d/activate.sh ]]; then
|
||||
autoenv_dir=$d
|
||||
break
|
||||
fi
|
||||
@ -33,13 +29,13 @@ if ! type autoenv_init >/dev/null; then
|
||||
# Look for Homebrew path as a last resort
|
||||
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
||||
d=$(brew --prefix)/opt/autoenv
|
||||
if [[ -e $d/activate || -e $d/activate.sh ]]; then
|
||||
if [[ -e $d/activate.sh ]]; then
|
||||
autoenv_dir=$d
|
||||
fi
|
||||
fi
|
||||
|
||||
# Complain if autoenv is not installed
|
||||
if [[ -z $autoenv_dir ]]; then
|
||||
if [[ -z $autoenv_dir ]]; then
|
||||
cat <<END >&2
|
||||
-------- AUTOENV ---------
|
||||
Could not locate autoenv installation.
|
||||
@ -50,11 +46,7 @@ END
|
||||
return 1
|
||||
fi
|
||||
# Load autoenv
|
||||
if [[ -e $autoenv_dir/activate ]]; then
|
||||
source $autoenv_dir/activate
|
||||
else
|
||||
source $autoenv_dir/activate.sh
|
||||
fi
|
||||
source $autoenv_dir/activate.sh
|
||||
fi
|
||||
}
|
||||
[[ $? != 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 |
|
||||
| gwip | Commit wip branch |
|
||||
| gunwip | Uncommit wip branch |
|
||||
| gunwipall | Uncommit `--wip--` commits recursively |
|
||||
|
||||
### 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!!"
|
||||
}
|
||||
|
||||
# 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
|
||||
function git_main_branch() {
|
||||
command git rev-parse --git-dir &>/dev/null || return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user