Last active
December 16, 2015 22:19
-
-
Save sposterkil/5506178 to your computer and use it in GitHub Desktop.
my .zshrc
This file contains hidden or 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
# | |
# Executes commands at the start of an interactive session. | |
# | |
# Authors: | |
# Sorin Ionescu <[email protected]> | |
# | |
# Source Prezto. | |
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then | |
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" | |
fi | |
# Customize to your needs... | |
# Tell ls to be colourful | |
export CLICOLOR=1 | |
# Tell grep to highlight matches | |
export GREP_OPTIONS='--color=auto' | |
source "`brew --prefix`/etc/grc.bashrc" | |
# Pathing: | |
# Root | |
export PATH="/bin:/sbin:" | |
# User | |
export PATH="/usr/bin:/usr/sbin:${PATH}" | |
# Local | |
export PATH="/usr/local/bin:/usr/local/sbin:${PATH}" | |
# Python Executables | |
export PATH="/usr/local/share/python:${PATH}" | |
# Homebrew | |
export PATH="/usr/local/Cellar:${PATH}" | |
# X11 | |
export PATH="/opt/X11/bin:${PATH}" | |
# I don't know what this does!! | |
autoload -Uz promptinit | |
promptinit | |
prompt sorin | |
# Vars | |
export EDITOR="nano" | |
export DEFAULT_USER="Sam" | |
# ls after cd | |
function chpwd() { | |
emulate -L zsh | |
ls -G | |
} | |
# Remove OS X trash files | |
function d_purge() { | |
find . -name '._*' -delete | |
} | |
# mkdir and go to it | |
function take() { | |
mkdir -p $1 && cd $1 | |
} | |
# Toggle hidden files | |
function dotshow() { | |
HIDDENSTATE=$(defaults read com.apple.finder AppleShowAllFiles) 2>/dev/null | |
if [[ "$HIDDENSTATE" == 'FALSE' ]]; then | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
else | |
defaults write com.apple.finder AppleShowAllFiles FALSE | |
fi | |
killall Finder | |
} | |
# Check internet connection w/ DNS server and google | |
function pingtest() { | |
echo Pinging Google DNS | |
ping -c 2 8.8.8.8 | |
echo | |
echo Pinging Google.com | |
ping -c 2 www.google.com | |
echo | |
echo Pinging Case DNS | |
ping -c 2 129.22.4.33 | |
} | |
# Bind arrowkeys to history | |
bindkey "^[[A" history-beginning-search-backward | |
bindkey "^[[B" history-beginning-search-forward | |
# Aliases | |
alias edit='$EDITOR' | |
alias fsize='du -hs' | |
alias la='ls -aG' | |
alias ls='ls -G' | |
alias mcmosh='mosh [email protected]' | |
alias top='htop' | |
alias whereami='pwd' | |
alias osxtrash='d_purge' | |
# Automatic CD? Fun! | |
setopt AUTO_CD | |
# Autocomplete! | |
autoload -U compinit | |
compinit | |
# Also complete aliases | |
setopt completealiases | |
# Tabcomplete Brew stuff | |
fpath=($HOME/.zsh/func $fpath) | |
typeset -U fpath | |
# 10 second wait if you do something that will delete everything. | |
setopt RM_STAR_WAIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment