Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Oh My Zsh integration. #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions git/gitconfig.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
protocol = https
[alias]
co = checkout
promote = !$ZSH/bin/git-promote
wtf = !$ZSH/bin/git-wtf
rank-contributors = !$ZSH/bin/git-rank-contributors
promote = !$DOTFILES/bin/git-promote
wtf = !$DOTFILES/bin/git-wtf
rank-contributors = !$DOTFILES/bin/git-rank-contributors
count = !git shortlog -sn
[color]
diff = auto
Expand Down
2 changes: 1 addition & 1 deletion zsh/prompt.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ directory_name() {
}

battery_status() {
$ZSH/bin/battery-status
$DOTFILES/bin/battery-status
}

export PROMPT=$'\n$(battery_status)in $(directory_name) $(git_dirty)$(need_push)\n› '
Expand Down
29 changes: 23 additions & 6 deletions zsh/zshrc.symlink
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# shortcut to this dotfiles path is $ZSH
export ZSH=$HOME/.dotfiles
# shortcut to this dotfiles path is $DOTFILES
export DOTFILES=$HOME/.dotfiles

# $ZSH variable is deprecated, use $DOTFILES instead
export ZSH="$DOTFILES"

# your project folder that we can `c [tab]` to
export PROJECTS=~/Code
Expand All @@ -14,7 +17,7 @@ fi

# all of our zsh files
typeset -U config_files
config_files=($ZSH/**/*.zsh)
config_files=($DOTFILES/**/*.zsh)

# load the path files
for file in ${(M)config_files:#*/path.zsh}
Expand All @@ -28,9 +31,20 @@ do
source $file
done

# initialize autocomplete here, otherwise functions won't be loaded
autoload -U compinit
compinit
# Oh My Zsh could be installed somewhere out of dotfiles directory tree, e.g.
# into ~/.oh-my-zsh; the configuration file created by Oh My Zsh installer
# should be moved as follows: {.zshrc => $DOTFILES/zsh/oh-my-zshrc}.
if [[ -f $DOTFILES/zsh/oh-my-zshrc ]]; then
() {
local ZSH="$HOME/.oh-my-zsh"
source $DOTFILES/zsh/oh-my-zshrc
export OHMYZSH="$ZSH"
}
else
# initialize autocomplete here, otherwise functions won't be loaded
autoload -U compinit
compinit
fi

# load every completion after autocomplete loads
for file in ${(M)config_files:#*/completion.zsh}
Expand All @@ -39,3 +53,6 @@ do
done

unset config_files

# Notify existing users that they should migrate to another variable.
export ZSH='$ZSH is deprecated, use either $DOTFILES or $OHMYZSH instead.'