From 23e76cab12bc493a2b874579ee49defd3226283b Mon Sep 17 00:00:00 2001 From: Kyle West Date: Fri, 23 Mar 2012 14:02:58 -0400 Subject: [PATCH] Documentation for customizing ZSH. --- README.md | 15 +++++++++++++++ custom/zsh.sample/README.markdown | 0 custom/zsh.sample/after.sample.zsh | 20 ++++++++++++++++++++ custom/zsh.sample/before.sample.zsh | 16 ++++++++++++++++ 4 files changed, 51 insertions(+) delete mode 100644 custom/zsh.sample/README.markdown diff --git a/README.md b/README.md index 134675e..ed1634a 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,21 @@ mnemonic aliases. Please feel free to edit them: * Bash style ctrl-R for reverse history finder * Fuzzy matching - if you mistype a directory name, tab completion will fix it +### How To Customize ZSH + +YADR allows you to completely customize your ZSH without having to fork and maintain the project. Here's how it works: YADR will +source (include) any files matching the pattern `*.before.zsh` or `*.after.zsh` in the `custom/zsh` directory. `before` files are +useful for setting the theme and plugins. `after` files allow you to override options set by YADR, define your own aliases, etc. + +To make your life easier, create a `zsh` folder in your Dropbox (or as a git repo) and symlink it into `~/.yadr/custom`. Do it like this: + +```bash +ln -s ~/Dropbox/path/to/zsh ~/.yadr/custom/zsh +``` + +Create as many `whatever.before.zsh` or `whatever.after.zsh` files as you need within the `zsh` directory. Please see `custom/zsh.sample` for +an example. + ## Pry diff --git a/custom/zsh.sample/README.markdown b/custom/zsh.sample/README.markdown deleted file mode 100644 index e69de29..0000000 diff --git a/custom/zsh.sample/after.sample.zsh b/custom/zsh.sample/after.sample.zsh index e69de29..a3a8078 100644 --- a/custom/zsh.sample/after.sample.zsh +++ b/custom/zsh.sample/after.sample.zsh @@ -0,0 +1,20 @@ +# +# Samples of what you can do in *.after.zsh files. +# You can create as many files as you like, or put everything in one. +# + +# define your own aliases or override those provided by YADR. +alias ls='ls -lAhFG' +alias hosts='sudo vim /private/etc/hosts' + + +# set or override options. two of my favorite are below. + + +# Automatically cd to frequently used directories http://robots.thoughtbot.com/post/10849086566/cding-to-frequently-used-directories-in-zsh +setopt auto_cd +cdpath=($HOME/Dropbox/code) + +# Fancy globbing http://linuxshellaccount.blogspot.com/2008/07/fancy-globbing-with-zsh-on-linux-and.html +setopt extendedglob + diff --git a/custom/zsh.sample/before.sample.zsh b/custom/zsh.sample/before.sample.zsh index e69de29..c171f66 100644 --- a/custom/zsh.sample/before.sample.zsh +++ b/custom/zsh.sample/before.sample.zsh @@ -0,0 +1,16 @@ +# +# Samples of what you can do in *.before.zsh files. +# You can create as many files as you like, or put everything in one. +# + +# append your own plugins. the $plugins at the end includes the plugins +# defined by YADR. +plugins=(osx ruby vagrant $plugins) + +# ignore plugins defined by YADR and use your own list. Notice there is no +# $plugins at the end. +plugins=(osx ruby vagrant) + +# set your theme. +export ZSH_THEME="kennethreitz" +