summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.textile4
-rw-r--r--functions.zsh8
-rw-r--r--git.zsh7
-rw-r--r--tools/uninstall.sh20
-rw-r--r--zshrc2
5 files changed, 36 insertions, 5 deletions
diff --git a/README.textile b/README.textile
index f09feec0e..d7169c394 100644
--- a/README.textile
+++ b/README.textile
@@ -41,6 +41,10 @@ TODO: Update this..
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
* much much more..
+h3. Uninstalling
+
+If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
+
h2. Thanks
* Rick Olsen (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
diff --git a/functions.zsh b/functions.zsh
index 0dcfbd39a..d0c24e9e9 100644
--- a/functions.zsh
+++ b/functions.zsh
@@ -24,6 +24,14 @@ function remote_console() {
/usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
}
+function zsh_stats() {
+ history | awk '{print $2}' | sort | uniq -c | sort -rn | head
+}
+
+function uninstall_oh_my_zsh() {
+ /bin/sh $ZSH/tools/uninstall.sh
+}
+
function tab() {
osascript 2>/dev/null <<EOF
tell application "System Events"
diff --git a/git.zsh b/git.zsh
index 1b458762d..b8fd1f08e 100644
--- a/git.zsh
+++ b/git.zsh
@@ -1,10 +1,9 @@
# get the name of the branch we are on
function git_prompt_info() {
- ref=$(git symbolic-ref HEAD 2> /dev/null) || return
- branch=${ref#refs/heads/}
-
if [[ -d .git ]]; then
- CURRENT_BRANCH="(%{$fg[red]%}${branch}%{$reset_color%})$(parse_git_dirty)"
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || return
+ branch=${ref#refs/heads/}
+ CURRENT_BRANCH="git:(%{$fg[red]%}${branch}%{$fg[blue]%})%{$reset_color%}$(parse_git_dirty)"
else
CURRENT_BRANCH=''
fi
diff --git a/tools/uninstall.sh b/tools/uninstall.sh
new file mode 100644
index 000000000..8ff583322
--- /dev/null
+++ b/tools/uninstall.sh
@@ -0,0 +1,20 @@
+echo "Removing ~/.oh-my-zsh"
+if [[ -d ~/.oh-my-zsh ]]
+then
+ rm -rf ~/.oh-my-zsh
+fi
+
+echo "Looking for an existing zsh config..."
+if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
+then
+ echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
+ rm ~/.zshrc;
+ cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
+ source ~/.zshrc;
+else
+ echo "Switching back to bash"
+ chsh -s /bin/bash
+ source /etc/profile
+fi
+
+echo "Thanks for trying out Oh My Zsh. It's been uninstalled." \ No newline at end of file
diff --git a/zshrc b/zshrc
index fb023885f..39e2406f7 100644
--- a/zshrc
+++ b/zshrc
@@ -4,7 +4,7 @@ export ZSH=$HOME/.oh-my-zsh
# Set to the name theme to load.
# Look in ~/.oh-my-zsh/themes/
export ZSH_THEME="robbyrussell"
-export ZSH_THEME="geoffgarside"
+# export ZSH_THEME="geoffgarside"
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore