From: Simon Ruderich Date: Sun, 17 Jan 2010 17:48:47 +0000 (+0100) Subject: zsh: Move OS specific settings to zsh/rc. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=550ad254d2999033615dfd261a7b9e6592e83f89;p=config%2Fdotfiles.git zsh: Move OS specific settings to zsh/rc. --- diff --git a/zsh/env b/zsh/env index 9348028..cff3f19 100644 --- a/zsh/env +++ b/zsh/env @@ -28,8 +28,6 @@ typeset -U path PATH # global env.local. source_config ~/.shell "" env $host -# Load rc file for current OS. -source_config ~/.zsh os env $(uname) nolocal # Load env file for current hostname (first part before a dot) or env.local. source_config ~/.zsh host env $host diff --git a/zsh/os/rc.Darwin b/zsh/os/rc.Darwin deleted file mode 100644 index 992b68c..0000000 --- a/zsh/os/rc.Darwin +++ /dev/null @@ -1,20 +0,0 @@ -# Zsh configuration file for darwin computers (Mac OS X). - - -# Store the current clipboard in CLIPBOARD before every command so it can be -# used in commands. -os_darwin_preexec() { - export CLIPBOARD="$(pbpaste)" -} -# Add the function as preexec hook. -add-zsh-hook preexec os_darwin_preexec - -# Initialize CLIPBOARD so it's available for completion directly after -# startup. -CLIPBOARD="" -export CLIPBOARD - -# Fetch current URL in clipboard with wget. -alias wnc='wget --no-proxy $CLIPBOARD' - -# vim: ft=zsh diff --git a/zsh/os/rc.Linux b/zsh/os/rc.Linux deleted file mode 100644 index 692c60d..0000000 --- a/zsh/os/rc.Linux +++ /dev/null @@ -1,10 +0,0 @@ -# Zsh configuration file for Linux computers. - - -# Settings when creating Debian packages. -DEBEMAIL=simon@ruderich.org -export DEBEMAIL -DEBFULLNAME="Simon Ruderich" -export DEBFULLNAME - -# vim: ft=zsh diff --git a/zsh/rc b/zsh/rc index 390ce7e..4795ab0 100644 --- a/zsh/rc +++ b/zsh/rc @@ -495,8 +495,34 @@ if [[ $TERM != screen* && $TERM != 'dumb' ]]; then fi -# Load rc file for current OS. -source_config ~/.zsh os rc $(uname) nolocal +# OS SPECIFIC SETTINGS + +if [[ $(uname) == Linux ]]; then + # Settings to create Debian packages. + DEBEMAIL=simon@ruderich.org + export DEBEMAIL + DEBFULLNAME="Simon Ruderich" + export DEBFULLNAME + +elif [[ $(uname) == Darwin ]]; then # Mac OS X + # Store the current clipboard in CLIPBOARD before every command so it can + # be used in commands. + os_darwin_preexec() { + export CLIPBOARD="$(pbpaste)" + } + # Add the function as preexec hook. + add-zsh-hook preexec os_darwin_preexec + + # Initialize CLIPBOARD so it's available for completion directly after + # startup. + CLIPBOARD="" + export CLIPBOARD + + # Fetch current URL in clipboard with wget. + alias wnc='wget --no-proxy $CLIPBOARD' +fi + + # Load rc file for current hostname (first part before a dot) or rc.local. source_config ~/.zsh host rc ${$(hostname)//.*/}