mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
adding zsh stuff back
This commit is contained in:
parent
66a33b80c3
commit
60fcdd4d61
4 changed files with 232 additions and 0 deletions
10
custom/corrections.zsh
Normal file
10
custom/corrections.zsh
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
alias node='nocorrect node'
|
||||||
|
alias ack='nocorrect ack'
|
||||||
|
alias hg='nocorrect hg'
|
||||||
|
alias npm='nocorrect npm'
|
||||||
|
alias figlet="nocorrect figlet"
|
||||||
|
alias ksdiff="nocorrect ksdiff"
|
||||||
|
alias scala="nocorrect scala"
|
||||||
|
alias nodo="nocorrect nodo"
|
||||||
|
alias grunt="nocorrect grunt"
|
||||||
|
alias start="nocorrect start"
|
||||||
86
custom/plugins/gerrit.plugin.zsh
Normal file
86
custom/plugins/gerrit.plugin.zsh
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
function gerrit_usage {
|
||||||
|
echo
|
||||||
|
echo " usage: gerrit <command>"
|
||||||
|
echo
|
||||||
|
echo " try these :";
|
||||||
|
echo " push Push changes without going through a review. ";
|
||||||
|
echo " pull Pull latest changes and rebase ... or something. ";
|
||||||
|
echo " review Push changes and submit changes for review";
|
||||||
|
echo " setup-reviewers Set current repo to automatically have reviewers from your team";
|
||||||
|
echo " add-reviewer Add a reviewer to the repo";
|
||||||
|
echo " clone Clone a repo from gerrit, requires repo name";
|
||||||
|
echo " setup Add gerrit commit hook to a repo";
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_push () {
|
||||||
|
git push origin HEAD:refs/heads/$1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_review () {
|
||||||
|
git push origin HEAD:refs/for/$1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_pull () {
|
||||||
|
#git pull --rebase origin $1;
|
||||||
|
git fetch;
|
||||||
|
git rebase origin/$1
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_clone () {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "$yellow Please supply the name of a repo to clone. $stop"
|
||||||
|
else
|
||||||
|
git clone --recursive ssh://gerrit_host/$1 $2
|
||||||
|
#echo "git clone ssh://gerrit_host/$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_set_team_reviewers () {
|
||||||
|
git config remote.origin.receivepack 'git receive-pack --reviewer kmcgregor@giltcity.com --reviewer nyusaf@gilt.com';
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "$green Reviewers Added. $stop";
|
||||||
|
else
|
||||||
|
echo "$red That failed for some reason. I'm not sure what to do now. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_add_reviewer {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "$yellow Please specify reviewer. $stop";
|
||||||
|
else
|
||||||
|
echo "$red Please finish me. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_setup () {
|
||||||
|
cd .git/hooks;
|
||||||
|
scp gerrit_host:hooks/commit-msg . > /dev/null;
|
||||||
|
cd - > /dev/null;
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "$green Gerrit hook installed. $stop";
|
||||||
|
else
|
||||||
|
echo "$red Couldn't install Gerrit hook. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit () {
|
||||||
|
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null);
|
||||||
|
isGitRepo=$?
|
||||||
|
branch=${ref#refs/heads/};
|
||||||
|
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
gerrit_usage;
|
||||||
|
else
|
||||||
|
[ $1 = "push" ] && gerrit_push $branch;
|
||||||
|
[ $1 = "review" ] && gerrit_review $branch;
|
||||||
|
[ $1 = "pull" ] && gerrit_pull $branch;
|
||||||
|
[ $1 = "setup-reviewers" ] && gerrit_set_team_reviewers;
|
||||||
|
[ $1 = "add-reviewer" ] && gerrit_add_reviewer $2;
|
||||||
|
[ $1 = "clone" ] && gerrit_clone $2;
|
||||||
|
[ $1 = "setup" ] && gerrit_setup;
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
86
plugins/gerrit/gerrit.plugin.zsh
Normal file
86
plugins/gerrit/gerrit.plugin.zsh
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
function gerrit_usage {
|
||||||
|
echo
|
||||||
|
echo " usage: gerrit <command>"
|
||||||
|
echo
|
||||||
|
echo " try these :";
|
||||||
|
echo " push Push changes without going through a review. ";
|
||||||
|
echo " pull Pull latest changes and rebase ... or something. ";
|
||||||
|
echo " review Push changes and submit changes for review";
|
||||||
|
echo " setup-reviewers Set current repo to automatically have reviewers from your team";
|
||||||
|
echo " add-reviewer Add a reviewer to the repo";
|
||||||
|
echo " clone Clone a repo from gerrit, requires repo name";
|
||||||
|
echo " setup Add gerrit commit hook to a repo";
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_push () {
|
||||||
|
git push origin HEAD:refs/heads/$1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_review () {
|
||||||
|
git push origin HEAD:refs/for/$1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_pull () {
|
||||||
|
#git pull --rebase origin $1;
|
||||||
|
git fetch;
|
||||||
|
git rebase origin/$1
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_clone () {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "$yellow Please supply the name of a repo to clone. $stop"
|
||||||
|
else
|
||||||
|
git clone --recursive ssh://gerrit_host/$1 $2
|
||||||
|
#echo "git clone ssh://gerrit_host/$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_set_team_reviewers () {
|
||||||
|
git config remote.origin.receivepack 'git receive-pack --reviewer kmcgregor@giltcity.com --reviewer nyusaf@gilt.com';
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "$green Reviewers Added. $stop";
|
||||||
|
else
|
||||||
|
echo "$red That failed for some reason. I'm not sure what to do now. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_add_reviewer {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "$yellow Please specify reviewer. $stop";
|
||||||
|
else
|
||||||
|
echo "$red Please finish me. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit_setup () {
|
||||||
|
cd .git/hooks;
|
||||||
|
scp gerrit_host:hooks/commit-msg . > /dev/null;
|
||||||
|
cd - > /dev/null;
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
echo "$green Gerrit hook installed. $stop";
|
||||||
|
else
|
||||||
|
echo "$red Couldn't install Gerrit hook. $stop";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function gerrit () {
|
||||||
|
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null);
|
||||||
|
isGitRepo=$?
|
||||||
|
branch=${ref#refs/heads/};
|
||||||
|
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
gerrit_usage;
|
||||||
|
else
|
||||||
|
[ $1 = "push" ] && gerrit_push $branch;
|
||||||
|
[ $1 = "review" ] && gerrit_review $branch;
|
||||||
|
[ $1 = "pull" ] && gerrit_pull $branch;
|
||||||
|
[ $1 = "setup-reviewers" ] && gerrit_set_team_reviewers;
|
||||||
|
[ $1 = "add-reviewer" ] && gerrit_add_reviewer $2;
|
||||||
|
[ $1 = "clone" ] && gerrit_clone $2;
|
||||||
|
[ $1 = "setup" ] && gerrit_setup;
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
50
themes/nathanstilwell.zsh-theme
Normal file
50
themes/nathanstilwell.zsh-theme
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
#
|
||||||
|
# Available Color Options are :
|
||||||
|
#
|
||||||
|
# red, green, blue, cyan, magenta, yellow, white, black
|
||||||
|
#
|
||||||
|
# Reference to what stuff in the Prompt is:
|
||||||
|
# %n = username
|
||||||
|
# %~ = pwd
|
||||||
|
# %m = machine name
|
||||||
|
#
|
||||||
|
|
||||||
|
# $FG[025] - dark blue
|
||||||
|
# $FG[050] - cyan
|
||||||
|
# $FG[075] - light blue
|
||||||
|
# $FG[100] - muddy yellow
|
||||||
|
# $FG[125] - strawberry
|
||||||
|
# $FG[145] - white
|
||||||
|
|
||||||
|
PROMPT='%{$fg[green]%}$(collapse_pwd)%{$fg[white]%} $(git_prompt_info)%{$reset_color%} ≫ '
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="// %{$fg[red]%}"
|
||||||
|
#ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[white]%} // %{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ✼%{$reset_color%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%} ⌘"
|
||||||
|
|
||||||
|
# RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} +++"
|
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ***"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ---"
|
||||||
|
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ≫≫≫"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ⏀"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[magenta]%} ???"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Convert the home directory to "~"
|
||||||
|
# (Courtesy of Mr. Steve Losh)
|
||||||
|
#
|
||||||
|
|
||||||
|
function collapse_pwd {
|
||||||
|
echo $(pwd | sed -e "s,^$HOME,~,")
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Some Special Characters if you want to swap out the prompts
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
# ✰ ✼ ✪ ✙ ♔ ♘ ♜ ♛ ♚ ♞ ♬ ⏀ ⌦ ⌘ ≫ ⇪ ☩ ☀ ☂ ★ ⚓ Ө β δ Σ Ω μ Δ ↪
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue