1
0
Fork 0

Improve zshrc for macOS
the build failed Details

main
Ambrose Chua 2018-10-17 14:52:42 +08:00
parent 7be1a8331a
commit 131ed2ccb6
1 changed files with 52 additions and 36 deletions

34
.zshrc
View File

@ -26,7 +26,11 @@ bindkey '^R' history-incremental-search-backward
fpath=( $HOME/.zsh/functions $fpath )
# ls colors
eval $(dircolors -b $HOME/.dircolors)
if [[ "$(uname -s)" -eq "Darwin" ]]; then
eval $(gdircolors -b $HOME/.dircolors)
else
eval $(dircolors -b $HOME/.dircolors)
fi
# editor
export EDITOR=nvim
@ -56,16 +60,24 @@ alias vim=nvim
# gpg as ssh agent
test -e "$(which gpgconf)" && export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
# macOS GOPATH
if [[ "$(uname -s)" -eq "Darwin" ]]; then
export GOPATH="$HOME/Documents/go"
fi
# iTerm2 integration
test -e "$HOME/.iterm2_shell_integration.zsh" && source "$HOME/.iterm2_shell_integration.zsh"
# hack to optionally get some oh-my-zsh back
export ZSH="$HOME/.oh-my-zsh"
test -e "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh" && source "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh"
# legacy scripts
test -e "$HOME/.bin" && export PATH="$HOME/.bin:$PATH" # TODO: move to .local/bin
# tips
function tips {
# hack to optionally get some oh-my-zsh back
if [[ "$(uname -s)" -eq "Darwin" ]]; then
export ZSH="$HOME/.oh-my-zsh"
test -e "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh" && source "$HOME/.oh-my-zsh/plugins/osx/osx.plugin.zsh"
# legacy scripts
test -e "$HOME/.bin" && export PATH="$HOME/.bin:$PATH" # TODO: move to .local/bin
# tips
function tips {
echo "Some useful commands:"
echo " - spotify || itunes Chill out to 🎧"
echo " - cdf Jumps to the folder open in finder"
@ -93,4 +105,8 @@ function tips {
echo " - (scroll screen, put current line at) z. (center) z+ (top) z- (bottom)"
echo " - (scroll screen by one line) ctrl-y (up) ctrl-e (down)"
echo " - mx (mark as x) \`x (return to x)"
}
}
tips
fi