Skip to content

Instantly share code, notes, and snippets.

@TaurusOlson
Created April 21, 2011 23:03
Show Gist options
  • Save TaurusOlson/935676 to your computer and use it in GitHub Desktop.
Save TaurusOlson/935676 to your computer and use it in GitHub Desktop.
My zshrc
export ZSH=$HOME/.zsh
# Usage: init_config CONFIG_FILE
# Description: Source the configuration file, and create an alias to edit it
init_config() {
local CONFIG_FILE=$1
if [[ -r $CONFIG_FILE ]]
then
source $CONFIG_FILE
CONFIG_ALIAS=".$(basename $CONFIG_FILE)"
alias $CONFIG_ALIAS="vi $CONFIG_FILE"
fi
}
# FUNCTIONS -------------------------------------------------------------------
# fpath=($ZSH/functions $fpath)
# LIB -------------------------------------------------------------------------
for config_file ($ZSH/lib/*.zsh) init_config $config_file
# PLUGINS ---------------------------------------------------------------------
plugin=${plugin:=()}
plugins=( brew )
for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
# Zsh aliases
alias sz='source $HOME/.zshrc'
alias .zshrc='vi $HOME/.zshrc'
# Bash aliases
alias sb='source $HOME/.bashrc'
alias .bashrc='vi $HOME/.bashrc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment