From a95e2b8382c3e7112fc07a963aa64b49a886e9dd Mon Sep 17 00:00:00 2001 From: Philipp Frischmuth Date: Mon, 7 Feb 2011 17:18:41 +0100 Subject: [PATCH] Changes for Darwin/OSX --- .hgignore | 1 + Makefile | 14 +++++++++++--- darwin.zsh | 6 ++++++ options.zsh | 3 ++- zshrc | 8 +++++++- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 darwin.zsh diff --git a/.hgignore b/.hgignore index 52cf94f..c0d271a 100644 --- a/.hgignore +++ b/.hgignore @@ -2,3 +2,4 @@ functions.d history private .*-cache +zshrc.bak diff --git a/Makefile b/Makefile index fa3ec0c..8eb3edb 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,18 @@ update: @hg update --repository fizsh install: - mv ../.zshrc zshrc.bak - ln -s zshrc ../.zshrc - touch history private + touch $(HOME)/.zshrc # In cases, where no .zshrc already exists + mv $(HOME)/.zshrc ./zshrc.bak + ln -s $(PWD)/zshrc $(HOME)/.zshrc + mkdir -p $(HOME)/.local/share # Autojump writes to this dir if existing (otherwise we get a autojump_erros file) + touch history private.zsh hg clone git://github.com/joelthelion/autojump.git hg clone git://github.com/nicoulaj/zsh-syntax-highlighting.git hg clone git://github.com/robbyrussell/oh-my-zsh.git hg clone git://fizsh.git.sourceforge.net/gitroot/fizsh/fizsh + +clean: + rm -r ./autojump + rm -r ./zsh-syntax-highlighting + rm -r ./oh-my-zsh + rm -r ./fizsh \ No newline at end of file diff --git a/darwin.zsh b/darwin.zsh new file mode 100644 index 0000000..56aabe1 --- /dev/null +++ b/darwin.zsh @@ -0,0 +1,6 @@ +# Darwin ls command does not support --color option. +alias ls='ls' + +# The OSX way for ls colors. +export CLICOLOR=1 +export LSCOLORS="gxfxcxdxbxegedabagacad" diff --git a/options.zsh b/options.zsh index 5b44811..119e547 100644 --- a/options.zsh +++ b/options.zsh @@ -7,7 +7,8 @@ export GREP_OPTIONS='-D skip --binary-files=without-match --ignore-case' # keybindings Strg+v is your friend :-) -eval "`dircolors -b`" +# Not supported on e.g. OSX, so we test for command first +which dircolors > /dev/null && eval "`dircolors -b`" bindkey "^[[1;5D" .backward-word bindkey "^[[1;5C" .forward-word diff --git a/zshrc b/zshrc index 9d3118b..2cba05b 100644 --- a/zshrc +++ b/zshrc @@ -9,7 +9,6 @@ typeset -ga sources sources+="$HOME/.zsh/options.zsh" sources+="$HOME/.zsh/prompt.zsh" sources+="$HOME/.zsh/functions.zsh" -sources+="$HOME/.zsh/private.zsh" sources+="$HOME/.zsh/aliases.zsh" sources+="$HOME/.zsh/completion.zsh" @@ -25,6 +24,13 @@ sources+="/etc/zsh_command_not_found" # Cloned From: git://github.com/joelthelion/autojump.git sources+="$HOME/.zsh/autojump/autojump.zsh" +# Check for a system specific file +systemFile=`uname -s | tr "[:upper:]" "[:lower:]"` +sources+="$HOME/.zsh/$systemFile.zsh" + +# Finally include the private.zsh file +sources+="$HOME/.zsh/private.zsh" + foreach file (`echo $sources`) if [[ -a $file ]]; then source $file