Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Login shells (2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# All shells (1) | ||
|
||
# | ||
# Paths | ||
|
||
TRY_PATHS=" | ||
${HOME}/bin | ||
${HOME}/.dotfiles/bin | ||
/opt/local/bin | ||
/opt/local/sbin | ||
/opt/jruby/bin | ||
/opt/scala/bin | ||
/usr/local/mysql/bin | ||
${HOME}/dev/tools/depot_tools | ||
" | ||
|
||
for try_path in $TRY_PATHS | ||
do | ||
test -d $try_path && export PATH=$PATH:$try_path | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Interactive shells (3) | ||
|
||
# | ||
# Prompt | ||
|
||
autoload -U colors | ||
colors | ||
setopt prompt_subst | ||
|
||
# Modify the colors and symbols in these variables as desired. | ||
GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}[" | ||
GIT_PROMPT_SUFFIX="]%{$reset_color%}" | ||
GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡" | ||
GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●" | ||
GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●" | ||
GIT_PROMPT_STAGED="%{$fg_bold[green]%}●" | ||
|
||
# Show Git branch/tag, or name-rev if on detached head | ||
parse_git_branch() { | ||
(git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD) 2> /dev/null | ||
} | ||
|
||
# Show different symbols as appropriate for various Git repository states | ||
parse_git_state() { | ||
|
||
# Compose this value via multiple conditional appends. | ||
local GIT_STATE="" | ||
|
||
local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)" | ||
if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then | ||
GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING | ||
fi | ||
|
||
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then | ||
GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED | ||
fi | ||
|
||
if ! git diff --quiet 2> /dev/null; then | ||
GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED | ||
fi | ||
|
||
if ! git diff --cached --quiet 2> /dev/null; then | ||
GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED | ||
fi | ||
|
||
if [[ -n $GIT_STATE ]]; then | ||
echo "$GIT_STATE " | ||
fi | ||
|
||
} | ||
|
||
# If inside a Git repository, print its branch and state | ||
git_prompt_string() { | ||
local git_where="$(parse_git_branch)" | ||
[ -n "$git_where" ] && echo "$(parse_git_state)$GIT_PROMPT_PREFIX${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX" | ||
} | ||
|
||
PS1="%(?,%{$fg_bold[green]%}-,%{$fg_bold[red]%}!)%{$reset_color%} %{$reset_color%} %{$fg_bold[green]%}%n@%m %{$fg_bold[blue]%}%1~ %#%{$reset_color%} " | ||
RPS1='$(git_prompt_string) %{$fg_bold[yellow]%}#%h%{$reset_color%}' | ||
|
||
# | ||
# Aliases | ||
|
||
alias ls='ls -G' | ||
alias ll='ls -lh' | ||
alias lll='ls -lah' | ||
alias grep='grep --color=auto' |